Developer / HTML

HTML Viewer: Live Sandboxed Preview with CSS and JavaScript

Paste HTML and optional CSS to see a live isolated preview. Enable JavaScript explicitly, expand the preview to full screen or download an HTML preview file.

HTML Viewer: Live Sandboxed Preview with CSS and JavaScript: Renders source in a sandboxed frame with an opaque origin. Scripts start disabled. A content security policy blocks external resources, fetch requests, forms and embedded pages while allowing inline styles and data images. Metadata that can refresh the page, base elements and embedded browsing contexts are removed. The download preserves the isolated frame. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
HTML viewerLocal processing

Runs entirely in your browser

The preview is isolated from this site. Scripts are off by default. External styles, scripts, images, fetch requests, forms and embedded pages are blocked; inline styles and data images are allowed. Enabling scripts runs code you paste inside the preview.

Live preview

The downloaded HTML opens the same isolated preview. No source is inserted into this page.

Frame isolation

The WHATWG HTML standard defines iframe sandbox restrictions (https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-sandbox). This preview never grants allow-same-origin.

Content restrictions

The W3C Content Security Policy specification defines resource restrictions (https://www.w3.org/TR/CSP3/). The preview applies a restrictive policy before the supplied markup. Its downloaded wrapper keeps the sandbox boundary.

How to use it

  1. Paste HTML and optional CSS or JavaScript.
  2. Enable scripts only when you want your pasted code to run in the isolated preview.
  3. Inspect the live or full-screen preview, then download the sandboxed preview file.

Privacy & limitations

Your inputs and files are processed in your browser. Nothing is uploaded.

Related tools

Frequently asked questions

Can my preview access this site’s cookies or page?

The sandbox does not grant same-origin access. Pasted code cannot read this site’s DOM or storage. Scripts only run when you enable them.

Why do external images or libraries not load?

The local preview blocks remote resources. Put styles and scripts directly in the editors and use data URLs for images.

Can I paste a complete HTML document?

Yes. The preview accepts complete documents and fragments. It removes metadata and embedded browsing contexts, applies its own content security policy, and renders the result in the isolated frame.

What does the download contain?

It contains an HTML file that opens your source inside the same sandbox. It is a preview file rather than the source pasted directly into an ordinary page.

Free tool · runs in your browser · no account required