Skip to content
Devtoolry

HTML Formatter

Beautify messy or minified HTML into clean, indented markup using Prettier, right in your browser.

About the HTML Formatter

Minified or hand-edited HTML is hard to read and review. The HTML Formatter re-indents markup with Prettier so nesting is obvious, without changing what the page renders.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the HTML Formatter

  1. Paste HTML or open an .html file.
  2. Choose the indentation and the line width at which long lines wrap.
  3. Copy or download the formatted markup.

Frequently asked questions

Will formatting change how my page looks?

Formatting only changes whitespace between tags. In rare cases whitespace inside inline elements matters; Prettier keeps it where it affects rendering.

Can it format embedded CSS and JavaScript?

Yes. Code inside <style> and <script> tags is formatted along with the markup.