Skip to content
SnapTools

HTML Formatter

Runs in your browser

Format and indent HTML with Prettier — turns minified or inconsistently indented markup into clean, readable source.

About this tool

Minified HTML from a build output, or markup pasted from a browser's 'view source', reads as one dense wall of tags with no visual hierarchy. This tool runs the same Prettier engine used by most editor extensions, indenting nested elements and wrapping attributes consistently so the structure is obvious at a glance.

How to use

  1. Paste your HTML.
  2. Run the formatter.
  3. Copy the indented result.

When to use this tool

  • Making minified HTML readable for debugging.
  • Cleaning up markup pasted from a browser's view-source.
  • Standardising indentation before a code review.

Tips

  • This formats structure and indentation, not content — it won't fix invalid or unclosed tags on its own.
  • Embedded <script> and <style> blocks are formatted too where Prettier can parse them.

FAQ

Does this validate my HTML?
No. It formats syntactically valid HTML; it doesn't check for accessibility or semantic issues.
Is my markup sent anywhere?
No. Formatting runs entirely in your browser using Prettier.