Tabs to spaces converter

Replace tab characters with spaces so your text looks the same everywhere. Pick a tab width of 2, 4 or 8 and the columns stay aligned.

Tab width

How it works

  1. Paste your text

    Type or paste the text in the left box, or open a .txt file. No text to hand? Click Example.

  2. Instant result

    The result appears as you type. Change the options and see straight away what changes.

  3. Copy or download

    Copy the result with one click, save it as a file or use it as input for a next step.

How tabs become spaces

A tab jumps to the next tab stop, so it isn't always the same number of spaces. This tool works out how many spaces are needed to reach the stop, which keeps columns of text and code lined up. With a tab width of 4, id⇥name becomes id name (two spaces), while abcd⇥name gets four.

Tick Only tabs at the start of a line to convert indentation but leave tabs inside the line alone, for example in tab-separated data.

The note shows how many tabs were replaced. To go the other way, use spaces to tabs.

Frequently asked questions

Is the tabs to spaces free?

Yes. The tabs to spaces is completely free, with no account, sign-up or usage limit.

Is my text stored?

No. Your text is processed in your browser and is not sent to a server or stored.

Is there a maximum length?

No, there is no fixed limit. Very long texts can just be a little slower.