Convert tabs to spaces
Swap tab characters for spaces, or the other way round.
Editor
Convert tabs to spaces: what it does
Tabs show differently in every editor, which breaks the layout of code and tables. Replace each tab with a fixed number of spaces, or go the other way and turn groups of four spaces into tabs.
Convert tabs to spaces: how to use it
- Paste the text that contains tabs or indentation.
- Choose the tool and, for tabs to spaces, the number of spaces per tab.
- Select Apply and copy the result.
Convert tabs to spaces: when to use it
- Match the indentation rules of a project before committing code that was written with tabs.
- Fix a Python or YAML file that fails because tabs and spaces are mixed.
- Paste tab-separated data into a place where tabs are lost or shown wrongly.
Convert tabs to spaces: examples
Input
name color apple red
Result
name color apple red
Input
if ready: start() log()
Result
if ready:
start()
log()Convert tabs to spaces: questions and answers
How many spaces does a tab become?
You choose from 1 to 16; four is the default. Spaces to tabs always uses groups of four.
Does it work on code?
Yes. It changes only the indentation characters, so your code stays the same otherwise.
Does it change tabs in the middle of a line?
Yes. Every tab character is replaced, wherever it is, including tabs that separate columns.
Why did Spaces to tabs leave some spaces?
Only groups of four spaces become a tab. Two or three leftover spaces are kept so the alignment of the text does not change.
Is my text sent to a server?
No. Everything runs in your browser on your own device, so your text never leaves it.
Related tools
Tools people often use together with this one.
- Remove extra spaces
Clean up double spaces and stray whitespace.
- Remove line breaks
Turn many lines into one line in a click.
- Remove punctuation
Delete punctuation marks, or all digits, from your text.
- Remove emojis from text
Strip emoji and pictographs, keep the words.
- Remove HTML tags
Strip HTML tags and keep only the text.
- Remove accents from text
Replace accented letters with plain ones, or drop non-ASCII characters.