Some editors, makefiles, and data formats expect real tabs for indentation, but text often arrives indented with spaces instead.
Replace Spaces With Tabs turns each group of spaces into a single tab using the width you set.
How to use Replace Spaces with Tabs
- Set the number of spaces that should become one tab.
- Paste space-indented text such as code or a makefile.
- Copy the tab-indented result for the tool that needs real tabs.
Use cases
- Restoring tab indentation in a makefile that requires tabs.
- Converting space indentation to tabs for a tab-based code style.
- Preparing tab-separated data from a space-aligned source.
Good to know
Replace Spaces With Tabs scans for runs of exactly the chosen number of spaces and replaces each run with one tab, using a width from one to sixteen. It is the reverse of the tabs-to-spaces tool. Spaces that do not make up a full group are left in place.
Frequently asked questions
What if the spacing is not a clean multiple?
Only full groups of the chosen size become tabs; leftover spaces that do not fill a group remain as spaces.
Why would I want tabs instead of spaces?
Makefiles and some data formats and code styles require real tab characters for indentation or separation.
Does it touch single spaces between words?
Only runs that match the chosen width are converted, so ordinary single spaces between words are left alone.