Home / Text and List Tools / Tabs to Spaces Converter
Free online tool

Tabs to Spaces Converter

Replace tab characters with a selected number of spaces for consistent indentation and portable text layout. Processing takes place locally in your browser.

Start using

Tabs to Spaces Converter

Paste or type text, choose spaces per tab (default 4), and run the processing action. Every literal tab character is replaced with the same selected number of ASCII spaces, including tabs inside a line.

The effective size is a whole number from 1 to 16. Fractional values are truncated; blank, zero or nonnumeric values fall back to 4, and values outside the interval are clamped.

With size 4, A followed by one tab and B becomes A followed by four spaces and B. Two consecutive tabs become eight spaces. Existing spaces and newline characters are retained.

The replacement does not calculate tab stops or align columns according to the preceding text length. It does not parse source-code syntax and can also replace tabs inside quoted strings.

Processing stays in the browser and returns copyable text. The tool does not upload or overwrite source files, detect indentation style, convert literal backslash-t text or offer a downloadable archive.

Input is limited to 500,000 UTF-16 code units and expanded output to 1,000,000. One emoji may use two units. Run processing manually or press Ctrl+Enter. Both Clear buttons empty input and result while retaining the spaces-per-tab setting. Copy copies the result; there is no download button.

Processing takes place locally in your browser.