Re-indent any code instantly — convert between 2-space, 4-space, and tab styles, fix mixed indentation, and preview whitespace markers before copying.

Convert tabs → Tab Converter

Format HTML → HTML Beautifier

From:
Paste code to detect
To:
Indent shift:

INPUT
OUTPUT
Copied!
Lines: 0 Input chars: 0 Output chars: 0 Tab-indented lines: 0 Space-indented lines: 0 Mixed lines: 0

How it works:

  • Auto-detect: Scans leading whitespace across all lines to determine whether the file uses 2-space, 4-space, or tab indentation, and flags mixed files.
  • Re-indent: Measures each line’s indent level in the source style, then rebuilds it in the target style — preserving relative nesting depth exactly.
  • Indent shift: Increases or decreases every line’s nesting level by one step without changing style.
  • Mixed indentation cleanup: Normalises lines that combine tabs and spaces before re-indenting, so no stray characters remain.
  • Whitespace markers: Spaces show as · (purple), tabs show as (amber) so you can verify the result at a glance.