HTML Formatter & Beautifier

Format and beautify HTML, CSS, or JavaScript code with proper indentation. Powered by js-beautify — the industry-standard code formatter. Works entirely in your browser.

HTML Formatter — Format Minified HTML

Minified HTML is compressed into a single line for smaller file sizes, making it unreadable for developers. The HTML formatter re-indents the markup with proper nesting, line breaks between tags, and consistent attribute formatting. This makes it easy to read, edit, and debug HTML code. Powered by js-beautify v1.15 — the same library used by VS Code, Atom, and CodeMirror.

JS Formatter — Beautify JavaScript

Switch to the JavaScript tab to format minified or obfuscated JavaScript. The JS formatter adds proper indentation, line breaks after statements, and readable spacing around operators. Note: heavily obfuscated JavaScript (with mangled variable names) cannot be fully restored — the formatter improves readability of the structure but cannot recover original variable names.

CSS Formatter — Beautify CSS

The CSS formatter expands minified CSS with each rule on its own line, properties indented inside selectors, and consistent spacing. It handles vendor prefixes, media queries, custom properties, and keyframes correctly. After beautifying, you can use the CSS Minifier to compress it again for production.

Paste the minified HTML in the input above (HTML tab selected) and the formatter re-indents and structures it instantly. Click Copy to copy the formatted output.
js-beautify — the most widely used JavaScript beautifier, also supporting HTML and CSS. It is the library behind the Beautify extensions in VS Code, Atom, and Sublime Text.
Click "Minify ↔" to compress the output. For CSS, also see the dedicated CSS Minifier tool. For JS, see the JS Minifier tool.