HTML Viewer
View and preview HTML online for free — paste code or open an .html file (or a whole .zip with its images and CSS) and see the page rendered instantly. Check it at phone, tablet and desktop widths, switch scripts and outside requests off to open a file you don’t trust, and see every website it would contact. Nothing is uploaded.
100% private — everything runs in your browser. The preview runs in a sandboxed frame; nothing is uploaded.
The preview runs in a sandboxed frame that can’t read this page, your cookies or other sites’ data — for a file you don’t trust, untick “Run JavaScript” and tick “Block external requests”. Nothing is uploaded; your last page is remembered in this browser only.
How to view an HTML file online
- Paste HTML into the code box, or click “Open .html or .zip” (you can also drag a file onto the box).
- Check the preview — it updates as you type. Pick Phone, Tablet or Desktop width to test responsive layouts.
- Switch between Code + preview, Preview only and Code only; use Format code to tidy messy markup.
- Download the .html, copy it, or open the preview full screen.
What you can use it for
- Open an .html email attachment, exported report or receipt on any device
- Preview HTML generated by ChatGPT, Claude or Gemini before you publish it
- Check an HTML email template or landing-page snippet at phone width
- Safely inspect a suspicious HTML attachment with scripts and network switched off
- Learn and teach HTML by seeing markup render as you type
What you can preview
Most online HTML viewers assume you’re writing code. This one is built just as much for opening pages you’ve been sent or have saved:
- Single .html and .htm files — saved web pages, exported reports, invoices and receipts, newsletters and email templates.
- Whole sites in a .zip — the viewer embeds the CSS, images, fonts and scripts the page links to, so relative paths work.
- HTML from AI assistants — pages and artifacts generated by ChatGPT, Claude or Gemini.
- Exports from other tools — e-learning modules, Twine stories, documentation and prototype exports that ship as HTML.
- Snippets — a component, a table or an email block you want to check before you paste it into a CMS.
Safe mode: view untrusted HTML without running it
HTML attachments are a common phishing trick: the file opens a convincing sign-in page that sends whatever you type to someone else. To look inside a file without letting it do anything, untick Run JavaScript and tick Block external requests before you open it.
- Run JavaScript off: scripts in the file are not executed, so it can’t redirect you, open pop-ups or record keystrokes.
- Block external requests on: the page can’t load trackers, remote images, fonts or scripts from other websites.
- External domains list: under the preview you’ll see every website the file tries to load something from — an unfamiliar domain on a page claiming to be your bank is a red flag.
Even in safe mode, treat a suspicious file as suspicious: don’t follow its links or type anything into it, and report the email to whoever runs your mail.
Test on phone, tablet and desktop widths
Responsive pages change layout with screen width. Use the Width buttons to render the page at 375 px (a typical phone), 768 px (a tablet in portrait) and 1280 px (a laptop), or Full to fill the space available. Full screen opens the preview on its own so you can scroll it like a real page.
For HTML email templates, phone width matters most: many people read email on a phone, and tables that look fine on a desktop can overflow a narrow screen.
HTML viewer vs. HTML editor vs. CodePen
| Tool | Best for | How it works |
|---|---|---|
| HTML Viewer (this page) | Opening and checking existing pages, files and ZIPs | One code box plus preview; safe mode; device widths |
| HTML Editor | Writing HTML, CSS and JavaScript from scratch | Three panes with a live preview and console |
| CodePen / JSFiddle | Sharing public code demos with others | Online accounts, saved pens, community features |
If you want to keep editing what you’re viewing, copy it into our HTML Editor, which splits HTML, CSS and JavaScript into separate panes.
Open HTML files on iPhone, Android, Chromebook and iPad
Phones and tablets often won’t open an .html attachment directly — they show raw code or ask which app to use. Save the attachment to Files (iPhone and iPad) or Downloads (Android), open this page in your browser, tap “Open .html or .zip” and pick the file. It renders right away with no app to install, and the same works on Chromebooks where you can’t install software.
Why images or CSS don’t show
- Relative paths: src="img/logo.png" means “a file next to this page”. A pasted or single opened file has no folder around it, so open the whole folder as a .zip instead.
- Base URL: if the page lives on a website, enter that address as the Base URL and relative paths will load from the live site.
- Blocked by the other site: some servers refuse to let their images, fonts or scripts be loaded from other websites. Using absolute URLs to a CDN usually fixes it.
- Safe mode is on: Block external requests stops everything from other websites by design.
Loading HTML from a URL only works when that site allows its pages to be read by other websites (CORS). Most don’t — in that case open the page, use View Source, copy it all and paste it here.
Share your HTML as a link
Want someone else to see the page? Our HTML to Link tool turns an .html file or .zip into a free temporary link with a QR code — and reviewers can click any element to leave a comment, which you can export as FEEDBACK.md for your AI assistant.
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
Is this HTML viewer free, and do I need to sign up?
It’s completely free with no account, no usage limit and no watermark.
Is my HTML uploaded or stored anywhere?
No. The file is read and rendered entirely inside your browser and never sent to a server. The last page you viewed is remembered in this browser only, so you can pick up where you left off; click Clear to remove it.
Can I open an HTML file from my computer or phone?
Yes. Tap “Open .html or .zip” and choose the file, or drag it onto the code box on a computer. This is the easiest way to read an .html attachment on an iPhone, Android phone, iPad or Chromebook without installing anything.
Can I preview a whole folder or ZIP with images and CSS?
Yes. Zip the folder and open the .zip. The viewer finds index.html (or the first HTML file), then embeds the stylesheets, images, fonts and scripts it links to so relative paths like css/style.css and img/logo.png display correctly.
Why aren’t my images, fonts or external scripts loading?
Relative paths (img/photo.jpg) point to files on your computer that a single pasted file can’t reach. Open the whole site as a .zip, add a Base URL so relative paths resolve against the live site, or use full https:// URLs. Some sites also block their files from being embedded elsewhere.
Is it safe to open an HTML email attachment here?
The preview runs in a sandboxed frame that can’t read this page, your cookies or other sites’ data. For a file you don’t trust, untick Run JavaScript and tick Block external requests first — then nothing in the file can run or contact the internet, and the domain list shows where it would have sent you. Never type passwords into a page you opened from an attachment.
Does it run JavaScript? Can I turn it off?
JavaScript runs by default, with console messages and errors shown under the preview. Untick Run JavaScript to see the page as static HTML and CSS only.
Can I preview AI-generated HTML from ChatGPT or Claude?
Yes — paste the code the assistant gave you, or open the .html file it produced, to see exactly how it renders on a phone and a desktop before you use it.
What’s the difference between this and the HTML editor?
The HTML viewer is for opening and checking existing pages and files. Our HTML Editor is for writing code from scratch in separate HTML, CSS and JavaScript panes.
Does it work on a school Chromebook or iPad?
Yes. It runs in any modern browser, including Chrome on Chromebooks and Safari on iPad and iPhone, with nothing to install.
Which files can it open, and how large?
It opens .html, .htm, .xhtml, .svg and .txt files, plus .zip archives of a whole site, up to 50 MB per file. Inside a ZIP it picks index.html (or the first HTML file) and embeds the linked CSS, images, fonts, scripts, audio and video. You can also paste code straight into the box, or load a page from a URL when that site allows it.
Can I view the source code of a website from its URL?
Sometimes. Paste the address into the URL box and press Load; the viewer fetches the HTML and uses that address as the Base URL, so relative images and CSS load from the live site. Many sites block this with a browser rule called CORS, and you’ll see a message saying so. In that case open the page, use View Source, copy everything and paste it here.