How to preview pasted HTML
- Paste a snippet or a full document into the editor.
- Watch the iframe update as you type.
- Use the JavaScript control if scripts should run. The label looks like
JavaScript auto · onorJavaScript manual · off, and may prefix Tailwind, Bootstrap, Alpine, Vue, or React when those names appear in a scriptsrc. - Read the preview status
Live · JS on,Live · JS off, orEmpty · JS ….
Reading your results
The left pane is your source. The right pane is a sandboxed iframe. With scripts allowed, the sandbox attribute is allow-scripts only. With scripts off, the sandbox attribute is empty, so even inline handlers stay blocked.
- Detection ignores scripts inside comments,
template, andnoscript. - Auto mode turns scripts on when executable
scripttags, inline handlers, orjavascript:URLs are found in active markup. - Manual mode keeps your on/off choice until the source changes enough to reset auto detection.
To retrieve HTML from a public address, use View Source, then paste that markup here if you want a visual preview.
Common problems and fixes
- You expected a URL box. This page is paste-only. Fetching a public page is the homepage job.
- Buttons do nothing. Check the toggle. If the label says
JavaScript auto · offorJavaScript manual · off, scripts are not running. Turn them on only for code you trust. - Layout looks unstyled. Linked CSS, fonts, and images still load from their original URLs when the browser can reach them. Relative paths that pointed at the original host will break in this frame.
- A framework name appears but the app is blank. Detecting React or Vue in a
srcdoes not mount a build, hydrate a bundle, or supply API data. - A script in an HTML comment never enabled JS. That is intentional. Commented and
noscriptcode is ignored for detection. - The status reads Empty. The editor has no markup yet, or only whitespace. Paste a document to move to
Live · JS ….
Sandbox and the JS toggle, not a fetcher
Several online viewers also pull a URL or host a share link. HTML Viewer does neither. You bring the markup. We isolate it in an iframe and let you decide whether scripts run.
MDN documents the iframe sandbox attribute in the iframe element reference. Even with allow-scripts, this frame does not receive same-origin access to SolViewer.
How this check works
The editor holds your HTML locally. On each edit we scan active markup for executable scripts and known CDN filenames, set the iframe sandbox, and write a srcdoc document. Theme styles are injected so the preview follows light or dark UI. Nothing is requested from the address bar of this page.
Do not paste untrusted code and enable scripts unless you understand what it will do in your browser.
Frequently asked questions
How can I view HTML online without publishing a file?
Paste the markup into this editor. The iframe shows the rendered output beside the code. No account is required.
Does the HTML Viewer fetch a live webpage?
No. There is no URL retrieval on this page. Fetch a public document with View Source, then paste the markup here if you want a visual check.
Can the preview run JavaScript?
Yes, when the toggle is on. Auto mode enables scripts for detected executable code. Manual mode lets you force on or off. The sandbox never grants same-origin access.
Why does my preview differ from the original site?
The original page may depend on cookies, APIs, bundled CSS, or a build step that is not in the snippet you pasted. The iframe only renders what you gave it, plus any absolute assets the browser can still load.
Related tools
- View Source — retrieve returned HTML from a public URL, then paste it here if you want a visual check.
- SEO Checker — audit title, headings, and metadata in a fetched document rather than a local preview.
- Open Graph Checker — preview social tags from server-rendered metadata, which this iframe does not extract.