HTML Viewer
Preview HTML live in a secure sandbox with mobile and tablet widths. Scripts and network access are off by default.
Beautify, minify, and check HTML online. Free, instant, and 100% in your browser.
An HTML formatter, or HTML beautifier, rewrites markup with consistent indentation so the structure of a page is easy to read. It is useful for minified HTML, generated templates, email markup, and code copied from browser developer tools.
Unlike a simple re-indenter, this formatter reads HTML the way browsers do. It only changes whitespace where browsers ignore it, and it reports markup problems that browsers would silently repair.
Whitespace inside text and inline elements is kept, so the page looks exactly the same after formatting.
Unclosed tags, stray closing tags, misnested elements, duplicate attributes, and <div/> are reported with line and column.
Optional end tags (</li>, </p>, </td>), void elements, and raw text in <script> and <style> are handled the way browsers do.
The contents of <pre>, <textarea>, <script>, and <style> are kept exactly as written.
Indent with 2, 3, or 4 spaces or tabs, or minify by removing whitespace that browsers ignore.
Everything runs locally in your browser. Your HTML is never uploaded.
<ul><li>Home<li>About <b>us</b></ul><div class="card"/><p>Hi, <span>friend!</div><ul>
<li>Home</li>
<li>About <b>us</b></li>
</ul>
<div class="card">
<p>Hi, <span>friend!</span></p>
</div>
The omitted </li> and </p> tags are added, and the structure matches what browsers build. The formatter also reports the mistakes that browsers silently repair:
No. Line breaks and indentation are only added where browsers ignore whitespace, such as between block elements. Text and inline elements like <a>, <b>, and <span> keep their spacing, and <pre>, <textarea>, <script>, and <style> are left exactly as they are.
HTML allows these end tags to be omitted, and browsers add them automatically. The formatter writes them out so the structure is explicit. The page renders the same.
Browsers never refuse to show HTML. Instead they silently repair mistakes, which can produce a different structure than you intended. Each issue shows a repair the browser makes, such as closing an unclosed <div>, so you can fix the markup yourself.
In HTML, only void elements like <br> and <img> can be self-closing. Browsers ignore the slash in <div/> and treat it as an opening tag, so everything after it ends up inside the div. Write <div></div> instead.
It checks the document structure: tags, nesting, and attributes. It does not check every rule of the HTML specification, such as which attributes are allowed on each element.
No. Parsing and formatting run entirely in your browser. Your HTML never leaves your device.
Preview HTML live in a secure sandbox with mobile and tablet widths. Scripts and network access are off by default.
Beautify, minify, and validate JSON instantly with exact line and column error reporting.
Compare two JSON documents side by side and see every added, removed, and changed value.
Convert JSON to well-formed XML with custom root and item names, attributes, and indentation.