HTML Beautifier

Paste minified or unformatted HTML to reformat it with proper indentation and nesting. Formatting runs entirely in your browser, so your markup is never uploaded.

Loading…

About the HTML Beautifier

This tool takes minified or run-together HTML and reformats it into properly indented, nested markup using js-beautify. Each element is placed on its own line and child elements are indented under their parents, so the document structure - which tags contain which - becomes obvious at a glance. It is ideal for reading a minified page source or tidying markup copied from a CMS or email template.

How to use it

  • Paste the minified or unformatted HTML.
  • The beautifier reflows it with nested indentation automatically.
  • Follow the indentation to see the element hierarchy.
  • Copy the readable markup back into your file.

A common use case is making a one-line HTML fragment legible before editing it. Note that beautifying changes only whitespace between elements; in rare cases where whitespace is significant - inside <pre> blocks or around inline elements - the rendered spacing can shift slightly, so review those areas. All formatting runs in your browser, so your markup is never uploaded.

Frequently asked questions

Does formatting HTML change how the page looks?

Usually not, since it only adds whitespace between block elements. However, whitespace can be significant inside pre tags or between inline elements, so review those areas if exact spacing matters.

Does it close or fix broken tags?

No. The beautifier reformats the markup you give it; it does not repair invalid or unclosed tags. Use an HTML validator for structural correctness.

Can it format HTML that contains inline CSS and JavaScript?

Yes. Built on js-beautify, it also indents the contents of style and script blocks so embedded CSS and JavaScript stay readable too.

Is my HTML uploaded when I beautify it?

No. The formatting runs entirely in your browser, so your markup never leaves your device.

Related tools