Developer

HTML Previewer

Write or paste HTML and instantly see it rendered in a sandboxed preview. Supports full pages and fragments. 100% client-side.

8L · 328C

Runs in sandboxed iframe — safe to preview untrusted HTML

A code editor window with angle brackets beside a browser window showing the rendered page layout

How to use

  1. Type or paste HTML into the EDITOR. The PREVIEW updates a moment after you stop typing.
  2. Start from a TEMPLATE (Blank, Simple page, Form, Flexbox or Table) if you want a ready-made example to edit.
  3. Paste just a snippet, such as a single <table> or <div>: WRAP, on by default, places it inside a basic page with a doctype and viewport.
  4. Use FULLSCREEN to check the layout at full width, COPY to copy the code, or DOWNLOAD to save it as an .html file.

Test HTML and CSS without setting up anything

Sometimes you just need to see what a piece of HTML looks like: an email template, a snippet from a tutorial, a table exported from a spreadsheet, or a quick layout idea. Here you paste the code and see it rendered right away, with no files, no local server and no account. It works for full pages with <html> and <head>, and for fragments.

Inline <style> blocks and style attributes work, as do <script> tags, so you can try small interactive examples. Everything stays in your browser.

Why the preview is sandboxed

The preview runs in a sandboxed iframe that allows scripts and alert boxes but nothing else. Code in it cannot read this site's cookies or storage, submit forms, open pop-ups or navigate the page, because the sandbox gives it a separate, unique origin. That makes it reasonably safe to look at HTML you did not write, such as an email someone forwarded.

The sandbox does not block everything: images, fonts and stylesheets linked from other websites still load, so the sites hosting them can see that the file was opened. If you are checking a suspicious email for tracking pixels, remove external image links first.

In the previewAllowed?
HTML, inline CSS and <style>Yes
JavaScript in <script>Yes, isolated from this site
alert() and confirm()Yes
Reading this site's cookies or storageNo
Submitting forms, pop-ups, navigating the pageNo
Loading images, fonts and CSS from other sitesYes, so they can see the request

Common uses

Check an HTML email signature or newsletter before sending it, view the output of a template or CMS export, practice HTML and CSS while learning, or share a quick demo by downloading the .html file and sending it to someone. For JSON or Markdown, use a dedicated formatter or editor instead; this tool renders HTML only.

Frequently asked questions

Is it safe to paste HTML from an unknown source?

The preview is sandboxed, so scripts cannot reach this site, your cookies or other tabs. External images and files it links to will still load, so the people hosting them can see the request.

Can I use CSS and JavaScript?

Yes. Put CSS in a <style> block or style attributes and JavaScript in <script> tags. External libraries can be loaded with a normal <script src>.

How do I save my work?

Click DOWNLOAD to save it as an .html file you can open in any browser, or COPY to paste it elsewhere.

Is my code uploaded?

No. The code and the preview stay in your browser.

How do I preview an HTML file in my browser?

Double-click the .html file, or drag it onto an open browser window, and the browser renders it. To try code without saving a file, paste it here: the preview updates as you type, and Download saves the result as preview.html.

Does VS Code have an HTML preview?

Not for HTML out of the box. Most people install an extension such as Live Server or Microsoft's Live Preview, which shows the page and reloads it when you save. For a quick snippet, pasting it here is faster than setting up a project.

Found a problem or have an idea? Report a problem

Share

You might also like