Reviewing a dense fragment
Lay out nested elements to make structure and attributes easier to inspect.
Indentation is diagnostic evidence, not a standards-validity result.
Beautify HTML with two-space indentation or minify spacing, with byte statistics, copying, samples, and file download.
Content last reviewed
37 characters · 1 lines
Overview
Beautify through js-beautify with two-space indentation and a 100-character wrap target, or remove inter-tag and repeated whitespace with a compact text pass. Neither mode validates HTML, understands templates, or can know whether CSS makes whitespace significant.
One mode restores readable structure; the other applies a small whitespace-focused transformation.
Input and output sizes use Blob byte length, with a saving percentage in minify mode.
The page calls out inline spacing, preformatted text, and CSS-dependent rendering risks.
Copy or download formatted.html or minified.html after rendering checks.
How it works
Three steps, in the order the tool above actually takes them.
Use Beautify for review; use Minify only when the deployment path lacks a trusted parser-backed step.
Rendered HTML is safer input than syntax split across template directives.
A clean layout can reveal nesting, but a browser or validator must decide correctness and visual equivalence.
Use cases
The jobs this page is usually opened for, and the setting that makes each one quick.
Lay out nested elements to make structure and attributes easier to inspect.
Indentation is diagnostic evidence, not a standards-validity result.
Create a stable, readable copy of HTML emitted by a tool or component.
Do not replace the authoritative source when the markup was generated from a template or framework.
Remove common whitespace before a destination with a hard payload limit.
Render-test inline content, pre, textarea, and white-space CSS because text rules cannot see layout semantics.
HTML whitespace can be content
HTML parsing collapses much whitespace, but inline boundaries, preformatted elements, text nodes, and CSS white-space rules create exceptions that a regex-style pass cannot infer.
| Context | Unsafe assumption | Review needed |
|---|---|---|
| Inline elements | Whitespace between tags can always disappear. | It may be the visible space between adjacent words or controls. |
| pre / textarea | Repeated whitespace is only formatting noise. | Those elements preserve text layout and require a rendered comparison. |
| Templates | Template delimiters are ordinary HTML grammar. | Format rendered output or use a formatter that understands the template language. |
| Validation | Successful beautification proves tags and attributes are valid. | Use an HTML validator and browser tests for a correctness verdict. |
Whitespace between tags can always disappear.
It may be the visible space between adjacent words or controls.
Repeated whitespace is only formatting noise.
Those elements preserve text layout and require a rendered comparison.
Template delimiters are ordinary HTML grammar.
Format rendered output or use a formatter that understands the template language.
Successful beautification proves tags and attributes are valid.
Use an HTML validator and browser tests for a correctness verdict.
Privacy
HTML input and output remain in this tab. They are not uploaded or autosaved; only the divider position may persist for the session.
Encoding, parsing, formatting, generation, comparison, and cryptographic operations run in browser code. Form values and uploaded text files are not sent to a processing API.
Code, tokens, secrets, URLs, and generated outputs stay in component memory until the page reloads or closes. Split-pane tools remember only the divider percentage for the current tab session.
The page reads the clipboard only after a Paste action and writes it only after Copy. A local download is created only when you choose the tool's download control.
The page shell can send the tool slug, never the editor contents or filename. The endpoint is rate-limited using a transient requesting address and is skipped for Do Not Track or Global Privacy Control.
More detail in how processing works and our privacy policy.
Limits
The values this tool actually enforces, not a rounded-up version.
This is a formatter, not a validator — it will not tell you a document is invalid, only lay out what it finds. Template languages are not understood. Minification is conservative but cannot be perfectly safe, because whether whitespace is rendered depends on CSS the formatter cannot see.
FAQ
The ones that actually come up.
Guides