Developer tool

HTML Formatter

Beautify and indent messy HTML code.

Free Runs in your browser

About this tool

HTML Formatter re-indents HTML so nested tags are easy to follow. Use it on minified pages, email templates or code copied from the browser inspector.

How to use HTML Formatter

  1. Paste your HTML.
  2. Choose indent size and line wrap.
  3. Press “Beautify”, then copy or download.

Questions people ask

Will formatting change how my page looks?

Normally no. Browsers ignore most whitespace between tags. Content inside <pre> and <textarea> is left as it is.

Does it format inline CSS and JavaScript?

Yes. Code inside <style> and <script> tags is indented with the same settings.

Does it fix broken HTML?

It does not repair missing closing tags. Unclosed tags may lead to odd indentation, which can help you spot them.

More developer tools

See all 24 →
Esc