Skip to content
M2TOOLKIT

HTML Formatter & Beautifier

Clean up messy HTML with proper indentation, or minify it.

  • Free
  • No sign-up
  • Runs in your browser
Output

Your code is formatted in the browser and never executed.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the HTML Formatter

  1. Paste your HTML into the left box, or open a file.
  2. Adjust the options if you need to.
  3. Copy the formatted HTML or download it as a file.

What does this tool do?

Formatting uses the open-source js-beautify engine, loaded only on this page. Inline CSS and JavaScript inside the HTML are formatted too. Your code is only re-printed, never run.

Why use it?

  • Read minified page source.
  • Tidy templates and emails.
  • Quick minification for small snippets.

Tip

For production sites, let your build tool minify HTML automatically. This tool is best for one-off snippets and debugging.

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the html formatter.