Remove Tabs

Removes tabs from text and code: snapping to tab stops, replacing with spaces or a custom separator, handles indents and line endings.

What to do with the tabs
A tab extends to the next column that is a multiple of the width; this is how code editors display it.

Tabs can be expanded to alignment stops, replaced with spaces at a chosen width, with a single space, with a semicolon or a comma, removed entirely, or you can touch only the leading indentation or only the tabs at the end of lines.

Line breaks

A browser text field converts Windows line breaks to single ones: this is a property of the field itself, and it cannot be bypassed when pasting text. That is why an uploaded file is processed raw, and the downloaded file keeps the line breaks from the original. As soon as you edit the text by hand, the tool works with whatever is in the field.

What expanding to stops means

A tab is not "so many spaces" but a jump to the next column that is a multiple of the tab width. With a width of 4, a tab after a three-letter word adds one space, and after a four-letter word it adds four. This is exactly how code editors and the expand utility render tabs, so the converted text looks exactly the way it did in the editor.

A simple "one tab equals four spaces" substitution does not give the same result: columns shift, even though they lined up in the editor. If you need table columns to line up exactly, choose a width larger than the longest cell.

Indentation and mixed code

The "Indents only" mode touches only the whitespace chunk at the start of a line, including a tab that follows spaces, and expands it to a column. If some lines in your text are indented with tabs and others with spaces, the tool reports this in numbers: in Python, mixed indentation raises a TabError.

Tables from Excel

When you copy from Excel or Google Sheets, columns are separated by tabs. Replacing tabs with semicolols turns such a paste into CSV lines, which Excel can then split back into columns.

Rate this tool

Help us get better

Other tools