Tabs to spaces
Convert tabs to spaces or pack spaces back into tabs, at any tab width.
Related tools
Tabs to spaces
Tabs or spaces is the oldest argument in programming, and the answer usually depends on whose file you have open. This tool settles it for a given block of text: paste code, a config file, a Makefile or a column of exported data, pick a direction, and the whitespace is rewritten to match.
Converting tabs to spaces expands each tab the way an editor does — a tab advances the cursor to the next tab stop rather than blindly inserting a fixed number of spaces, so the character after it lands in the same column it did before. Choose 2, 4 or 8 spaces per tab, or set a custom width between 1 and 16. Going the other way, spaces to tabs packs runs of blanks back into tabs wherever a tab reaches the same column, and leaves any leftover spaces in place so nothing shifts.
Indentation only restricts the conversion to the leading whitespace of each line, which is what you want for source code: indentation gets normalised while tabs inside strings, comments or aligned TSV columns are left alone. Turn it off to rewrite every tab and every run of blanks in the text. Windows (CRLF), Unix (LF) and classic Mac (CR) input all work, and the output always uses LF. The tally under the output shows how many tabs went in, how many came out and how many lines changed, so a mistaken width is obvious immediately.
Everything happens in your browser. Your code is never uploaded, so proprietary source, internal configuration and client data are all safe to paste. Copy the result, download it as a .txt file, or send it back to the input for another pass.