HTML Formatter
Free online HTML formatter based on Prettier: re-indent tags, normalize attributes, format embedded script and style.
Privacy: all processing happens locally in your browser. Your input never leaves your device.
What is HTML Formatter?
HTML copied from the browser's "view source" is often minified and messy. Based on Prettier, this tool restores it to a neatly indented structure: consistent nesting levels, attribute wrapping and self-closing tags, with embedded <script> and <style> blocks formatted as well — a sharp tool for analyzing page structure and debugging templates.
How to Use
- Paste HTML source
- It formats automatically
- Copy the result
FAQ
- Are embedded JS/CSS formatted too?
- Yes. Prettier recognizes <script> and <style> blocks and formats them with JS and CSS rules respectively.
- Can Vue/JSX templates be formatted?
- HTML mode handles standard HTML; use the JS/TS formatter for JSX, and in-project Prettier for Vue SFCs.
Related Tools
JS / TS FormatterFree online JavaScript and TypeScript formatter powered by Prettier, with JSX/TSX support and reverse minify — local.CSS FormatterFree online CSS formatter based on Prettier: restore single-line stylesheets to readable indented CSS, or minify.SQL FormatterFree online SQL formatter for MySQL, PostgreSQL, SQL Server and SQLite: uppercase keywords and indented subqueries.XML FormatterFree online XML formatter with two-space indent, preserved attributes, comments and CDATA, plus line-numbered errors.
Last updated 2026-09-04