Free · Private · In-Browser

Tabs Spaces Converter

Convert tabs to spaces or spaces to tabs with a chosen width.

Output
 

Convert tabs and spaces

Mixed tabs and spaces cause misaligned code and noisy diffs, and teams standardize on one. This converter switches indentation between tabs and spaces at a width you choose, so a snippet matches your project’s convention.

Normalizing indentation prevents the whitespace-only changes that clutter version control and the alignment bugs that mixed indentation causes. Paste your code, pick the direction and width, and copy the consistently indented result.

Consistent indentation

Standardizing on tabs or spaces removes the misaligned code and noisy diffs that mixed indentation causes. Conversion runs in your browser and never uploads anything.

Frequently asked questions

How do I convert tabs to spaces?

Choose tabs to spaces and set the width, usually 2 or 4. Every tab becomes that many spaces.

How does spaces to tabs work?

Leading indentation is converted in steps of the chosen width. Spaces inside lines are left alone.

Why does indentation still look wrong?

The file may mix widths. Try the width the original author used, often 2, 4, or 8.

Take it further
Developer Tools

Practical utilities for everyday web development work.

Learn more