How to preview an HTML file an AI assistant gave you, and send it to someone
ChatGPT, Claude or Gemini writes you a landing page, a report or a small dashboard as one HTML file. You want to see it as a page before you trust it, and then often show it to someone who will not open a code block. He
ChatGPT, Claude or Gemini writes you a landing page, a report or a small dashboard as one HTML file. You want to see it as a page before you trust it, and then often show it to someone who will not open a code block.
Here is how to do both, from the fastest local check to sending a link.
See it locally
Save the code as page.html and double-click it. Your browser opens it from disk at a file:// address. This is enough to check that it renders, and it is completely private.
Two limits: the page only exists on your machine, so you cannot send that address to anyone; and some features (fetching data, certain module scripts) behave differently from file:// than from a real web address.
See it without saving anything
If you do not want files piling up in Downloads, paste the code into an online HTML viewer. Birta's HTML viewer takes a dropped .html file or pasted code and shows it as a page:
- styles and scripts inside the document run, in a frame kept apart from the site;
- a phone-width view shows whether the layout survives a small screen;
- a source view lets you fix the code and see the page update;
- nothing leaves your browser until you ask for a link.
This is the check worth doing on anything an assistant generated: click the buttons, scroll to the bottom, look at it at phone width. Generated pages most often break on mobile and on content that is longer than the example the model imagined.
Send it to someone
A pasted code block or an attached .html file is a poor way to share a page: messengers and mail clients show it as text or block it. Send a link to the rendered page instead.
Birta's Publish HTML tool does exactly that: paste the code, check the page, get a link anyone can open for 24 hours, with no account on either side. The page is closed to search engines. If it turns out to matter, keep it in a free account and it gets a permanent address and a new version with each change.
Quick reference
| You want to | Do this |
|---|---|
| check it privately | open the saved file in your browser |
| check it without saving, including phone width | an online HTML viewer |
| show it to a person | send a link to the rendered page |
| keep it online | put it in an account with a permanent address |
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.