input.html
output.html
Paste HTML to pretty-print it with consistent indentation.

Turn dense markup into something you can review

Paste a complete HTML document or fragment, pick two or four spaces for indentation, and choose Format. The formatter sorts the tags by their nesting level, making it easier to check closing tags, sibling elements and deeply nested containers. It works in your browser, not thru an upload-and-convert API.

HTML void elements such as <br>, <img>, and <input> do not increase the nesting depth. Raw-text blocks including <script>, <style>, <pre>, and <textarea> are kept together instead of being reformatted line by line.

Formatting is a review aid, not an HTML parser

This is a lightweight tolerant formatter. It does not construct the same corrected document tree as a browser’s HTML parser, nor does it validate against the HTML specification. Readable indentations can help you find a missing closing tag or invalid nesting, but a successful format doesn’t mean the markup is valid.

Whitespace can be significant in HTML as well. The formatter trims and rewraps text between tags, so when you are working in inline elements, preformatted email layouts, template delimiters, or content where exact spaces matter, compare the output carefully. Before replacing the production markup, copy the original.

A practical workflow

  1. Format a copy of the markup.
  2. Review the changed whitespace around inline text and templating expressions.
  3. Open the result in the HTML Viewer for a non-scripted visual check.
  4. Test the final file in the browsers or email clients that matter to your project.

For XML, where self-closing tags and case sensitivity follow different rules, use the XML Formatter. If the job is data conversion rather than markup layout, use JSON to XML.

FAQ

Does the formatter execute scripts?

Nope. This page accepts text input and returns formatted text. If you want a rendered preview use the separate viewer.

Does formatting prove that my HTML is valid?

No. It reorganizes markup for readability but does not perform standards validation or repair malformed document structure.

Is the HTML sent to a conversion server?

No. The formatting code runs in the browser. Remove secrets and private data anyway before using any web-based editor.