Free HTML Formatter — Pretty Print HTML Online
Paste messy, minified, or single-line HTML and get neatly indented, readable markup instantly. Void elements, comments, and doctypes are handled correctly, while the contents of pre, script, and style tags are left byte-for-byte untouched. Everything runs in your browser — free, private, no sign-up.
HTML Formatter
Paste messy or minified HTML and get neatly indented, readable markup — instantly.
100% Free Forever
No Sign-up
No Credit Card
Private — files never leave your browser
Unlimited Use
1 Paste your HTML
Formatting happens live as you type.
2 Format settings
Spaces per indent level.
Collapse empty lines in the output.
Keep text-only elements under ~60 chars on one line.
3 Get your formatted HTML
✨ Formatted result
0 tags formatted
How it works
- Paste raw HTML into the input box — pretty-printing runs live in your browser.
- The parser tokenizes tags, comments, doctypes, and text; void elements (
br,img,input, …) self-close without adding depth. - Content inside
pre,script, andstyleis emitted raw — never re-indented, never altered. - Pick an indent size, drop blank lines, and keep short text-only elements on one line with Inline short elements.
- Copy the clean HTML with one click.
Everyday uses
- Tidy embed codes: clean up pasted widgets, video embeds, and email templates.
- Debug nesting: mis-nested or unclosed divs become obvious once everything is indented.
- Clean CMS output: fix up WYSIWYG or page-builder markup before saving.
- Prepare tutorials: present readable HTML examples in blog posts and docs.
- Review diffs: formatted markup makes code reviews and comparisons far easier.