Tabs ↔ Spaces Converter

Convert tabs and spaces using explicit tab stops, either in leading indentation or throughout each line.

Loading Tabs ↔ Spaces Converter...

How to use

Choose a direction and tab width. Indentation scope changes only leading tabs/spaces; whole-text scope also changes spacing inside line content.

Example

Input
const value = 1;
Output
const value = 1;

Limitations

Space-to-tab conversion follows tab stops and cannot recover the intent of arbitrary spacing. Whole-text conversion can alter table or prose alignment.

Frequently Asked Questions

What does tab width mean?

A tab advances to the next column divisible by the chosen width; it is not always replaced by a fixed count of spaces.

Can I leave spaces inside code untouched?

Yes. Use the default Leading indentation scope so only whitespace before the first non-whitespace character is converted.