HTML Beautifier

Indent HTML by tag nesting; keep script and style contents untouched

How to use

  1. Paste the HTML into the "HTML source" box.
  2. Click "Format"; the tool indents by tag nesting.
  3. The result appears in "Beautified result"; click "Copy" to take it.
  4. Tip: content inside script / style is kept intact, so JS / CSS logic is never broken.

FAQ

Will the content inside script / style be reformatted?

No. Once <script>, <style>, <pre>, or <textarea> is detected, the inner content is kept as-is to avoid breaking JS / CSS logic.

Why were some blank lines removed?

Consecutive pure-whitespace text nodes are collapsed, keeping only meaningful text content for a clearer structure.