HTML Formatter
Beautify or minify HTML. Embedded CSS and JavaScript are formatted too. More data tools
Format and minify HTML
Beautify turns one long line of HTML into neat, indented markup, including the CSS and JavaScript inside <style> and <script> tags. Minify removes comments and extra whitespace and shows how much smaller the file became.
Minify keeps the content of <pre>, <textarea> and scripts as they are. The aggressive option removes all space between tags, which can change spacing between inline elements.
Features
- Live: the result updates while you type.
- Clear errors: the line, the reason and, where possible, a one-click fix.
- Open and drop files, copy or download the result, and share your input as a link.
- Send to another tool: pass the result straight to a related tool.
- Private: Everything runs in your browser. Your data is not uploaded to any server.
Related data tools
- YAML Formatter: Tidy YAML and check it. Comments are kept.
- XML Formatter: Beautify, minify and validate XML. Errors show the exact line.
- SQL Formatter: Make long SQL queries readable, or minify them. Pick your database.
- CSS Formatter: Beautify CSS, SCSS or LESS, or minify CSS. Errors show the line.
- JavaScript Formatter: Beautify JavaScript, TypeScript or JSX, or minify it with Terser.
- CSV Viewer: Open a CSV as a table. Click a column to sort and use the box to filter rows.
- All DataMint tools
Frequently asked questions
Is minified HTML safe?
The default mode keeps spaces between inline elements, so the page looks the same. Test the aggressive option before you use it.
Does it fix broken HTML?
It formats what you give it. Use a validator for errors.
Is my data private?
Everything runs in your browser. Your data is not uploaded to any server. You can even use the tool offline once the page has loaded.