← Text & List Tools
Text & List Tools · runs locally

Tabs and Spaces Converter

Expand tab stops to spaces or compress leading indentation into tabs with an explicit width and preserved content after indentation.

Ready. Your working data stays in this browser.

Why this tool is useful

Use this tool to standardize pasted code, Makefiles, terminal snippets or documentation without deleting meaningful spaces inside the line.

How it works

Expansion follows real tab stops rather than replacing every tab with a fixed count. Compression affects leading full-width indentation groups only.

Practical example

With width four, a leading tab becomes four spaces; eight leading spaces become two tabs in the reverse direction.

Validation

The calculation is deterministic and explains validation errors instead of silently changing invalid input.

Privacy boundary

Input and output remain in this tab. Copy and download happen through browser APIs without a server upload.

Result passport

Every run reports its tool mode, timestamp and input/output size so transformed data can be audited.