Skip to content
MixTool

HTML formatter

Make minified or messy HTML readable again, with sensible indentation and formatted inline CSS and JavaScript.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Readable markup from any source

HTML copied from a CMS, an email builder or a production page is often one giant line. The formatter rebuilds it with consistent indentation, one element per line where it helps, and properly formatted <style> and <script> blocks, so you can find the section you need to edit.

Content that depends on whitespace, like <pre> and <textarea>, is left exactly as it was. You can choose the indent size, whether to wrap long lines and how many blank lines to keep, then copy the result or download it as an .html file.

How to beautify HTML

  1. 1

    Paste the HTML

    A full page or just a fragment.

  2. 2

    Adjust the options

    Indent size and line wrapping.

  3. 3

    Copy the formatted code

    Or download it as a file.

Key features

  • Formats embedded code

    Inline CSS and JavaScript are indented too.

  • Whitespace-safe

    Leaves <pre> and <textarea> content untouched.

  • Configurable

    Indent size, wrapping and blank lines.

  • Local processing

    Nothing is uploaded.

Common uses

  • Editing exported templates: Tidy HTML from page builders and email tools.
  • Reviewing third-party code: Read minified markup from a live site.
  • Teaching and documentation: Show clean examples to students or teammates.

Tips and good to know

Frequently asked questions

Will formatting change how the page looks?

Normally no, because browsers collapse whitespace between tags. Content inside <pre> and <textarea> is preserved exactly in case whitespace matters there.

Does it fix broken HTML?

It indents what you paste but doesn't rewrite invalid markup. Unclosed tags will still be unclosed.

Can I format a whole page?

Yes. Paste everything from <!DOCTYPE html> to </html>, including head, styles and scripts.