AI Chat Archive — HTML export format

This document specifies the HTML representation AI Chat Archive produces when exporting a Claude.ai conversation to HTML.

The HTML output is designed to be self-contained and look visually identical to Claude's own web UI in light mode. You can open the file in any browser — today or ten years from now — and the conversation renders correctly without any network access.

Document skeleton

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>{Conversation title}</title>
  <style>
    /* Embedded CSS: typography, colors, code-block styling */
  </style>
</head>
<body>
  <article class="conversation">
    <header>
      <h1>{Conversation title}</h1>
      <p class="meta">
        Created: {timestamp} · Updated: {timestamp}
      </p>
    </header>

    <section class="turn turn-human" data-sender="human" data-timestamp="...">
      <h2>Human</h2>
      <div class="attachments">…</div>
      <div class="body">…</div>
    </section>

    <section class="turn turn-assistant" data-sender="assistant" data-timestamp="...">
      <h2>Claude</h2>
      <div class="body">…</div>
    </section>

    <!-- …alternating turns… -->

    <footer class="branding">…</footer>
  </article>
</body>
</html>

Key design choices

Turn structure

Each turn is a <section> element with two modifiers:

<section class="turn turn-human"
         data-sender="human"
         data-timestamp="2026-04-23T14:07:12Z">
  <h2>Human <time>2026-04-23 14:07</time></h2>
  <div class="attachments">
    <div class="attachment">
      <span class="icon">📎</span>
      <span class="name">design-brief.pdf</span>
      <span class="size">234.5 KB</span>
    </div>
  </div>
  <div class="body">
    <p>Can you review these and suggest what's missing?</p>
  </div>
</section>

Attachments

Attachments appear as <div class="attachment"> entries in a <div class="attachments"> container before the <div class="body">. The entry contains:

Binaries themselves are not embedded. See zip-bundle-structure.md for how attachments travel alongside the HTML in ZIP mode.

Code blocks

Claude's code blocks render as:

<pre class="code"><code class="language-{lang}">...</code></pre>

Artifacts

Claude-generated artifacts render as a styled panel:

<aside class="artifact" data-artifact-type="{type}">
  <header>
    <span class="artifact-icon">📄</span>
    <span class="artifact-title">{title}</span>
  </header>
  <div class="artifact-body">
    <!-- For code artifacts: highlighted code block -->
    <!-- For HTML artifacts: iframe with srcdoc -->
    <!-- For SVG artifacts: inline SVG -->
  </div>
</aside>

The artifact panel visually distinguishes itself from regular code blocks so readers can tell "this is a standalone output" at a glance.

Widgets

Claude's show_widget tool calls render in one of two ways:

Free vs paid output

Free-tier HTML exports include a small <footer class="branding"> at the document bottom:

<footer class="branding">
  Exported with
  <a href="https://aichatarchive.app">AI Chat Archive</a>
  · Runs entirely in your browser
</footer>

Paid licenses remove this footer. All other HTML structure is identical.

Security: XSS hardening

Claude conversations can contain user-uploaded content. The HTML export sanitizes every block before embedding it:

Result: opening a malicious exported file can't execute attacker-controlled code, fetch external resources, or track you.

Stability guarantees

Related