Tabs to spaces converter
Useful when text or code lines up differently from one editor to another: tabs become spaces that look the same everywhere.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter text, tab width and replacement mode.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Tab-stop mode replaces each tab with width − (current column mod width) spaces, reaching the next multiple of the width. Fixed mode replaces each tab with exactly N spaces.
Example
Inputs: Tab width = 4 spaces, Replacement mode = Align to tab stops. Result: Result: name qty price apple 3 1.25 indented line; Tabs replaced: 5.
name qty price apple 3 1.25 indented line
name qty price
apple 3 1.25
indented lineLimits and caveats
- Alignment counts each character as one column, so it can drift with wide characters or proportional fonts.
Questions about this tool
What is the difference between the two modes?
Tab-stop mode keeps columns lined up as in an editor, while fixed mode puts the same number of spaces for every tab wherever it is.
Why do developers convert tabs to spaces?
Spaces render at the same width in every editor and code review, and style guides such as PEP 8 ask for them.
Does anything besides tabs change?
No. All other characters and lines stay as they are.
