DEVELOPER TOOL
HTML Formatter & Minifier
Beautify HTML with clean indentation, or minify it to a single line.
About this tool
Paste HTML to reformat it with clean, consistent indentation showing the nesting of every element — or minify it down to a single dense line. Content inside <script>, <style>, <pre>, and <textarea> tags is left untouched so it doesn't get mangled.
Formatting happens locally in your browser — nothing is uploaded.
Frequently asked questions
- Does this fix invalid or unclosed HTML?
- No — it indents the tags you give it based on open/close pairs, but it doesn't validate or auto-correct malformed markup. Mismatched tags can throw off the indentation of everything after them.
- Will it reformat JavaScript or CSS inside my HTML?
- No — the contents of <script> and <style> tags are copied through as-is; use the dedicated JS or CSS minifier tools if you want those reformatted separately.
- What does Minify do?
- It strips all indentation and line breaks between tags, producing the smallest readable single-line version — handy for embedding a snippet inline.