HTML formatter

Make HTML readable: consistent indentation, one element per line and tidy attributes.

HTML formatter: illustration of a code editor with brackets, a colour swatch and a settings gear
HTML formatter is part of our free Developer tools collection. It works in your browser on phones, tablets and computers, with no sign-up.

How to use the HTML formatter

  1. Paste your HTML or choose a file.
  2. Pick the indent size.
  3. Press Format and copy or download the result.

When it's useful

  • Reading minified HTML from a website
  • Cleaning up HTML copied from an editor
  • Making templates consistent

Limits to know

  • Invalid HTML is reported with the line and column of the problem.
  • The formatter (Prettier) loads the first time you press Format.

Your privacy

Everything is worked out in your browser. What you type isn't uploaded, saved or shared, and there's no sign-up.

What goes in and what comes out

Input:
HTML pasted or as a file, up to 5 MB.
Output:
Formatted HTML, copyable or as a download.

Questions

Is my code sent anywhere?

No. Prettier runs in your browser.

Related tools