About this HTML Beautifier & Formatter
Paste minified, copy-pasted or generated markup into this HTML beautifier to get cleanly indented HTML. Inline <style> and <script> blocks are formatted too, using the same engine (Prettier) that many developers use in their editors.
The HTML minifier removes comments and extra whitespace between tags for smaller pages.
Features
- Indent HTML tags correctly
- Formats embedded CSS and JavaScript
- HTML minifier
- Handles full documents or snippets
- Powered by Prettier
How to use
- Paste HTML or open an .html file.
- Press Beautify.
- Press Minify for compressed HTML.
- Copy the output.
Frequently asked questions
How do I format HTML code online?
Paste the HTML above and press Beautify. Nested tags are indented and long attribute lists are wrapped.
Will beautifying HTML change how my page looks?
In almost all cases, no. The formatter only changes whitespace between tags, which browsers ignore in normal layout.
Can I beautify a single snippet instead of a full page?
Yes. Fragments like a single <div> or a table work fine.
More free formatters
- BeautifyAll-in-one beautifier
- JSON Beautifier & FormatterFormat & validate JSON
- XML Beautifier & FormatterPretty print XML
- CSS Beautifier & FormatterFormat CSS, SCSS & LESS
- JavaScript Beautifier & FormatterBeautify JS code
- TypeScript Formatter & BeautifierFormat TS code
- SQL Formatter & BeautifierFormat SQL queries
- YAML Formatter & ValidatorFix YAML indentation
- Markdown FormatterTidy Markdown docs
- GraphQL FormatterFormat GraphQL queries
- Text BeautifierClean up plain text