An HTML viewer takes HTML code and shows you what it looks like in a browser. Open an
HTML file or paste some code, and the preview updates as you type. HTMLViewer (that’s this site, htmlviewer.tech)
does it for free, right in your browser.
When you’re starting out, you’ll reach for this more often than you’d think. Someone sends you an .html file
and you just want a quick look. You copied a snippet from a tutorial and want to see what it does before it goes
into your project. Instead of creating a file, saving it and refreshing the browser every time, you
paste and look. If you’re working on an email, use the HTML email viewer to see
it at desktop and phone widths.
The preview is made in your browser, and we don’t upload your code unless you create a share link. If your HTML
uses images, styles or scripts from other websites, your browser still loads them from those sites.
You can paste the small examples into the viewer and try each step as you go.
Step 1 Open an HTML File or Paste Code
Pick whichever is easiest:
- Paste it: copy HTML from your code editor, a tutorial, an email or anywhere else, and paste it in.
- Open a file: click the upload button, or drag your .html file onto the viewer.
- Click Sample: loads a small demo page so you can play around right away.
Don’t have a file yet? Here’s how to create and open an HTML file. If
your page opens without its styles, see how to link CSS to HTML. The
viewer can’t open a web address, but you can view a website’s HTML and
paste it here.
Try it: your first page
Paste this:
<h1>Hello there 👋</h1>
<p>This is my first web page.</p>
💡 Notice there’s no <!doctype html> or <body>? For a quick test you don’t need them. Browsers are forgiving.
Step 2 Watch the Preview Update
There’s no Run button. The preview updates a moment after you stop typing, so you can change a color or a word
and see what happens. To keep HTML, CSS and JavaScript in separate tabs, use the HTML editor.
A page can look fine and still have mistakes in its code, so you can also check your HTML for errors.
Try it: change something and watch
Paste this, then change the color or add an item:
<h2 style="color: #2563eb">My shopping list</h2>
<ul>
<li>Coffee</li>
<li>Bread</li>
<li>More coffee</li>
</ul>
Step 3 Check It on Phone, Tablet and Desktop
A page that looks great on your laptop can fall apart on a phone. Use the Full / Desktop / Tablet /
Mobile switch above the preview. Desktop is 1280px wide, Tablet is 768px and Mobile is 375px, and your
media queries use that width. It’s good for checking a layout, but it isn’t the same as testing on a real
phone. Need more room? Click Maximize, or on a computer, drag the bar between the two panels.
You can also compare screen sizes side by side.
Try it: a box that changes color on mobile
Paste this, then click Mobile. The box turns green, because the preview is now under 600px wide.
<style>
.box { background: #fde68a; padding: 16px; }
@media (max-width: 600px) {
.box { background: #a7f3d0; }
}
</style>
<div class="box">Yellow on desktop, green on mobile</div>
Step 4 Turn JavaScript On or Off
Scripts in your HTML run by default, inside an isolated preview. Untick JavaScript and the page
renders with every script blocked. Turn it off before you open a file you don’t fully trust, or when
you want to see your page without its scripts.
Try it: a button that reacts
Paste this and click the button. Then untick JavaScript and click again. Nothing happens.
<button onclick="this.textContent = 'You clicked me! 🎉'">
Click me
</button>
Step 5 Save and Share
Done? Here’s what you can do with your HTML:
- Copy: grabs all the code in one click.
- Download: saves it as an .html file, named after your page title.
- Share: gives you a link to send to a teammate or your mentor. It opens your HTML in this viewer.
What is HTMLViewer?
HTMLViewer is this site, htmlviewer.tech: a free online HTML viewer. Some people type it as one word (htmlviewer), others as HTML Viewer, and both mean this page. Open an HTML file or paste code and the page shows up on the right. The menu has more free tools for when you need them, like an HTML editor, a formatter and a validator.
Is it safe to open HTML I don’t trust?
It’s safer than opening the file directly in your browser, but be careful. The preview is isolated, so scripts in it can’t read this site’s cookies or saved data. The page can still load things from other websites, and it could show a fake sign-in form. Untick "JavaScript" before you open the file, and don’t type passwords or click links in a page you don’t trust.
Does my code get uploaded anywhere?
Not unless you share it. The preview is made in your browser, and we only store your code when you create a share link. If your HTML uses images, styles or scripts from other websites, your browser loads them from those sites, like it does on any web page.
Why does my HTML file look different here?
Usually because its images or CSS files are missing. Opening an HTML file doesn’t bring along the other files in its folder, so paths like images/logo.png or css/style.css won’t work here. Use full https:// addresses for files that are online, or put your CSS inside a <style> tag. A few websites block their files from loading on other sites, so those can still be missing.
Do I need the full <!doctype html> boilerplate?
Not for a quick test. Browsers are forgiving, so a single <h1> or <table> renders just fine. For real pages, keep the doctype and the viewport meta tag. They make the page behave properly, especially on phones.
How do I open an HTML file online?
Click the upload button above the editor and choose your file, or drag it onto the viewer. Its code appears in the editor, and the page shows up in the preview. You can open .html, .htm, .xhtml and .svg files up to 5 MB, and .txt files with HTML inside.
Will editing here change my original file?
No. You’re editing a copy, so the file on your device stays the same. Click Download to save your changes as a new .html file. This page doesn’t save your code, so download it before you close or refresh the tab.
How do share links work?
Click Share, pick how long the link should last (7 days up to never), and you get a link that opens your HTML in this viewer. Anyone with the link can open it. Sign in before you share if you want to delete the link yourself from your Dashboard. If you weren’t signed in, send us the link through the Contact page and we can delete it.
Is it really free?
Yes. No signup and no paywall. Files you open can be up to 5 MB, and share links can hold up to 1 MB. There’s also a limit on how many links you can create in a minute.