Two directions, one tool
Convert Tabs to Spaces or Spaces to Tabs without switching pages or reconfiguring settings.
Convert tabs to spaces or spaces to tabs in one click. Set how many spaces equal a tab and watch the conversion and character count update live.
Convert Tabs to Spaces or Spaces to Tabs without switching pages or reconfiguring settings.
Set a custom spaces-per-tab value or pick a 2, 4 or 8 space preset to match your project's style guide.
A live stat line reports exactly how many tabs or space groups were replaced.
The tabs-versus-spaces debate has followed programmers for decades, and most teams eventually settle on one convention enforced by a linter or editor config. Tabs are a single character that each editor can render at its own preferred width, which makes them flexible for personal preference but risky when a file is viewed somewhere that assumes a different width, since alignment can shift unexpectedly. Spaces render identically everywhere because every space is exactly one column wide, which is why many style guides, including several popular ones for Python, JavaScript and Go-adjacent tooling, standardize on spaces despite the larger file size. Mixed files are the real problem in practice: when tabs and space-based indentation exist side by side, lines that look aligned in one editor can appear staggered in another, and diffs become noisy. This converter lets you move a whole document to one convention or the other in a single pass, using an exact character-for-character replacement so the underlying structure of your code or text never changes, only the whitespace representation.
Consistency across a file or project avoids the alignment drift that mixed indentation causes.
Many formatters and style guides enforce a specific tab width; convert your file to match before committing.
Conversion only touches tab characters or space runs, so content and line breaks stay exactly as they were.
Choose a direction, either Tabs to Spaces or Spaces to Tabs, set how many spaces represent one tab, then paste your text. The conversion updates live and the result is ready to copy or download.
Runs of spaces are converted in full tab-width chunks. If a run of spaces is not an exact multiple of the tab width, the remainder stays as spaces so alignment is preserved.
2, 4 and 8 spaces per tab are the most common conventions, with 4 being the default for many programming style guides. Presets for all three are built into the tool.
No. The converter only replaces tab characters or runs of spaces depending on the direction you choose. All other characters, including line breaks, are left untouched.
Yes. It runs entirely in your browser, requires no account, and your text is never uploaded to a server.