Skip to content
Jellykit

Tabs to Spaces Converter

Convert tabs to spaces or spaces to tabs with a tab width of 2, 4 or 8. Change only leading indentation or every tab, with tab stops respected. Free tool.

Runs in your browser. Nothing is uploaded.

About Tabs to Spaces Converter

Tabs to Spaces re-indents code or text to match a project's style. Tab stops are respected, so a tab after two characters only advances to the next stop, exactly like an editor would.

By default only leading indentation is converted, leaving tabs inside strings and aligned comments alone. Switch to spaces to tabs to go the other way, with leftover spaces kept for alignment.

How to use Tabs to Spaces Converter

  1. Type or paste your text into the input box. Press Sample to see an example.
  2. Adjust the options. The result updates as you type.
  3. Copy the result, or press Use as input to chain another transformation.

Frequently asked questions

What tab width should I use?

Match your project. 2 is common for JavaScript and YAML, 4 for Python, Java and C#, and 8 is the traditional terminal default.

Does YAML allow tabs?

No. YAML forbids tabs for indentation, so convert them to spaces.

Is Tabs to Spaces Converter free and private?

Yes. Tabs to Spaces Converter is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.

See all developer tools →