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

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.