Skip to content

Remove Tabs

Replace each tab with
Text without tabs —
Tabs found
—
Lines changed
—
Length before
—
Length after
—

Paste your text and every tab character is replaced as you type: with one space, with enough spaces to reach the next tab stop, or with nothing. With 8-column stops, ab followed by a tab and c becomes ab, six spaces and c, nine characters long, so columns stay lined up.

About this tool

Tabs slip into text from spreadsheet cells, code editors and PDF exports, and they cause trouble later: a form rejects them, a CSV importer splits on them, or a code linter flags mixed indentation. This page finds every tab character and replaces it the way you choose. One space is the right fit for prose and copied table rows. Spaces to the next tab stop keep aligned columns and indented code looking the same in a plain-text editor. Deleting joins the text on either side. The stats show how many tabs were found, how many lines changed and the length before and after. Spaces typed by hand are left alone; for runs of spaces use a whitespace cleaner instead.

How to use it

  1. Paste or open text

    Paste into the box or open a .txt, .csv or .tsv file from your device.

  2. Choose the replacement

    Pick one space, spaces to the next tab stop, or nothing.

  3. Set the tab width

    For tab stops, use the stepper to choose 1 to 16 columns; 8 matches Unix tools, 4 is common in code.

  4. Copy the cleaned text

    Check the tab count and copy the result into your document or editor.

Examples

A copied spreadsheet row

Text with tabs
Name Age City
Replace each tab with
One space

Result Text without tabs: Name Age City
Tabs found: 2
Lines changed: 1
Length before: 13
Length after: 13

  1. Found 2 tab characters on 1 of 1 lines.
  2. Replaced every tab with a single space.
  3. Length went from 13 to 13 characters.

Cells pasted from a spreadsheet are separated by tabs; each becomes one space.

Expand to 8-column tab stops

Text with tabs
ab c
Replace each tab with
Spaces to tab stop
Tab width
8

Result Text without tabs: ab c
Tabs found: 1
Lines changed: 1
Length before: 4
Length after: 9

  1. Found 1 tab characters on 1 of 1 lines.
  2. Expanded every tab with spaces up to the next multiple of 8 columns.
  3. Length went from 4 to 9 characters.

The tab after two letters is padded with six spaces so c starts in column 9, as the Unix expand command does.

Delete tabs outright

Text with tabs
indented line
Replace each tab with
Nothing

Result Text without tabs: indentedline
Tabs found: 2
Lines changed: 1
Length before: 14
Length after: 12

  1. Found 2 tab characters on 1 of 1 lines.
  2. Deleted every tab character.
  3. Length went from 14 to 12 characters.

Both the leading indent and the inner tab are removed, so the two words join.

How it is calculated

spaces added = w − (c mod w), for a tab found at column c

w
tab width in columns, from 1 to 16
c
number of characters already on the line before the tab, counting from 0

Each line is read from left to right. In tab-stop mode a running column count is kept, and a tab is replaced by just enough spaces to reach the next multiple of w, the rule the POSIX expand utility uses. That is why a tab after two letters becomes six spaces at width 8 but a tab after eight letters becomes a full eight. The other two modes ignore columns and change each tab into for one space or remove it.

When not to use it

  • For tab-separated data you still need to import, converting tabs destroys the column boundaries.
  • Makefiles require tab-indented recipe lines, so replacing those tabs breaks the build.

Common mistakes

  • Choosing one space for indented code, which flattens nested blocks to a single level of indentation.
  • Using a tab width that differs from the editor the text came from, so columns shift out of line.

Frequently asked questions

What tab width should I pick?

Use the width of the program that produced the text. Terminals and Unix tools such as expand default to 8 columns, while most code editors and style guides use 4, and some web projects use 2.

Why did one tab become fewer spaces than the tab width?

A tab moves to the next tab stop, not a fixed distance. If three characters already sit before it on an 8-column grid, only five spaces are needed to reach column 8.

Are leading spaces or double spaces changed?

No. Only the tab character itself is touched. Spaces you typed, line breaks and every other character pass through unchanged.

Why do I see tabs in text copied from Excel or Google Sheets?

Spreadsheets put a tab between cells and a line break between rows when you copy a range, so pasted rows arrive tab-separated.

Does the text leave my browser?

No. The replacement runs on your device, and files you open are read locally rather than uploaded to a server.

Cite this tool

Using this tool in an assignment, article or report? Copy a citation, or a link for your website.

APA

Tools Directory Editorial Team. (2026, October 19). Remove Tabs. Tools Directory. Retrieved October 26, 2026, from https://tools.milunir.com/text-tools/cleanup-sorting-and-lists/remove-tabs/

MLA

Tools Directory Editorial Team. “Remove Tabs.” Tools Directory, 19 Oct. 2026, https://tools.milunir.com/text-tools/cleanup-sorting-and-lists/remove-tabs/. Accessed 26 Oct. 2026.

Chicago

Tools Directory Editorial Team. “Remove Tabs.” Tools Directory. Last modified October 19, 2026. Accessed October 26, 2026. https://tools.milunir.com/text-tools/cleanup-sorting-and-lists/remove-tabs/.

Link<a href="https://tools.milunir.com/text-tools/cleanup-sorting-and-lists/remove-tabs/">Remove Tabs – Tools Directory</a>