HTML Formatter
Pretty-print HTML locally in your browser with 2- or 4-space indent.
Embed this tool
Copy the iframe code below to add this tool to your site. The embed loads HTML Formatter without ads.
Embed code copied to clipboard.
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
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
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.