HTML Viewer
Paste HTML and see the page it makes, at desktop, tablet or phone width. Then check the same code against the standard.
The site your code comes from, so paths like /img/logo.png load in the preview. Your code is not changed.
Preview
JavaScript offNothing to show yet. Paste HTML above, or load the sample.
Validation
Checks the same code against the HTML standard with our HTML validator. Ctrl+Enter in the editor also works.
What the Viewer Does
Live preview
The page renders below the editor and follows every change, so you can adjust markup or inline CSS and see the result straight away.
Three widths
Full width, tablet at 768 px and phone at 390 px, to check media queries and layouts that break on small screens. The frame can also be resized in height.
Isolated from this site
The code runs in a sandbox with no origin of its own: no access to cookies, storage, this page or your session, and no pop-ups or form submissions.
Validated with one click
The same code goes through our HTML validator: every error and warning with its line, a click to select it in the editor, and a guide for the fix.
What the Sandbox Blocks
Previewing HTML means running somebody's markup inside your browser, and a careless previewer runs it as part of its own site. This one does not. The frame is created with the HTML sandbox attribute and without allow-same-origin, so the browser gives the page an opaque origin that matches nothing. We checked each of these in Chromium before publishing the tool:
- cookies,
localStorage,sessionStorageand IndexedDB throw a security error; - requests the page makes to this site carry no cookie, so they cannot act with your session;
- the page cannot read or navigate this page, open windows or tabs, submit forms, or show
alert()dialogs; - scripts do not run at all until you switch JavaScript on, and then only inside the sandbox.
What still happens is what any browser does with the page: images, stylesheets and fonts it references are fetched from their own servers, and clicking a plain link navigates the preview frame. Use Reload preview to bring the page back.
Viewer, Formatter or Validator?
Use this viewer to see what HTML looks like. Use the HTML formatter when the code itself is unreadable and needs indenting, or minifying for production. Use the HTML validator to check a live page by its address, or a long document with filters and an export. When the validator reports a problem, the HTML error guides show the wrong and right version of the code, from an unclosed tag to a missing alt attribute.