# HTML Viewer

URL: https://discuvr.org/html-viewer/
Last updated: 2026-11-08
MCP tool: `inspect_html`

Paste HTML and preview it live, sandboxed, at phone, tablet or desktop width. Beautify, minify, run scripts with a console, and see real markup problems.

An email template, a snippet from a ticket, an exported report - sometimes you just need to see what a piece of HTML looks like. Paste it and it renders as you type, inside a locked-down frame, at the screen width you pick. Alongside the preview you can tidy it, shrink it, run its scripts with a console, and see a list of what is actually wrong with the markup.

## What it does

- Live preview as you type; above 200,000 characters it pauses until you press Refresh.
- Phone, tablet, desktop and full-width preview sizes, plus full screen.
- Scripts are off by default; switch them on and see console output and errors.
- Beautify messy markup or minify it, without touching the contents of pre, script or style.
- An inspection report: element counts, the heading outline and concrete problems.
- Open a local .html file, copy the result or download it.

## How it works

1. Paste HTML, open a .html file or load the sample.
2. Pick a preview width and decide whether scripts may run.
3. Beautify, minify or inspect it, then copy or download the result.

## Why the preview is sandboxed

Pasted HTML can contain scripts, forms and links you did not write. The preview runs in an iframe sandbox with its own opaque origin, so nothing in it can read this site's cookies or your session, submit anywhere on your behalf, or navigate this page away. Scripts stay off until you turn them on.

## What the inspection checks

It reads the markup with a standard HTML parser and reports only what it saw: tags opened and never closed, closing tags with no opening tag, images without alt text, duplicate ids, links that open a new tab without rel="noopener", heading levels that skip, resources loaded over http://, and for a full page a missing doctype, title, lang or viewport tag.

## What the inspection leaves alone, on purpose

It reports mistakes, not style. End tags the HTML standard lets you leave out, such as </p>, </li>, </td>, </tr> and </option>, are never listed as unclosed, and void elements such as <br>, <img> and <input> need no closing tag. An empty alt="" counts as alt text, which is correct for a decorative image. A target="_blank" link passes with rel="noopener" or rel="noreferrer". A plain http:// link in <a href> is not counted as insecure; only loaded resources such as images, scripts, stylesheets and iframes are. Moving back up the heading levels (h4 to h2) is fine; only a jump down that skips a level (h2 to h4) is reported. The doctype, title, lang and viewport checks run only when the paste is a whole page, meaning it has a doctype or an html, head or body tag, so an email block or CMS snippet is not marked down for them.

## Checking an HTML email before it goes out

Preview it at Phone width (375 px) first, since many people open email on a phone, then at Tablet (768 px) and Desktop (1280 px). Leave scripts off: email apps do not run JavaScript, so the scripts-off preview is closer to what the reader sees. Use absolute https:// image URLs, because neither the preview nor the recipient's mail app can see files on your computer. Minify drops ordinary comments but keeps conditional comments that open with <!--[if, such as <!--[if mso]> ... <![endif]-->. It does not keep the <!--<![endif]--> closer of the <!--[if !mso]><!--> pattern, so do not minify a template that uses it, or Outlook may hide everything after that point. The preview is a browser rendering; classic Outlook for Windows draws email with Word's engine, so send yourself a test there before a large mailing.

## Questions

**Is my HTML uploaded or stored?**

The preview, beautify and minify all happen in your browser. Only the inspection report sends the markup to the server, where it is parsed and answered in the same response - nothing is written to disk or logged, and usage records hold only counts.

**Why do my scripts not run?**

Scripts are off by default because pasted code is untrusted. Tick "Run scripts" and the preview reloads with JavaScript enabled, still inside the sandbox, and console output appears below the preview.

**Why do relative images or stylesheets not load?**

The preview is built from the pasted text, not from your computer or your server, so a relative path like images/logo.png is looked up on this site and is not found. Use absolute URLs, or add a <base href="..."> tag that points at where the files really live.

**Does beautify change how the page looks?**

It only re-indents between tags and leaves pre, textarea, script and style contents alone. Whitespace between inline elements can occasionally shift slightly, so check the preview after formatting.

**How large a document can it handle?**

The inspection report accepts up to 1,000,000 characters and lists at most 200 problems. Live preview pauses above 200,000 characters so typing stays responsive; press Refresh or Ctrl+Enter to update it.

**Can I preview an HTML email template?**

Yes. Paste the email's HTML or open the .html file, switch the width to Phone (375 px) and Desktop (1280 px) to see both layouts, and press Inspect to find images without alt text and resources loaded over plain http://. The preview uses your browser's engine, while each email client uses its own and many drop part of the CSS, so it shows roughly what a browser-based webmail shows, not exactly what every inbox shows. Email clients do not run JavaScript, so leave Run scripts off. Before a real send, mail a test to the clients your readers use.

**Is it safe to open an HTML file someone sent me?**

Safer than opening it directly. Open file reads it into the editor in your browser, and nothing goes to the server unless you press Inspect. The preview is a sandboxed frame with scripts and form submission off, so the page cannot run code, send a form or reach this site's cookies. Images and stylesheets with a full http(s) address still load, so the sender can tell the file was opened. Read the source first, leave Run scripts off, and never type a password into a page you were sent.

**Why do accented letters turn into � after I open a file?**

Open file always reads the file as UTF-8 and ignores any <meta charset> tag inside it. A page saved as Windows-1252 or ISO-8859-1, common with older Windows editors and exports, stores letters such as é, ü and £ as bytes that are not valid UTF-8, so each one shows as the replacement character �. Open the file in your editor, save it again as UTF-8 (Notepad: Save as, Encoding UTF-8; VS Code: click the encoding in the status bar, then Save with Encoding) and open it here again. Or open the file in your web browser, view its source and paste it here, since the browser has already decoded it with the page's own charset.

**Why does a form or a link that opens a new tab do nothing in the preview?**

The sandbox never allows form submission or pop-ups, even with Run scripts on, so pressing Submit sends nothing and links with target="_blank" or window.open() calls are blocked. This stops a pasted page from posting data or opening other sites. Ordinary links open inside the preview frame, and sites that refuse to be framed show an empty or refused page there. To check a form, read its action, method and fields in the source; Inspect also lists every target="_blank" link without rel="noopener". Test the real submission on your own development server.

## More in Developer Tools

- [IP Subnet Calculator](https://discuvr.org/ip-subnet-calculator/)
- [Encode / Decode](https://discuvr.org/encode-decode/)
- [Unix Timestamp Converter](https://discuvr.org/timestamp-converter/)
- [System Diagram Maker](https://discuvr.org/system-diagram/)

## Often used with

- [Text Compare](https://discuvr.org/text-diff/)
- [Website Security Scan](https://discuvr.org/security-scan/)

---

Part of Discuvr (https://discuvr.org/): Discuvr is a collection of free, focused tools for day-to-day professional work - office and data utilities, legal and compliance helpers, privacy and security checks, and developer formatters. Every tool has its own page, and most can also be called from ChatGPT or Claude over MCP.
