Skip to main content

HTML Formatter

Pretty-print HTML locally in your browser with 2- or 4-space indent.

Tool workspace

Pretty-print HTML in your browser with consistent indentation. Contents of script, style, pre, textarea, and code are preserved. Markup is not executed or uploaded. Best-effort formatting — not a full HTML validator.

How it works

Paste HTML, choose an indent size (2 or 4 spaces), then Format.

Formatting runs entirely in your browser with a best-effort tag-depth prettifier. Contents of script, style, pre, textarea, and code blocks keep their inner whitespace. Markup is never executed, injected into the page, or uploaded.

Empty input clears the result—no error. This is not a full HTML validator or browser-equivalence checker.

Examples

  • <div><p>Hi</p></div> → indented nested tags
  • Void tags like <br> and <img> do not deepen indent
  • Indent size 4 → wider indentation

Privacy

Privacy: this tool processes HTML locally in your browser. We do not log or store what you paste. Login is not required.

FAQ

Is my HTML uploaded?

No. Formatting runs entirely in your browser. We do not log or store what you paste.

Does this validate or execute my HTML?

No. It best-effort pretty-prints source text. It does not inject markup, run scripts, or claim browser-equivalence.

Do I need an account?

No. All published tools work for guests without login.