What is an HTML viewer?
HTML is the code a web page is written in. A viewer takes a piece of that code and shows what a browser makes of it: the headings, the text, the images, the layout. It is the quickest way to check a snippet without creating a file and opening it, or putting it on a site.
People use it to look at an email template before sending it, to check a block copied from another page, to see what a generated piece of code produces, or to learn how a tag behaves.
How this tool works
The code is on the left and the page it makes is on the right. Paste your code over the sample, or edit it: your own browser redraws the page as you type, with no button to press. On a narrow screen the page is shown under the code.
Nothing is sent to our server. The code never leaves your browser, so it is safe to paste something that isn’t public yet. This is also why the tool has no daily limit.
You can choose the width the page is drawn at: the full width of a computer screen, a tablet (820 px) or a phone (412 px). A page with responsive styles rearranges itself at each width, as it would on that device.
Under the view, one line counts what the code holds: its size, its lines, and how many elements, scripts, styles and images it has.
Scripts
By default, JavaScript in the code is switched off, and the view shows the page as its HTML and CSS alone make it. That is the safe choice for code you didn’t write.
Switch JavaScript on to see the page with its scripts running. They run inside a sandboxed frame: the browser keeps them away from this page, from your cookies here and from the rest of the site. They can still load files from the internet, as any page can.
What this tool can’t show you
The code is drawn on its own, away from the site it came from. A stylesheet, script or image given by a relative address, such as “/css/style.css”, has nothing to be relative to and won’t load; one given by a full address will. Add a base tag with the site’s address at the top of the code if you need them.
Forms can’t be submitted and links don’t open from inside the view. The width is the width of the frame, not a full simulation of a phone: touch, the phone’s fonts and its screen density are not imitated. And the view is your browser’s; another browser may draw the same code a little differently.