Two ways to indent, each with a price
Indentation comes as tabs or as spaces. A tab is one byte whose display width depends on the editor, two, four or eight columns; spaces occupy exactly as many columns as there are, consistent across editors. So one file opened on two machines shows different tab widths, indentation loses alignment and looks broken. The tool converts both ways: tabs to spaces of a chosen width, or spaces to tabs, at two, four or eight columns.
Steps
- Paste the text and decide whether it belongs in code or prose.
- Choose tabs to spaces or spaces to tabs.
- Set the width to two, four or eight by the target convention.
- Run it and check that the indentation still steps evenly.
- Copy or download and open it in the target editor.
- Clear for the next file.
Alignment, mixing, irreversibility
Tabs to spaces is lossless once the width is fixed. Spaces to tabs is lossy, aligning cleanly only when each space run is a multiple of the width, and misaligned lines get snapped to tab stops and look worse. Mixing is the root of the problem: one file part tabs and part spaces displays raggedly, and reviews show huge diffs where only whitespace differs. Do not convert spaces inside sentences, which opens gaps mid-line. Configuration formats often forbid tabs outright and fail to parse when they appear.
Common mistakes
Spaces to tabs leaving ragged indentation because runs are not multiples. A wrong width changing every visual level. Converting inline spaces and opening gaps inside sentences. Long-term mixing of tabs and spaces in one file. Keeping tabs in a format that forbids them. And shipping without checking in the target editor.
Where the tool should stay put
Team convention settles indentation, not personal preference. Whitespace-sensitive languages demand validation on a branch before any automatic change. Shared files should not be converted unilaterally, which produces whole-file diffs. Data files with aligned spaces keep them, or columns shift. And arguing about indentation style while ignoring code quality gains nothing.