HTML Viewer & Formatter
Paste HTML to indent it cleanly, minify it, or see how it renders. The preview runs in a locked sandbox, so nothing in the code can reach this site or your data.
Format & preview HTML
Beautify or minify, then check the rendered result.
How to use it
- Paste HTML into the Input panel, open an .html file, or click Sample HTML.
- Click Format HTML to indent it, or Minify to remove extra whitespace (and optionally comments).
- Open the Rendered preview tab to see the page. Scripts stay off unless you turn them on.
- Read the hints under the editor: they point out tags that are never closed or closed in the wrong place.
Good to know
- How the preview is protected
- The preview is an iframe with a sandbox and a strict content security policy. It has no access to this website, your cookies or your other tabs. Scripts, forms, pop-ups and network requests are blocked by default; you can allow scripts or external images and styles for a quick check.
- What formatting keeps
- Tag and attribute text is kept as you wrote it. Content inside <pre>, <textarea>, <script> and <style> is never reflowed — scripts and styles are only re-indented as a block.
- Forgiving, like a browser
- HTML does not have to be strictly well-formed. Optional end tags such as </li> and </p> are understood, and real problems (for example a <div> that is never closed) are listed as hints instead of errors.
Frequently asked questions
Is it safe to preview HTML I found online?
The preview is sandboxed: it runs in a separate, isolated frame with scripts and network access blocked by default, so it cannot read anything from this site or your browser. Only turn on scripts for code you trust.
Will minifying break my page?
Minify only collapses runs of whitespace and removes spaces next to block-level tags, where browsers ignore them anyway. Whitespace inside <pre> and <textarea> is left alone. Comments are removed only if you choose so (conditional comments are kept).
Does it validate HTML?
It gives practical hints — unclosed or stray tags — but it is not a full W3C validator.
Why are external images missing in the preview?
External files are blocked by default so that previewing never contacts other servers. Tick "Load external images & styles" to allow them.