HTML Beautifier
Indent HTML by tag nesting; keep script and style contents untouched
How to use
- Paste the HTML into the "HTML source" box.
- Click "Format"; the tool indents by tag nesting.
- The result appears in "Beautified result"; click "Copy" to take it.
- 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.