Start here

Sharing AI-generated HTML, building slides and reports, or shipping a whole site? These pillars show you how to turn it into one live link.

Ship your AI work as one link

Turn your HTML or ZIP into one live link you can send anywhere. No deploys, no screenshots, no zip files.

  • Publish HTML & Claude artifacts
  • Drop a ZIP, get a live page
  • Update anytime, same link
No credit card required
How to Get Self-Contained HTML From AI (Single-File Pages)
© Photo on Unsplash

How to Get Self-Contained HTML From AI (Single-File Pages)

TLDR: A single self-contained HTML file is the most portable thing AI can build you, because everything the page needs lives inside one file with no external dependencies to break. Claude and ChatGPT will not always give you that by default, so you have to ask for it directly. Use a prompt that says “one HTML file, all CSS and JavaScript inlined, no external files or CDN links, icons as inline SVG,” verify it works offline, then publish that file as a live link.

There is a specific, boring reason AI-generated pages so often look great for you and broken for everyone else: dependencies. The page you see relies on a separate stylesheet, a script file, or a library loaded from the internet, and when the page leaves your screen, those pieces do not always come with it. The cure is to get self-contained HTML from AI in the first place: a single file that carries everything it needs.

This guide covers what self-contained means, the exact prompts that produce it from Claude and ChatGPT, how to check the file actually stands alone, and how to turn that one file into a link anyone can open.

What “self-contained” really means

A normal website is a bundle of parts: an HTML document that points to CSS files, JavaScript files, image files, and fonts, all loaded from various places. That is fine when a web server is stitching them together. It is fragile the moment you try to move the page around as a thing.

A self-contained HTML file collapses that bundle into one document. The styles live in a style block inside the file. The scripts live in a script block inside the file. Icons are drawn as inline SVG, and small images are embedded directly. There are no outside links to resolve, so there is nothing to go missing.

A self-contained file has no “somewhere else.” Everything the page needs is right here, in this one file. That is why it travels without breaking.

The tradeoff is honest: a single file is not how you would build a large production app, and cramming several big photos inline makes it heavy. But for a landing page, a proposal, a resume, a calculator, a chart, or almost anything an AI builds in one shot, one file is the sweet spot of simple and durable.

Many linked files (fragile)index.htmlstyle.cssapp.jslogo.pngOne self-contained file (portable)page.htmlHTML + CSS + JSinline SVG + imagesnothing external

The prompts that actually work

The reason people do not get self-contained files is simple: they do not ask for them. Left to its own defaults, an AI may reach for a CSS framework off a CDN, split scripts into modules, or link a Google font. Each of those is a dependency that can break in transit. Spell out what you want instead.

Here is a reliable base prompt you can paste into Claude or ChatGPT:

“Build this as a single self-contained HTML file. Put all CSS in one style tag in the head and all JavaScript in one script tag. Do not link to any external files, CDNs, or web fonts. Use only system fonts. Draw all icons as inline SVG. The finished page must work fully offline from this one file. Output the complete file.”

If you already have a multi-file result and want it collapsed, use this:

“Take everything you just built and combine it into one self-contained HTML file. Inline every stylesheet and script, replace any CDN library with equivalent vanilla code or an inlined copy, and embed images as base64 data URIs or inline SVG. Return the single complete file.”

And to sanity-check the result:

“List every external resource this file still loads, if any. Then rewrite it so there are zero external requests.”

That last one is quietly powerful, because it makes the model audit its own output instead of you hunting through the code.

Claude vs ChatGPT: same idea, small differences

Both tools do this well. The differences are mostly about where the result lands. In Claude, a page like this shows up as an artifact you can preview and copy out. In ChatGPT, it usually lands in Canvas or a code block you copy. Pick whichever tab fits your situation:

In Claude. Ask for a single self-contained HTML file. It appears as an artifact you can preview live. Switch to the code view, select all, and copy the whole file, or download it. If it split anything out, tell it to inline everything into one file.
In ChatGPT. Ask for a single self-contained HTML file. It usually opens in Canvas or appears as a code block. Use the copy button to grab the full file. If it added a CDN link or a font import, tell it to remove them and inline equivalents.
Verify it. Save the file and open it with your Wi-Fi off. If every style, script, and icon still works with no network, it is genuinely self-contained. If something disappears, an external dependency is still hiding in the file.

The offline test (do not skip it)

The fastest way to know a file is self-contained is to cut off the internet and open it. Turn off Wi-Fi, double-click the saved .html file, and look hard:

  • Do the fonts still look right, or did they fall back?
  • Do icons and images appear, or are there broken-image boxes?
  • Do buttons, tabs, and charts still respond?

If everything survives with no network, you have a truly portable file. If anything breaks, there is still an external request in there, and the audit prompt above will find it.

Here is how the common output shapes compare for sharing:

Output shapeTravels intact?Multi-file safe?Easiest to publish?
Single self-contained fileYes, nothing externalN/A, it is one fileYes, paste and go
HTML linking separate CSS/JSOften breaksOnly if all files move togetherNo
Page pulling from a CDNBreaks if the link is strippedNoNo
Multi-file project as a ZIPYes, when hostedYes, paths resolveYes, drop the ZIP

The two green rows are the ones worth aiming for: a single self-contained file for one page, or a ZIP for a genuine multi-file project.

From one file to one live link

One HTML fileeverything inlinedPaste to publishno build, no serverOne live linkworks on any device

A self-contained file is perfectly portable, but a raw file still asks the recipient to download and open it, which many people never do, and email clients often strip HTML attachments. The clean finish is to host the file at a URL and send the link instead.

That is what VisiblePage is for. Paste your single self-contained file and you get a live URL immediately, with no build step and no server. Because it is properly hosted, the page loads fast on any device and stays fully interactive. If your project is genuinely multi-file, drop a ZIP instead and every relative path resolves. When you revise the page later, re-publish to the same link so nothing you already shared goes stale.

Try it now: Publish your self-contained HTML as a live link with no setup.

This is the last step of nearly every AI build, so it is worth doing well. The broader picture lives in our pillar on building with Claude and ChatGPT, and once the file is ready, sharing your AI work and sharing ChatGPT HTML as a link cover the handoff. If you want to understand what “inline” really means under the hood, the MDN web docs are the reference.

Frequently asked questions

What does self-contained HTML mean?

A self-contained HTML file holds everything the page needs (the markup, the CSS, the JavaScript, and often the images) inside one file, with no links to separate assets. That makes it the most portable thing an AI can build, because there is nothing external to break. Once you have that single file, you can publish it as a live link with VisiblePage in seconds.

How do I ask Claude or ChatGPT for a single-file page?

Tell it explicitly: output one HTML file, inline all CSS and JavaScript, use no CDN links or external files, and embed icons as inline SVG. Being specific matters, because by default an AI may split styles and scripts into separate files or pull in outside libraries.

Why does my AI-generated page break when I send it to someone?

Usually because it depends on files or libraries that did not travel with it, like a separate stylesheet, a script file, or a CDN link that a mail client stripped. A self-contained single file avoids this because everything lives inside it, and hosting that file at a URL removes the problem entirely.

Can images be inside a self-contained HTML file?

Yes. Small images and icons can be embedded directly as inline SVG or as base64 data URIs, so they live inside the file. For a few large photos, hosting the project so relative paths resolve is cleaner, which a proper host handles for you.

Is a single file better than a ZIP of multiple files?

For most one-page projects, a single file is simpler and safer. For larger multi-file projects with many assets, a ZIP that a host unpacks and serves is the better fit. Both publish to a live link the same way.

Ready? Turn your single-file page into a live link — your first page is free.

Ready to publish your AI work?

Drop in your HTML or ZIP and Visible Page turns it into one live link you can send anywhere. No deploys, no screenshots, no zip files.

Your first page is free. No credit card required.

Related articles

The Anatomy of a Report People Actually Read

7/31/2026

Most reports go unread because they bury the point and make the reader dig for it. Here is the anatomy of a report people actually read, section by section, plus the AI prompt that builds it that way from your raw material.

How to Brief AI Like You'd Brief a Designer

7/29/2026

The best way to get a great page out of AI is to stop prompting and start briefing. Here is the anatomy of a design brief, translated for AI, with a copy-paste template you can reuse for any page.

Feel-Words: The Vocabulary That Art-Directs AI Design

7/28/2026

AI does not need you to know CSS. It needs you to know the right adjectives. Here is a copy-paste vocabulary of feel-words that art-direct the look of anything you build with AI, grouped by mood, type, color, space, and detail.

Austin Spaeth

Austin Spaeth is the founder of VisiblePage, the easiest way to share your AI work. After watching people struggle to send the HTML, artifacts, and apps their AI tools produced — screenshots, zip files, half-finished deploys — he built VisiblePage to turn any HTML or ZIP into one live link you can share anywhere.

VisiblePage

The easiest way to share your AI work. Turn your HTML or ZIP into one live link you can send anywhere.

Publish your first page