HTML Formatter & Beautifier

Paste HTML to pretty-print it with 2 spaces, 4 spaces or tabs, or minify it. Content inside pre, textarea, script and style is left intact, and the markup is never executed or rendered. Email templates, CMS exports and admin pages stay in this tab, so customer data is never uploaded.

Input
Output
Formatted in this tab16 lines307 BNever executed

Runs in this tab · nothing is uploaded · Verify in 10 seconds →

What the HTML Formatter & Beautifier does

An HTML formatter pretty-prints messy markup, or minifies it, without opening a live document. HTML beautifier, HTML pretty print and format HTML are the same operation: re-indent between tags. Use it on email templates, CMS exports and internal admin pages. The input is never assigned to innerHTML or loaded in an iframe, so scripts and images cannot run.

How the HTML Formatter & Beautifier works

Paste HTML, drop a .html file, or load the sample. Format rewrites with 2 spaces, 4 spaces or tabs. Minify removes whitespace between tags. Text inside pre, textarea, script and style is left as written (only the opening tag may be indented with its parent). Formatting is a tokenizer in this tab: it never builds a live DOM. Email templates and admin pages often contain customer names and addresses, so keeping the markup on this device is the point.

Limits

Does not execute or render markup. Inner text of pre, textarea, script and style is not rewritten. Files up to ~50 MB.

~/faq

Frequently asked questions

Does this upload my HTML?

No. Formatting runs in this tab, and there is no endpoint that receives the markup. You can verify it in DevTools → Network.

How do I format or beautify HTML?

Paste it, pick an indent and press Format (Ctrl/Cmd + Enter). HTML formatter, HTML beautifier and pretty-print HTML are the same operation.

How do I minify HTML?

Press Minify. Insignificant whitespace between tags is removed. Text inside elements, including pre and textarea, is not collapsed.

Does it change content inside pre, script or style?

No, beyond optionally indenting the first line with its parent. The inner text of pre, textarea, script and style is copied as written.

Does the tool execute or render my HTML?

No. The input is never assigned to innerHTML, never loaded in an iframe, and never attached to the page. Scripts do not run and images do not load.

Is it safe to paste email templates or admin pages?

The markup never leaves this device. That is the reason to format email templates, CMS exports and internal admin pages here instead of on a server that would see customer data.