or drop a file here, or paste code below

Paste HTML, open a file or load the sample to see the preview.

Files never leave your browserHow?

Paste HTML code or open an .html file and see it rendered right away. The preview runs in an isolated sandbox in your browser – nothing is uploaded.

How it works

  1. Add your HTML

    Paste code into the editor, drop an .html file onto it, use Open file, or try Load sample.

  2. See it rendered

    The page is rendered instantly in a sandboxed frame. Switch between Fit, Desktop (1280 px), Tablet (768 px) and Phone (375 px), and rotate the device.

  3. Edit, save or print

    Change the code and the preview updates as you type. Download the .html, open the preview in a new tab or print it to PDF.

Features

  • Live preview while you edit

    The source panel is a full code editor with syntax highlighting, code folding and search (Ctrl+F). The preview refreshes a moment after you stop typing.

  • Safe mode by default

    Scripts and event handlers are removed with DOMPurify before rendering. Turn Safe mode off to run JavaScript inside an isolated sandbox that cannot reach this site.

  • Responsive device widths

    Check how a page looks on desktop, tablet and phone. Media queries inside the preview see the real device width, and wide viewports are scaled to fit your screen.

  • Encoding detection

    Opened files are decoded using the byte order mark or the meta charset tag, with UTF-8 as the default. If characters look wrong, pick Windows-1252 or ISO-8859-1 manually.

  • External resource warning

    If the page loads images, fonts or stylesheets from other domains, the viewer lists those domains and lets you block them for a fully offline preview.

  • Works on any device

    It runs in any modern browser on Windows, macOS, Linux, Android, iPhone and iPad. There is nothing to install and no account to create.

Limits & privacy

The viewer accepts .html, .htm and .xhtml files and pasted code up to 10 MB. Syntax highlighting is used for documents up to 2 MB; larger documents are shown in a plain text area so the page stays responsive, and the preview is still rendered. Files larger than the limit are rejected before they are read.

The preview is shown in an <iframe> with sandbox="allow-scripts" but without allow-same-origin, so the rendered page runs in a unique, opaque origin. It cannot read this site, your cookies or local storage, navigate this page, open pop-ups or submit forms. A Content Security Policy inside the preview additionally blocks scripts in Safe mode and blocks network access to anything other than images, styles and fonts.

Relative links and images (for example images/logo.png) cannot be resolved, because only the single HTML file is opened – there is no folder access. Inline styles and <style> blocks work as usual. Printing uses your browser’s print dialog, so “Save as PDF” output depends on the browser.

Your files never leave your browser: nothing is uploaded, logged or stored. Read more on the privacy page.

FAQ

Is this HTML viewer online free?

Yes. The HTML viewer is free to use without registration or limits on the number of files. It runs entirely in your browser, so there is no server cost to pass on to you.

Are my HTML files uploaded anywhere?

No. Files are read and rendered locally in your browser tab and are never sent to a server. Only resources that your page itself references from other websites, such as CDN fonts or images, are requested by the browser – and you can block them.

How do I open an HTML file on iPhone or iPad?

Open this page in Safari or Chrome on your iPhone or iPad, tap Open file and choose the .html file from the Files app, iCloud Drive or another provider. The page is rendered right away, and the Phone and Tablet modes show the mobile layout.

Is there an HTML viewer for Android?

You do not need a separate app. On Android, open this page in Chrome or any other modern browser, tap Open file and pick the HTML file from your downloads or storage. The Code and Preview tabs make it easy to switch views on a small screen.

Do I need to download an HTML viewer app?

No download is needed. The viewer is a web page that works in the browser you already have. After the first visit it loads quickly because the browser caches its files.

Will JavaScript in my HTML file run?

Not in Safe mode, which removes scripts and inline event handlers. If you turn Safe mode off, scripts run inside a sandboxed frame with its own unique origin: they work for testing, but they cannot access this site, your cookies or storage. External script files that the page references over https (for example jQuery from a CDN) are loaded from those servers and run in the same sandbox.

Can I edit the HTML and see a live preview?

Yes. Edit the code in the source panel and the preview updates automatically. When you are done, use Download .html to save your changes or Copy code to copy them.

How is this different from opening an HTML file in Chrome?

Opening a file in Chrome works too, but this viewer adds a code panel next to the preview, device widths for responsive testing, a safe mode for untrusted files, and a warning about external resources. It also works on phones and tablets, where opening local HTML files is often difficult.

Related tools