Skip to content
Devtoolry

HTML Viewer

Free online HTML viewer: paste HTML code and see it rendered live in a secure sandboxed preview. Check snippets, emails and templates with scripts off.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the HTML Viewer

This free online HTML viewer renders HTML code live as you type: paste a snippet or open an HTML file from your computer and the page is displayed as a browser would show it. The preview runs inside a sandboxed frame that cannot reach the rest of the site, so you can check snippets, emails or templates safely, and the file is read in your browser, never uploaded. For Razor (.cshtml), PHP or other server templates, paste the HTML the server renders. Whether you call it an HTML previewer, an HTML reader or an HTML code viewer, it does the same job: a browser-based tool to render HTML online.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the HTML Viewer

  1. Paste or type HTML in the editor, click "Open file" or drop an .html file on the editor.
  2. Watch the preview update as you type.
  3. Switch on "Run scripts" only if your snippet needs JavaScript.

Common mistakes

  • Relative links and images. The preview has no base URL, so src="images/logo.png" cannot load. Use absolute https:// URLs for images and stylesheets.
  • Expecting forms and scripts to work. Scripts are off by default, and forms cannot be submitted from the sandbox. Switch on "Run scripts" for inline JavaScript.
  • Styles from your site. The preview is isolated from this page, so it only uses styles in your snippet. Add a <style> block or a <link> to a public stylesheet.

Works well with the HTML Viewer

Frequently asked questions

Can I view an HTML file online?

Yes. Click "Open file" and choose an .html or .htm file (up to 5 MB). It is read in your browser and never uploaded. Images, stylesheets and scripts linked with relative paths do not load, because only the one file is opened: inline them, or link images and stylesheets with absolute https URLs.

Is it safe to preview untrusted HTML?

Yes. The preview runs in a sandboxed iframe with no access to this page, and scripts stay disabled unless you switch them on.

How is this different from the preview panel in my code editor?

Code editors such as VS Code need an extension or a local server to preview HTML. This viewer works in any browser with nothing to install, which helps on a borrowed machine, a phone or when someone sends you a snippet to check.

Why does an external script not load?

The site's security policy blocks scripts from other domains. Inline scripts run when "Run scripts" is on.

Can I preview an HTML email?

Yes. Paste the email HTML to check the layout. Email clients support less CSS than browsers, so test in real clients before sending.

Is my HTML uploaded?

No. The preview is rendered in your browser and nothing is sent to a server.

How do I view an .html file online?

Choose "Open file" or drop the .html file on the editor. It is read in your browser, never uploaded, and the preview shows how a browser renders it. Images and stylesheets load only if they use absolute https:// URLs.

How can I see the HTML code of a web page?

In the browser, press Ctrl+U (Cmd+Option+U on a Mac) or put view-source: before the address to see the page source. Copy it here to render parts of it, and use the HTML Formatter to indent it so it is easier to read.

Can it render .cshtml or other template files?

Only the HTML in them. Razor (.cshtml), PHP, JSX and other templates are processed on a server first, so directives such as @model or <?php ?> appear as plain text in the preview. Paste the HTML the server produces to see the real page.

How do I preview HTML with CSS and JavaScript together?

Put everything in one snippet: a <style> block in the head for CSS and a <script> block before </body> for JavaScript, then switch on "Run scripts". External stylesheets work when you link a public https:// URL.

How do I convert the HTML I preview to a PDF?

Open the HTML to PDF converter, paste the same code and choose the paper size, orientation and margins. It returns a PDF you can download.

What is the difference between an HTML viewer and an HTML editor?

A viewer shows how code renders; an editor is for writing a whole site. This tool does both for snippets: the left side is an editor and the right side is the live preview, but it does not save files or host pages.

Why does my HTML look different here than in my browser?

The preview has no base URL and loads no styles from your site, so relative images, linked stylesheets and fonts do not appear. Use absolute https:// URLs, or inline the CSS.

Does the HTML viewer work on mobile?

Yes. On a phone the editor and the preview stack vertically, and the preview updates a moment after you stop typing.

Guides and tutorials