Convert indentation between tabs and spaces with configurable width — right in your browser.
Tabs versus spaces is the longest-running argument in programming, but the practical problem is simpler: code indented one way lands in a project that uses the other, and suddenly Python raises TabError, diffs fill with whitespace noise, and files look misaligned in every editor with a different tab size. This converter fixes an entire block at once — paste, choose the width your project uses, click, done — instead of hunting line by line.
The conversion is column-aware, not a blind find-and-replace. Going from tabs to spaces, each tab expands to the next tab stop: a tab at column 0 with width 4 becomes four spaces, but a tab after one character becomes three, exactly as your editor renders it — so mixed indentation like a space followed by a tab comes out visually identical. Going the other way, the leading whitespace is first expanded to plain spaces and then regrouped into as many full tabs as fit, keeping any remainder as spaces rather than corrupting the alignment.
By default only the whitespace at the beginning of each line is touched, because that is almost always what you want: indentation changes while strings, comments and inline alignment stay intact. Tick "Convert everywhere in the text" when you really do want tabs inside the line converted too — for example when preparing tab-separated data or cleaning text copied from a terminal. The status line reports how many lines were modified, a quick sanity check before you paste the result back, and the whole thing runs locally, so proprietary code never leaves your machine.
Whatever your project already uses — consistency matters more than the choice. PEP 8 mandates 4 spaces for Python, the Go formatter enforces tabs, and most JavaScript style guides use 2 spaces; this tool converts between all of them.
Because the file mixes tabs and spaces, which Python 3 rejects with TabError or IndentationError. Paste the code here, convert everything to spaces with width 4, and the block becomes consistent.
Not by default — only the leading indentation is converted, so strings and inline alignment are preserved. Enable "Convert everywhere in the text" to convert tabs and space runs across whole lines.
Using real tab stops: the converter tracks the column and expands each tab to the next multiple of the chosen width, exactly as editors render it, so the converted line keeps the same visual width.
No. The conversion runs 100% in JavaScript on your device — nothing is uploaded, transmitted or stored, so it is safe for proprietary source code.
Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.
Vai.la is not responsible for how the tools are used or for decisions made based on their results.