Tabs to Spaces
Tabs to Spaces replaces every U+0009 tab with the chosen number of ordinary spaces. Blank, zero, negative, or nonnumeric size falls back/clamps to at least one through the implementation's numeric conversion, with a default of two. It does not expand tabs to visual tab stops based on current column, detect indentation only, preserve alignment, or change other whitespace.
Runs locally — files stay on your deviceDoes each tab expand to the next tab stop?
No. Every tab becomes the same fixed number of spaces.
Fixed replacement differs from tab-stop expansion
Editors often advance a tab to the next column multiple; fixed replacement ignores the tab's current position.
How it works
A global tab regex calls ' '.repeat(max(1, Number(size) or 2)).
Key concepts
Literal U+0009 only
Other whitespace stays.
Same width everywhere
Column position is ignored.
When to use it
- Replace indentation tabs under a fixed-width convention.
- Prepare simple text for a spaces-only system.
- Make tab characters visible as spacing.
When not to use it
- Do not expect column alignment for mixed positions.
- Do not alter tabs inside data formats blindly.
- Do not assume editor tab-stop semantics.
Worked examples
Default
- Input
a\tb; blank size- Expected output
a b
Two spaces fallback.
Four
- Input
\titem; size 4- Expected output
item
Fixed run.
Mid-column
- Input
abc\tx; size 4- Expected output
abc x
Not next multiple of four.
Common mistakes
Expecting tab stops
Replacement is fixed. Correction: Use column-aware expansion.
Changing TSV
Tabs may be delimiters. Correction: Parse the format first.
Assuming zero means remove
Minimum one applies. Correction: Use Find and Replace to delete tabs.
Best practices
- Choose a documented width.
- Avoid delimiter-bearing tabular text.
- Review visual alignment.
Related operations and differences
Trim Whitespace
Choose Trim Whitespace when you need to remove leading and trailing whitespace from lines.; use Tabs to Spaces specifically for tabs to spaces.
Add Prefix to Every Line
Choose Add Prefix to Every Line when you need to add the same prefix before every line.; use Tabs to Spaces specifically for tabs to spaces.
Add Suffix to Every Line
Choose Add Suffix to Every Line when you need to add the same suffix after every line.; use Tabs to Spaces specifically for tabs to spaces.
Capitalize Every Word
Choose Capitalize Every Word when you need to capitalize the first character of every word.; use Tabs to Spaces specifically for tabs to spaces.
Character Counter
Choose Character Counter when you need to count Unicode characters in text.; use Tabs to Spaces specifically for tabs to spaces.
Extract Email Addresses
Choose Extract Email Addresses when you need to find unique email addresses in text.; use Tabs to Spaces specifically for tabs to spaces.
Limitations and privacy
- Literal tab to fixed spaces only; no column-aware stops, indentation-only mode, other whitespace, visual preview, or formatter integration.
Text is transformed locally in this browser and is not uploaded by the tool.
Frequently asked questions
What is the default width?
Two spaces.
Can size be zero?
It is clamped/falls back to at least one.
Are spaces elsewhere changed?
No.
Is TSV safe?
No, tabs may be delimiters.