Tabs to Spaces
Convert tabs to spaces at a fixed width, or align them to tab stops.
Browser onlyYour data never leaves this device.
Runs entirely in your browser. Your text never leaves this device and is never stored.
Details: Privacy policy
Input
Tabs are replaced live. Nothing is stored.
Whole number from 1 to 16.
Result
No text yet.
Paste text containing tabs above.
Tabs to Spaces replaces tab characters with spaces in one of two ways, because the two answers are not interchangeable. Fixed mode turns every tab into the same number of spaces, which is what you want when a system rejects tabs outright and the exact indentation no longer matters. Stops mode advances to the next multiple of the chosen width, so columns line up the way a code editor would draw them: after three characters, a tab of width four inserts one space, while at the start of a line it inserts four. The page reports how many tabs it replaced, so a file that looked tab-free is shown to have contained them. Line endings normalise to LF, and only tab characters are touched - spaces, punctuation and letters stay exactly where they were. One honest limit: tab stops count code points rather than display width, so CJK characters and emoji do not consume two columns here even though a terminal may draw them wider. It is the tool for making tab-indented code safe to paste into a form, aligning pasted columns, and converting a tab-separated draft before a system that expects spaces. In stops mode, the width is the distance between stops, not the number of spaces inserted at every tab, so the same tab can produce a different count depending on its column.
How to use Tabs to Spaces
- Paste text containing tabs.
- Choose fixed width or tab stops and set the width.
- Copy the converted text or clear to start over.
What you get
- The text with every tab replaced by spaces, either fixed or at tab stops.
- A count of tabs that were replaced.
- All other characters and line breaks preserved, with LF endings.
When to use Tabs to Spaces
- Replace tabs in pasted code before submitting it to a form that rejects them.
- Expand tabs to four-column stops so pasted columns line up.
- Normalise a tab-indented list before sending it to a text-only system.
Frequently asked questions about Tabs to Spaces
What is the difference between fixed and stops?
Fixed replaces each tab with the same number of spaces. Stops inserts only enough spaces to reach the next multiple of the width, which keeps columns aligned.
Why do my CJK columns still look misaligned?
Stops count code points, not display cells. A wide character counts as one here even though a terminal may render it two columns wide.
Are line endings changed?
CRLF and CR are normalized to LF so the per-line stop calculation is consistent. Spaces and other characters are untouched.
Is my text uploaded?
No. Conversion runs in your browser; nothing is sent to a server or stored.
Guides that compare Tabs to Spaces
Tools related to Tabs to Spaces
- Spaces to Tabs
Convert runs of spaces to tabs, either everywhere or only in indentation.
- Add Line Numbers — prefix every line with a counter: custom start
Prefix every line with a counter: custom start, step, and separator.
- Case Converter
Switch text between uppercase, lowercase, title, and sentence case.
- Grep Text — filter lines by literal text or a JavaScript regular
Filter lines by literal text or a JavaScript regular expression, keeping or inverting matches.
- Head Text (First N Lines)
Extract the first N lines of a text, exactly as written.
- HTML Encode/Decode — escape markup characters as HTML entities
Escape markup characters as HTML entities, or decode entities back to text.
⚡Embed Tabs to Spaces on Your Site & Get Badge↓
Embed this in-browser tool into any blog, documentation, or dashboard. Includes an optional dofollow backlink badge to credit Tools Hub.
<iframe src="https://salaq.com/embed/text/tabs-to-spaces" title="Tabs to Spaces — Tools Hub" width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden;max-width:100%;" loading="lazy"></iframe>
<p style="font-size:12px;color:#6b7280;margin-top:6px;font-family:system-ui,-apple-system,sans-serif;">Powered by <a href="https://salaq.com/tools/text/tabs-to-spaces" target="_blank" rel="noopener" style="color:#2563eb;text-decoration:underline;">Tabs to Spaces on Tools Hub</a></p>Feedback
Send feedback about this tool (placeholder — feedback collection is not wired up yet).