Skip to content
ZeroServer.tools

Tabs to Spaces Converter

Convert tabs to spaces or spaces to tabs with a custom tab width.

Output

Converting between tabs and spaces

Indentation style is one of the oldest debates in programming. This tool flips a file either way: Tabs → Spaces replaces each tab with your chosen number of spaces, and Spaces → Tabs collapses leading indentation back into tab characters. Many style guides (and tools like Go and Make) expect one or the other, so this is handy for normalizing a file before committing.

Need other whitespace fixes? See remove extra spaces and remove empty lines. It all runs locally in your browser.

Related Text Tools tools