HTML Formatter

The interactive tool loads here. JavaScript is required to use its controls; the instructions below are available without it.

Format HTML markup for inspection or reduce simple whitespace with minification. The tool operates on markup text and does not test the behavior of a complete site.

How to use this tool

  1. Paste HTML and choose formatting or minification.
  2. Read the resulting markup in the editor.
  3. Test the result before replacing a source file.

How to interpret the result

Formatting parses HTML with the browser and can repair invalid markup or add document elements. Minification removes comments and collapses whitespace, which can change preformatted text, scripts or styles. Keep the source and avoid using the result as a guaranteed lossless build transform.

Frequently asked questions

Does formatted HTML mean valid, accessible HTML?

No. Readability does not prove standards compliance, accessibility, security or correct page behavior.