HTML to JSON

Paste HTML, get a structured JSON outline, clean Markdown, or plain text — in your browser. Optional AI extraction into your own JSON schema.

published

  • [FREE]
  • [NO_SIGNUP]
  • [ON-DEVICE]
  • [OPTIONAL CLOUD AI]

Turn HTML into structured JSON, clean Markdown, or plain text — instantly, in your browser. Paste the markup and get a JSON outline of the document (title, headings, links), a Markdown version, and the tag-free text. Nothing is uploaded; it runs entirely on your machine.

How it works (and why nothing is uploaded)

The tool strips scripts, styles, and comments, then reconstructs structure from the remaining markup: headings become ## headings, list items become bullets, <a> tags become [text](href) links, and block elements become paragraph breaks. The JSON tab gives you a machine-readable outline:

{
  "title": "…",
  "description": "…",
  "headings": [{ "level": 1, "text": "…" }],
  "links": [{ "text": "…", "href": "…" }],
  "text": "…"
}

All of this is computed with plain string transforms in the browser — no server, no upload, no account, no storage. It’s heuristic rather than a full browser render, so it’s reliable on articles, documentation, marketing pages, and emails, and approximate on deeply nested or malformed markup.

Optional: extract typed JSON by your own schema (AI)

Sometimes you don’t want the whole outline — you want specific fields: a product’s name and price, an invoice’s totals, an article’s author and tags. Provide a JSON Schema and an on-device-optional Cloudflare Workers AI model fills it from the content. This is the one step that leaves your device: it’s clearly labeled, sent same-origin to our own endpoint, not stored, and costs 5 credits per call (free daily allowance first, then an optional no-signup credit key). For fully private, $0 work, stay on the JSON / Markdown / Text tabs.

Doing this at scale — the developer API

The schema extraction is also a no-account, pay-per-call API, built for scripts and AI agents:

curl -X POST https://bytefork.tools/api/extract \
  -H "content-type: application/json" \
  -H "x-credit-key: bfk_…" \
  -d '{ "html": "<h1>Widget</h1><p>$9.99</p>", "schema": { "type": "object", "properties": { "name": { "type": "string" }, "price": { "type": "string" } } } }'

You pay with a credit key like an API key — no signup, no subscription. See the developer API.

Frequently asked questions

Is my HTML uploaded anywhere?

No — the JSON outline, Markdown, and text are all computed locally in your browser, so the HTML never leaves your device. You can confirm in DevTools → Network: pasting and switching tabs produces no requests. The one exception is the optional "Extract typed JSON by schema (AI)" step, which is clearly labeled and only runs when you click it — that sends the content to our own same-origin AI endpoint (not stored, no third party).

What is the difference between the JSON, Markdown, and Text tabs?

JSON gives a structured outline of the document — its title, meta description, every heading (with level), and every link (text + href) — ready to process in code. Markdown gives readable text with headings, lists, links, and emphasis reconstructed from the markup. Text is the plain, tag-free content. All three are heuristic (regex over the markup, not a full browser render), so they are reliable on articles, docs, and emails and approximate on deeply nested pages.

What does the AI schema extraction do?

You provide a JSON Schema (an object with the fields you want) and a Cloudflare Workers AI model fills those fields from the pasted content — for example pulling a product's name and price, or an article's title, author, and tags, out of messy HTML. It is instructed to use only values present in the content and return null for anything missing, then the result is validated as an object before any credit is charged. It costs 5 credits per call: your free daily allowance is spent first, then an optional no-signup credit key.

Can I use this on a live URL?

This tool works on HTML (or text) you paste in. It deliberately does not fetch URLs for you — many pages render their content with JavaScript or block server fetches, which a paste-in tool sidesteps entirely and keeps it fully private and free. Copy a page's source (or your fetched HTML) into the box.

Is there an API for scripts and AI agents?

Yes. The same schema extraction is a no-account, pay-per-call API: POST application/json to /api/extract with { html | text, schema } and an x-credit-key header, and you get typed JSON back. It is built for programs and AI agents — you pay with a credit key like an API key, no signup. See the developer API.