HTML Beautifier & Formatter Online

Re-indent messy or minified HTML, including the CSS and JavaScript inside it.

Input —
Drop file to load
0 lines · 0 chars
Output —
0 lines · 0 chars
Ready. Paste something and press Beautify.

About this HTML Beautifier & Formatter

Paste minified, copy-pasted or generated markup into this HTML beautifier to get cleanly indented HTML. Inline <style> and <script> blocks are formatted too, using the same engine (Prettier) that many developers use in their editors.

The HTML minifier removes comments and extra whitespace between tags for smaller pages.

Features

How to use

  1. Paste HTML or open an .html file.
  2. Press Beautify.
  3. Press Minify for compressed HTML.
  4. Copy the output.

Frequently asked questions

How do I format HTML code online?

Paste the HTML above and press Beautify. Nested tags are indented and long attribute lists are wrapped.

Will beautifying HTML change how my page looks?

In almost all cases, no. The formatter only changes whitespace between tags, which browsers ignore in normal layout.

Can I beautify a single snippet instead of a full page?

Yes. Fragments like a single <div> or a table work fine.

More free formatters