Tabs to Spaces
Convert tab characters into a specific number of spaces for consistent alignment.
Accessible • Mobile-friendly • Fast
Pro tip: If you need to convert the other way, see Spaces to Tabs. To remove extra spacing after conversion, try Remove Extra Spaces.
About this converter
Many editors and systems handle tabs differently. Converting tabs into spaces ensures consistent rendering across environments (browsers, code reviewers, CMS editors). This tool performs an exact replacement of \t with the chosen number of space characters.
How to use
- Paste or type the text in the input box.
- Choose the number of spaces per tab (commonly 2 or 4 for code).
- Click Convert to replace tabs in-place, or Preview to see the output without modifying the original.
- Use Copy to copy the converted text, or Undo to revert the last conversion.
Examples
Input (tabs shown as →):function test() {→console.log('tabbed');→→return true;}
Converted (4 spaces):function test() { console.log('tabbed'); return true;}
Who should use it?
Developers, technical writers, content editors, and anyone preparing text for systems that do not render tab stops reliably. If you clean data for spreadsheets or want consistent indentation in blog code blocks, this is helpful.