HTML Viewer — View HTML Online
Format common code, data, markup, and document languages locally in your browser.
Format common code, data, markup, and document languages locally in your browser.
Paste HTML into the input box and press Beautify. The viewer normalises the markup so its structure is visible: it puts a line break between adjacent tags, trims every line, drops blank lines, and then indents each line by two spaces for every level of tag nesting. Closing tags step the indent back out; opening tags that are not self-closing step it in. The result is the same document, re-laid-out as a readable tree.
This is a source formatter, not a browser. It never runs scripts, applies styles, or fetches external files. That makes it safe to inspect markup from an unknown source. The "Format as" menu switches the same page to XML, SVG, JSON, SQL, YAML, and a range of programming languages; picking one navigates to the matching formatter.
Reach for the viewer when you have minified HTML from a build step, a single-line email template, markup copied out of a CMS, or a server response you want to read. It is also useful for diffing: format two versions the same way and the real differences stand out instead of whitespace noise.
Input:
<ul><li>One</li><li>Two</li></ul>
Output after Beautify:
<ul>
<li>One</li>
<li>Two</li>
</ul>
The <ul> stays at column zero, its two <li> children are indented one level, and the closing </ul> returns to column zero.
Whitespace inside <pre>, <textarea>, and <script> blocks is significant and may be changed by re-indentation, so check those. Unbalanced tags can make the indent level drift for the rest of the document, though no content is lost.
No. This tool shows formatted source. To see the rendered result, use HTML Preview.
Yes. Choose XML or SVG in the "Format as" menu; both use the same tag-depth indenter as HTML.
No. It does not check for errors or missing tags. It only reformats. Use a dedicated validator if you need conformance checking.
No. All formatting is done in your browser and the markup never leaves the page.