Replace Tabs with Spaces

Convert tabs and spaces in plain text when indentation or alignment is inconsistent.

It is useful for code snippets, tab-delimited text, pasted editor output, and files that need a consistent spacing style before reuse.

Choose whether to expand tabs, compress spaces, remove tabs, or collapse repeated tabs into a single character.

Options

Actions

Frequently Asked Questions

What kind of formatting problems does this tool solve?
Use it when indentation or alignment is inconsistent because some lines use tabs and others use spaces.
Paste the text, choose the conversion direction or cleanup mode, set the tab size, and click Convert Text.
This is especially useful for code snippets, copied table-like text, tab-delimited content, and editor migrations.
How do the four conversion modes differ?
Convert tabs to spaces replaces each tab with the number of spaces you choose.
Convert spaces to tabs turns matching groups of spaces back into tabs. Remove all tab characters deletes tabs entirely.
Convert multiple tabs to one tab is for text that contains several tabs in a row.
How does tab size affect the conversion?
Tab size defines how many spaces represent one tab in the conversion logic, so a tab size of 4 turns one tab into four spaces and four consecutive spaces back into one tab.
These are direct character replacements rather than smart visual alignment based on column position.
That makes the behavior predictable for plain text cleanup, but you should still review code that depends on exact indentation style.
Which edge cases should I double-check?
Spaces to Tabs only converts exact groupings that match your chosen tab size, so leftover spaces may remain when the count is uneven.
Because the tool does not simulate editor tab stops, visually aligned columns may shift in some texts after conversion.
Very large pasted files still process locally in the browser and may take longer on older devices.
How is this different from Merge Text Lines?
Replace Tabs with Spaces fixes horizontal spacing and indentation characters inside each line.
Merge Text Lines changes vertical structure by joining multiple lines together with a separator.
Choose this page when the problem is tabs versus spaces, not line breaks versus joined output.