How to Export a Claude Artifact as an HTML File

· · Updated

A Claude Artifact is generated code with a preview attached, and for web artifacts that code is usually a complete HTML document. Exporting it means saving that document as a file you own. This guide covers how to do it for each artifact type, what commonly breaks, and how to get it to a live URL afterwards.

The Problem

An artifact lives in a conversation. That is fine while you are building and a problem the moment the work needs to exist independently.

Three things follow from artifacts being conversation-bound:

  • Access depends on the conversation. Anyone who needs to see it needs your session, your account, or your screen.
  • The artifact is not durable in your hands. Keep iterating and the earlier version is replaced. There is no copy on your disk unless you made one.
  • Reviewers cannot interact with it. A screenshot of an interactive dashboard is a picture of a dashboard.

Exporting fixes all three, and it is a small operation — the hard part is knowing which of the three artifact types you have.

How Export Works, by Artifact Type

Single-file HTML artifacts

The easy and most common case. The artifact is one document with <html>, inline <style>, and inline <script>.

  1. Copy the artifact code, or use the download option if it is offered.
  2. Save it as prototype.html.
  3. Double-click the file.

If it opens in your browser and behaves as it did in Claude, you are done. A self-contained HTML file has no dependencies to resolve and no build step.

React-component artifacts

Claude often produces a React component — a .jsx file exporting a single component. A browser cannot open that directly, which is why people hit blank pages here.

Two options:

  • Wrapper file. Create an HTML document that loads React from a CDN and mounts the component. Ask Claude to produce this wrapper; it does it reliably in one prompt: “convert this into a single self-contained HTML file that runs in a browser with no build step.”
  • Real project. Scaffold a Vite React project, drop the component in, npm install && npm run build, and take the dist/ folder. More work, but the right move if the artifact is going to keep growing.

For sharing a prototype, the wrapper is almost always the correct choice. One file, no toolchain.

Multi-file artifacts

If the artifact is a set of files — several components, a stylesheet, assets — treat it as a project. Save the files with the structure intact, build if there is a build step, and keep the output folder together. When you host it, upload the whole folder as a zip so the relative paths keep resolving.

What Breaks After Export

CDN dependencies. Generated pages frequently load Tailwind, a chart library, or a font from a CDN. Online this is invisible. Offline the page renders unstyled. If offline matters, ask for a version with everything inlined.

Absolute paths. /assets/logo.png assumes the file sits at a domain root. If you host at a subpath it 404s. Relative paths (./assets/logo.png) work everywhere.

Local storage assumptions. An artifact that persists state to localStorage will behave differently once it is on a real domain, because storage is per-origin. Usually harmless; occasionally the reason a demo looks empty.

An HTML file on your disk is still not shareable. Email is the intuitive next step and the one that fails: mail providers strip or quarantine HTML attachments, and recipients who do receive one often see raw markup or a security warning.

Upload it instead. On Undraft the upload gives you a URL that anyone can open and interact with, no account needed to view — plus the thing the export cannot give you on its own: reviewers can click an element on the live page and pin a comment to it. Feedback about the header ends up on the header.

Because each re-upload is kept as a version with its own comments, a second export after another round of prompting does not erase what reviewers already said about the first.

Examples

Before

  1. Claude generates an interactive report.
  2. You screenshot three sections into Slack.
  3. A teammate asks whether the filter affects the chart.
  4. You check, screenshot again.
  5. Two days later, nobody can find the current version.

After

  1. You export the artifact as report.html and confirm it opens locally.
  2. You upload it and share the link.
  3. Teammates try the filters themselves and pin two comments on the chart.
  4. You re-prompt, re-export, re-upload to the same project.
  5. The link never changed and version 1 is still there if you need to compare.

Summary

  • Export to a self-contained HTML file — ask Claude to convert a React artifact into one if that is what you have, and confirm it opens locally before sharing.
  • Check for CDN and path assumptions — those are the two reasons an exported artifact looks right locally and breaks when hosted.
  • Avoid emailing the file — attachments get stripped, so host it and send a link instead.

Next: the step-by-step guide to share a Claude Artifact as a live link, the general version for any HTML file, or the wider workflow in how to share and collaborate on Claude Artifacts.

Frequently Asked Questions

Can you download a Claude Artifact as an HTML file?

Yes for artifacts that are already HTML: copy or download the artifact's code and save it with an .html extension. React-component artifacts need either a small HTML wrapper or a build step, because a bare .jsx file will not open in a browser.

Why does my exported artifact open as a blank page?

Usually because the artifact is a React component rather than a complete HTML document, so there is nothing for the browser to render. Wrapping it in an HTML file that loads React and mounts the component, or building the project, resolves it.

Do exported artifacts still work offline?

Only if everything is inline. Many generated pages pull a font or a chart library from a CDN, and those parts fail without a network connection while the rest of the page still renders.

How do you share an exported artifact with someone?

Upload the HTML file to a host that returns a public URL and send the link. Emailing the file usually fails, because mail providers routinely strip or quarantine HTML attachments.

Is exporting the same as using Claude's share link?

No. A share link points back into Claude's interface and depends on that account and conversation. An exported file is a standalone artifact you control, host wherever you want, and keep after the conversation is gone.

More on this topic: AI Collaboration

A

Founder at Undraft · Product manager

Built Undraft after watching prototype review break down into screenshots and ZIP attachments one too many times. Writes from direct experience running the product.

More posts by Ari Kliger