HTML Formatter

Clean up HTML with proper nesting and indentation, shrink it for production, find unclosed or stray tags, and explore the document as an element tree. Text inside <pre> and <textarea> is never changed.

Ln 1, Col 10 B

Want to keep your input for later? Sign in

How to use it

  1. Paste HTML, open an .html file or click Sample.
  2. Click Beautify and pick the indentation, or Minify to remove comments and extra whitespace.
  3. Use Validate to find unclosed tags, or Tree viewer to inspect elements, ids and classes.

Frequently asked questions

Does beautifying change how my page looks?

Block elements move onto their own lines; inline elements like <a>, <b> and <span> stay inside their text line, and <pre>, <textarea>, <script> and <style> content is preserved.

Is pasted HTML or JavaScript executed?

No. The HTML is treated as text, and the tree viewer uses an inert parser that never runs scripts or loads images.

Is it free, and is my data uploaded?

It's free with no sign-up, and it runs entirely in your browser — your input is never sent to our servers.