Tab and Space Converter
Expand tab stops or compress leading spaces with an explicit tab width.
Loading tool…
How to use Tab and Space Converter
Convert indentation while accounting for the current column. Expanding a tab can require fewer spaces than the configured width when text already occupies part of the stop.
- Enter input, tab width.
- Choose the settings for tab and space converter, then run the tool.
- Review the result and any limitations before copying or downloading it.
Good to know
- Column counts use graphemes, not terminal display-cell widths. Output line endings are LF.
- Compression changes only leading spaces and leaves existing tabs intact. Review code literals before editing code.
- Processing is local. Output is limited to 1,000,000 text characters unless a stricter file limit is stated.
Common questions
Is each tab always replaced by four spaces?
No. Expansion advances to the next tab stop, based on the current grapheme column.
Is this input sent to a server?
No. The application processes this input inside your browser tab and does not save it to persistent storage.
Keep going with related tools
All text →Text Indenter
Add or remove a fixed indentation prefix on non-empty lines using spaces or tabs.
TextWhitespace Auditor
Report line-ending styles, indentation, trailing whitespace, BOM, and final-newline state without editing input.
DeveloperSupported EditorConfig Pair Resolver
Resolve EditorConfig source pairs for explicit virtual files using a bounded selected ASCII glob/path profile with root, precedence and unset witnesses.