Skip to content
Created by Iternal Technologies, the AI Strategy ExpertsBy Iternal (opens in a new tab)

Format & Minify

HTML Beautify

HTML

Paste HTML to indent elements by two spaces while leaving void tags and pre text unchanged.

Formatted HTML

About HTML Beautify

HTML Beautify puts each nested element on its own line and indents it two spaces. Tag names, attributes, comments and character references are copied as they appear. A void element such as br or img is not given an end tag.

Text inside script, style, pre and textarea is kept byte for byte, including spaces and line breaks. Elsewhere, a run of spaces and line breaks that contains no other characters and sits between tags is layout whitespace: beautify replaces it with the indent.

A truncated tag, an unclosed quote, a mismatched end tag or an element left open is reported at that spot. The tool does not invent tags or rewrite broken markup. A doctype is kept; an internal DTD subset is rejected.

Frequently asked questions

What does HTML beautify change?

It inserts line breaks and a two-space indent between elements when the only text between those tags is whitespace. Tags, attributes, comments and significant text stay as written.

Which elements keep their inner whitespace?

script, style, pre and textarea. Everything up to the first matching end tag is copied unchanged, including spaces and line breaks. An end tag inside a string still ends the element.

Does a void element get an end tag?

area, base, br, col, embed, hr, img, input, link, meta, param, source, track and wbr do not need one, and none is added. A self-closing slash is kept and that tag is treated as empty. An end tag already present for a void element is a mismatched end tag.

What happens when the markup is broken?

The output is replaced by a problem that names a truncated tag, an unclosed quote, a mismatched end tag, an unclosed element or an unsupported DTD subset. The jump control selects that span and nothing is repaired.

Is the text I paste uploaded anywhere?

No. Beautifying runs in your browser and the text you paste is never uploaded, logged or stored. Google Analytics records page views and feature use, never content.

Iternal · AI Blueprint Builder

Plan the AI initiative, not just the output

The AI Blueprint Builder scores each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget. Free to start, about 60 minutes.

Open the AI Blueprint Builder (opens in a new tab)