HTML Viewer
Paste or upload HTML and see it rendered live in a sandboxed preview at desktop, tablet, and mobile widths, with optional JavaScript.
How to Use the HTML Viewer
- Paste HTML into the editor, upload an .html file, or load the sample.
- Watch the preview update as you type, or untick "Auto Update" and click Refresh when you're ready.
- Switch between Responsive, Desktop, Tablet, and Mobile widths to check your layout, or open the preview in fullscreen.
- Tick "Run JavaScript" to execute scripts, and enter a Base URL if your page uses relative image or stylesheet paths.
- Click "Format HTML" to tidy the code, then copy it or download it as index.html.
HTML Viewer Features
- Live preview that updates as you type, or on demand
- Responsive, desktop (1280px), tablet (768px), and mobile (375px) widths, scaled to fit
- Sandboxed iframe with JavaScript off by default and a one-click toggle
- Base URL option so relative images, stylesheets, and links load
- One-click formatting, file upload, fullscreen preview, and .html download
Frequently Asked Questions
Is it safe to preview HTML I don't trust?
The preview runs in a sandboxed iframe with its own isolated origin, so the page can't read this site's cookies or storage, open pop-ups, submit forms, or navigate this page. JavaScript is off by default. Only turn it on for code you're comfortable running in your browser.
Why aren't my images or stylesheets loading?
Relative paths such as images/logo.png are resolved against this website, where those files don't exist. Enter your site's address in the Base URL field so relative URLs load from your server, or use absolute URLs in your HTML.
Why don't alert() or form submissions work?
The sandbox blocks dialogs such as alert(), confirm(), and prompt(), along with form submissions and new windows, even when JavaScript is on. Scripts also run without access to localStorage or cookies. Use console.log() and your browser's developer tools to debug scripts.
How do the device widths work?
Desktop, Tablet, and Mobile render the page 1280, 768, and 375 pixels wide, so CSS media queries respond as they would on those screens. If the preview area is narrower, the page is scaled down to fit and the zoom level is shown. Responsive uses the full width of the preview area.
Is my HTML uploaded anywhere?
No. The preview is built in your browser and your code never leaves your device. Images, fonts, and scripts that your HTML links to are still loaded from their own servers, as they would be on any web page.