Back to all tools

HTML Formatter

Format HTML and see the page live as you type

Waiting for HTML
Preview

Press ✎ Edit in preview to type directly in the page; the HTML on the left updates as you go (press Format afterwards to tidy it). The preview runs your page in a sealed-off frame: its scripts work, but they cannot reach this site, your other tabs or your data. Links open in a new tab. Escaped tags such as <p> can be turned back into real HTML with Decode. Plain text is shown with its line breaks and clickable links; press Format to turn it into HTML. Files on your own computer (like local images) cannot load here.

How HTML Formatter works

Paste

Paste HTML, open a .html file, or try the sample.

Preview

See the page live as you type, at desktop, tablet or phone width.

Tidy

Format or minify it, then copy or download.

Frequently Asked Questions

Is my HTML uploaded to a server?

No. Formatting and the preview both happen in your browser. Your code never leaves your device.

Does it format CSS and JavaScript too?

Yes. Code inside style and script tags is indented along with the HTML.

Is it safe to preview HTML with scripts?

The preview runs in a sealed-off frame, so scripts in your page can run but cannot reach this site, your other tabs or your data.

What does Minify do?

It removes comments and extra spaces between tags to make the file smaller, while leaving the content of pre, textarea, script and style blocks untouched.