HTML Viewer
Paste HTML and see a live preview at mobile, tablet or desktop width, with scripts off until you allow them.
24 lines, 730 characters, 730 bytes.
Your code stays in this browser. The preview runs in a sandboxed frame that cannot reach this site, and scripts stay off until you turn them on. If your HTML links to images, fonts, stylesheets or scripts on the web, your browser loads them from those sites, as it would for any web page.
Runs in your browser. Nothing is uploaded.
What is HTML Viewer?
An HTML viewer shows you how a piece of HTML will look in a browser without saving a file or starting a server. You paste or type the code, and the page it describes appears next to it. It is useful for checking a snippet from an email template, testing a bit of markup before putting it in a project, or seeing what a saved page looks like when you only have its source.
This HTML viewer renders your code in a sandboxed frame. The frame is cut off from this site, so the page you preview cannot read your other data or change anything here. Scripts are switched off until you tick "Run scripts in the preview", so a pasted page cannot start running code without your say-so. A snippet without a doctype is shown in standards mode, the way a modern page is, so a fragment such as a single heading looks the way you would expect.
You can switch the preview between mobile, tablet and desktop widths to see how a layout holds up on a narrow screen, copy the code, or download it as an .html file. The code stays in your browser. If your HTML links to images, fonts, stylesheets or scripts on other websites, your browser loads those files from those sites, exactly as it would for any web page.
How to use
- Paste or type your HTML into the code box, or click Load sample to start from an example.
- Watch the preview update as you type; a complete page or a small fragment both work.
- Pick Mobile, Tablet or Desktop to see the page at that width.
- Tick "Run scripts in the preview" only if the page needs JavaScript and you trust the code.
- Use Copy HTML or Download .html to take the code with you.
Example
Input
<h1 style="color: teal">Hello</h1><p>It works.</p>
Output
A teal heading "Hello" and the line "It works." in the preview pane.
Frequently asked questions
- Is my HTML uploaded anywhere?
- No. The code is shown in a frame inside your own browser and never sent to a server. It is kept in your browser storage only so it is there next time, and you can click Clear to remove it.
- Why does my JavaScript not run?
- Scripts are off by default. Tick "Run scripts in the preview" to turn them on. They run inside a sandbox with no access to this site, its storage or its cookies.
- Why are some images or fonts missing?
- The preview loads linked files from the web like any page would. A file may be missing if its address is wrong, if it needs you to be logged in, or if the other site refuses to serve it to a page that is not its own. Local file paths such as images/logo.png cannot work because the code is not stored in a folder.
- Can I preview a page that needs several files?
- This viewer takes one block of HTML. Put your CSS in a style tag and your JavaScript in a script tag, or link to files that are already on the web.
Related tools
- JSON Formatter & ValidatorFormat, minify and validate JSON online with line-accurate error messages.
- Text Diff CheckerCompare two texts online and see added and removed lines side by side.
- Color ConverterConvert colors between HEX, RGB, HSL, HWB, HSV, CMYK and OKLCH, with a WCAG contrast checker.
- URL Encode / DecodePercent-encode and decode text and URLs, and break a URL into its parts.