HTML Viewer & Previewer
Paste any HTML and see it rendered live in a sandboxed preview, or flip to the source view to read the raw markup — no scripts run, nothing is uploaded, and it all happens in your browser.
Updated
Rendered in a sandboxed iframe with scripts disabled — your HTML is never uploaded.
How to use HTML Viewer & Previewer
The HTML Viewer renders your markup live in a safe, sandboxed preview while keeping everything on your device. Paste a snippet or a full page source and instantly see how it looks, then flip to the source view to read the formatted, escaped markup. Scripts are disabled in the sandbox so even untrusted HTML is safe to inspect, and because rendering uses the iframe srcdoc attribute locally, your code is never uploaded.
- Paste your HTML markup into the input box — a fragment or full page both work.
- Click "Preview" to render it inside the sandboxed iframe.
- Toggle between "Rendered" and "Source" to compare output and markup.
- Edit and preview again as needed — nothing is uploaded.
Your data never leaves your device — 100% private processing.
How the safe preview works
Your markup is injected into an iframe using the srcdoc attribute with an empty sandbox value, which disables scripts, form submission, popups, and same-origin access. That means embedded JavaScript cannot run, read your cookies, or reach the parent page, so you can safely inspect HTML from any source. CSS still applies, so the rendered view faithfully reflects layout and styling while remaining isolated from the rest of the tool.
Rendered view versus source view
The rendered view shows the visual result a browser would paint. The source view escapes the same markup — converting <, >, &, and quotes into entities — so you can read the exact tags and attributes without them being interpreted. Switching between the two helps you connect a piece of markup to its on-screen effect, which is useful for debugging layout issues or learning how elements nest.
Worked examples
Render a heading and paragraph
Inputs: <h1>Hi</h1><p>Body text</p>
Result: Shows a large "Hi" heading above body text
Preview inline-styled markup
Inputs: <p style="color:teal">Teal</p>
Result: Renders the word "Teal" in teal colour
Inspect the source
Inputs: Toggle to Source view
Result: Markup shown as escaped, readable text
Glossary
- Sandboxed iframe
- An embedded frame with restricted capabilities; an empty sandbox disables scripts and isolates the content from the host page.
- srcdoc
- An iframe attribute that renders an inline HTML string instead of loading a URL, keeping content local.
- Rendered view
- The visual output a browser produces from HTML and CSS.
- Source view
- The raw markup shown as escaped text so tags are read, not interpreted.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use HTML Viewer & Previewer?
- See HTML rendered instantly without saving a file or spinning up a server
- Sandboxed iframe with scripts disabled — safe to preview untrusted markup
- Toggle between the rendered output and escaped, readable source
- CSS styling is applied so you see a faithful preview of your page
- Everything runs locally — your HTML never leaves the browser
Common use cases
- Quickly check how an email or landing-page snippet renders before shipping it
- Inspect scraped or exported HTML safely without running its scripts
- Teach or learn HTML by editing markup and watching the result update
- Verify CSS layout and styling on a fragment without a full project
- Preview AI-generated HTML before pasting it into your codebase
Related Developer Tools
HTML to Text Converter
Strip HTML tags and convert markup to clean plain text online. Paste HTML and get readable text with whitespace tidied — free, private, and in your browser.
HTML Encoder / Decoder
Encode and decode HTML entities online. Escape <, >, &, and quote characters for safe HTML display. Free, instant, and private — runs in your browser.
HTML ↔ Markdown
Convert HTML to clean Markdown and Markdown to HTML. Paste content and switch formats with a live preview. Free, private, in-browser.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Includes syntax highlighting, error detection, and a collapsible tree view — free, private, in-browser.
Regex Tester
Test and debug regular expressions online. See live matches, capture groups, and replace output. Free, private, instant.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to text. Fast, free, and runs entirely in your browser.
Explore all Developer Tools.