Skip to content
Code Formatters

HTML Formatter, Minifier & Beautifier

Format messy HTML with clean indents, or minify it to save size. Handles inline CSS and JavaScript too. Free HTML beautifier in your browser.

Something not working? Report a problem

What is the HTML Formatter, Minifier & Beautifier?

HTML copied from a page or a builder is often one long line. Paste it here and get tidy, indented code that is easy to read and edit.

Choose Minify to remove extra spaces and comments, which makes the file smaller. Code inside style and script tags is formatted as well.

How to use it

  1. Paste your HTML in the left box.
  2. The clean version shows on the right.
  3. Copy it or save it as a file.

Why people like this tool

Prettier powered

The same formatter many teams use.

Fast and private

Runs in your browser, nothing is sent.

Shows the error

Tells you where the code is broken.

Your style

Choose indent size and line width.

How it works, in one picture

Infographic: how to use the HTML Formatter, Minifier & Beautifier in 3 easy steps: Paste your code, Choose your options and Copy the result. You get: Prettier powered, Fast and private, Shows the error and Your style.

Frequently asked questions

How do I format HTML?
Paste it in the left box and keep Beautify selected. The right box shows clean, indented HTML.
Does minify change how my page looks?
No. It removes spaces between tags and comments only. Text inside pre and textarea tags is kept exactly.
Does it fix broken HTML?
It tidies what it can, but it does not repair missing tags. Check the result in a browser.

You may also like