Convert tabs into spaces in code formatting

Please log in or register to do it.

This tool converts tab characters in your code into spaces. It provides flexible options to suit your needs: • Convert all tabs into a fixed number of spaces. • Convert only leading (indentation) tabs to spaces (preserving inline tabs). • Replace tabs with a custom replacement string. Simply paste your code, specify your settings, and choose the desired conversion mode.

Settings:

Conversion Modes:


Replaces every tab character in the code with the specified number of spaces.

Converts only the tabs at the beginning of each line (used for indentation) to spaces. Tabs within a line remain unchanged.

Replaces each tab with a custom string. Enter your custom replacement below.

Examples:

Convert All Tabs

Every tab in the code is converted to spaces.

Before:
function example() {
	// This line is indented with a tab.
	console.log("Hello");
}
After (Spaces per Tab = 4):
function example() {
    // This line is indented with a tab.
    console.log("Hello");
}

Convert Only Leading Tabs

Only the leading tabs (indentation) are converted to spaces; inline tabs remain.

Before:
		function example() {
			// Leading tab converted; inline tab remains:	Example
		}
After (Spaces per Tab = 4):
    function example() {
        // Leading tab converted; inline tab remains:	Example
    }

Custom Replacement

Each tab is replaced with a custom string.

Before:
function example() {
	// Tab before comment.
	console.log("Hello");
}
After (Custom Replacement "[TAB]"):
function example() {
[TAB]// Tab before comment.
[TAB]console.log("Hello");
}
Extract words containing special characters
Convert text to InVeRsE CaSe

Your email address will not be published. Required fields are marked *