HTML Formatter

  • Free forever
  • No sign-up
  • Runs in your browser
Processed on your device

Tidy messy or minified HTML into neatly indented code that is easy to read and edit.

About HTML Formatter

Makes minified or messy HTML readable again by putting block elements on their own lines and indenting nested tags. Inline scripts and styles are formatted too, so a whole page copied from a browser's source view becomes easy to scan. You choose the indent, whether long lines wrap, and whether the head and body contents are indented. Blank lines you left are kept, up to two in a row.

How to use HTML Formatter

  1. Paste your messy or minified HTML into the box.
  2. Choose the Indent and Wrap long lines options, and whether to indent the contents of head and body.
  3. Click Format HTML; the tidied code replaces your original in the same box.
  4. Click Copy to use it, or Clear to start again with new code.

How your data is handled

The HTML is formatted in your browser with the js-beautify library, loaded from our own site the first time. Your code isn't uploaded or stored.

How SAA Tool works · Privacy Center

Limits and accuracy

  • Content inside pre and textarea tags is left exactly as it was.
  • Template code such as PHP or Handlebars isn't formatted and may stay on the same line as nearby tags.
  • Inline elements stay on their line, so paragraphs full of links and bold text can remain wide unless you wrap.

Questions and answers

Does it fix broken HTML?

No. It only changes indentation and line breaks, so the page works exactly as before. Missing closing tags and other errors stay as they are, but the neat layout makes them easier to spot.

Are inline scripts and styles formatted too?

Yes. JavaScript inside script tags and CSS inside style tags are indented as well, so a whole minified page becomes readable in one go.

Is my code uploaded?

No. Formatting happens in your browser, so your HTML isn't sent to SAA Tool or saved anywhere.

Do I need to sign up?

No. HTML Formatter and Beautifier is free with no sign-up, no login and no daily limit, and there's nothing to install. It works on a phone as well as a PC.

Does it change my HTML?

Only the indentation and line breaks; tags, attributes and text are left as they are. It uses the same beautifier as many editors.

Report a problem with this tool