Web Tools
Text Indent Converter
Convert between tabs and spaces in your code. Auto-detects indentation style, configurable tab width (1-8), mixed indent detection, and conversion statistics. Runs entirely in your browser — your data never leaves your machine.
indent tabs spaces code formatting whitespace
Published May 30, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Paste code and choose a conversion mode: tabs to spaces, spaces to tabs, or auto-detect. The tool analyzes the indentation pattern and converts accordingly. Tab width is configurable from 1 to 8 spaces.
Features
- 3 modes: tabs to spaces, spaces to tabs, auto-detect
- Configurable tab width: 1, 2, 3, 4, 6, or 8 spaces
- Auto-detection: detects current indentation style (tabs, spaces, or mixed)
- Width inference: automatically infers space width from existing indentation (GCD-based)
- Mixed indent handling: detects and fixes mixed tab/space indentation
- Statistics: total lines, indented lines, converted lines, max depth, detected style
- 5 examples: tabs to 2/4 spaces, 4/2 spaces to tabs, mixed auto
- Private: runs entirely in the browser — no data transmitted
Use Cases
- Converting between team coding standards
- Fixing mixed indentation from copy-paste
- Reformatting code from different editors
- Preparing code for linting with specific indent rules