Tabs to Spaces
Convert tab characters to a set number of spaces, for consistent code indentation.
Replaces every tab character with a fixed number of spaces — the fix for code that renders inconsistently across editors because someone's tab-width setting differs from everyone else's, or for pasting tab-indented code into a context that only supports spaces.
Example: A line indented with one tab character converts to 4 leading spaces (or however many you set), so code that mixed tabs and spaces renders consistently everywhere.
How it works
- Paste text or code containing tabs
- Set how many spaces each tab should become
- The converted result appears instantly, on your device
Frequently asked questions
What tab width should I use?
4 spaces is the most common default (Python's PEP 8, many JavaScript style guides); 2 spaces is common in web-focused codebases. Match whatever your project's existing style already uses.
Is my text uploaded anywhere?
No — Tabs to Spaces runs entirely in your browser using JavaScript/WebAssembly. Your text is never sent to a server.
Does this convert tabs in the middle of a line too, not just leading indentation?
Yes — every tab character in the text is converted, wherever it appears, not just ones used for indentation at the start of a line.