WerklyTools
EN
Buy me a coffee

HTML formatter and minifier

Paste messy or single-line HTML and get clean, indented code that is easy to read and review. You can also do the opposite and minify it to make it smaller. Everything happens in your browser and your code is never sent anywhere.

Processed 100% in your browser

Result

Ctrl + Enter runCtrl + C copy result

How to use

  1. 1Paste your HTML code into the input box.
  2. 2Choose the indentation and whether to keep comments.
  3. 3Click “Format” to beautify it or “Minify” to compress it.
  4. 4Copy the result or download it as a file.

Use cases

  • Read the minified HTML of a page you want to understand.
  • Clean up code generated by a visual editor or CMS.
  • Shrink an email template before sending it.
  • Standardise indentation across a team’s code.

Frequently asked questions

Does minifying HTML change how the page looks?

It should not. Only comments and extra whitespace are removed, and pre, textarea, script and style are left untouched, since spacing matters there.

Is my code uploaded to a server?

No. Formatting happens entirely in your browser, so you can use it with private code.

Does it fix errors in my HTML?

It is not a validator: it formats the code as it is. If a tag is not closed, the result will show that same problem.

How is this different from the XML formatter?

HTML tolerates tags without a closing tag, like br or img, while XML requires every tag to be closed. For strict XML documents, use the XML formatter.

Related tools