every model spec’d & versioned · harness ✓ greenchangelog →

Writing · Engineering & integration

Embedding a Verified Calculator With One Script Tag

A div, a script, and a calculator whose math you can cite. What the embed does, what it deliberately does not, and where the attribution lives.

By Worthune Staff · 2026-08-14

The embed is the integration path for teams that want the calculator without the plumbing: no API calls, no response handling, no math on your side — and the verification story rides along inside the frame.

The fastest way to put a verified calculator on a page is two lines of markup: a div naming the model, and the loader script. The script finds every marked div on the page, clears its contents, and mounts an iframe that renders the full calculator — inputs, outputs, charts, and the trust surface: a verification link to the model's spec, the disclaimer, and the attribution badge, all inside the frame.

The whole embed
<div data-worthune-embed="fire" data-height="720" data-input-currentAge="35"></div>  <script async src="https://worthune.com/embed.js"></script>

The div's data-worthune-embed attribute names any model in the catalog. Optional data-height sets the frame height, and data-input-* attributes prefill any of the model's inputs — an editorial page about early retirement can open the FIRE calculator at age 35 instead of a blank form.

What the frame carries so your page does not have to

The embedded calculator runs the same verified surface as worthune.com — a spec-versioned, dual-implementation-verified engine — and the frame links its own spec. That placement is deliberate. The verification link, the disclaimer, and the badge live inside the frame — your page does not need to reproduce them, keep them current, or route compliance review through them, because they update with the frame.

The trade for that simplicity is a boundary worth understanding: the host page does not receive a response envelope. A user interacting with the embedded calculator gets answers rendered inside the frame; the surrounding page is never handed outputs, a spec version, or a record hash to store. Teams that need to store the envelope — because the number feeds a workflow, a document, or an audit trail — should use the API, where every response carries the full audit surface. The embed is for pages that present a calculator; the API is for products that consume answers.

NeedRight surface
A calculator on a marketing or editorial pageEmbed — two lines, trust surface included
Answers your product stores or acts onAPI — full envelope with record.sha256
An assistant that computes mid-conversationMCP — tool calls with the same envelope
All three at onceAll three — the same models and spec versions behind each

Attribution, in plain terms

Embeds are free with attribution, and for the embed the attribution is built in: the badge is part of the frame. There is nothing to add and nothing to style. The pricing page's terms are the contract — keep the badge, and usage is free within the fair-use guideline; attribution-free embeds are a Pro-tier conversation. Removing or obscuring the badge by CSS or frame manipulation is the one way to get an embed integration wrong.

Fit and behavior details

The script is small, loads async, and does nothing until it finds a marked div, so it is safe to include site-wide. Each frame is independent; a page can carry several embeds of different models. Height is your call via data-height — pick a value that fits the model's chart area, check it on mobile widths, and the frame handles its own internal scrolling if content runs long. Because the calculator renders inside an iframe on worthune.com's origin, your page's CSP needs to permit the frame and script sources; that is the whole security-review surface, and it is one line in most policies.

What to check before shipping

The maintenance story

An embedded calculator inherits the platform's maintenance: when a constant moves in the facts registry or a spec version ships, the embedded calculator is already current, and the changelog records what changed. The editorial page you shipped in March is still right in January — which, for content teams, is the entire argument. The alternative — static-calculator decay, tools correct on publish day and quietly wrong by the next tax year — is documented across this library.

Sources

  1. [1] Worthune API documentation, Embeds section. https://worthune.com/docs
  2. [2] Worthune pricing (attribution terms). https://worthune.com/pricing