Embedding, the robust way

Five ways to drop a calculator into a page

By A. Ledger ยท 5 min read

The script embed (<instacalc>) is elegant, but the iframe embed is the bulletproof one: it runs the whole calc sandboxed on instacalc.com, so there's no shared JavaScript and nothing to break on your side. Here's the full range of iframe URLs you can point at.

1. A saved calc, by ID

The canonical form is /embed/<id>. This loads a stored calc โ€” the same image "Copy embed code" gives you:

/embed/59699 โ€” a saved calc by ID

2. A blank calculator

Point an iframe at bare /embed/ to drop a fresh, empty calculator into your page โ€” handy when you want readers to type their own math from scratch:

/embed/ โ€” a blank embed calc

3. A formula, defined entirely in the URL

No saved calc needed โ€” put the math in the URL after /embed/=. This one computes a 30-year mortgage payment on a $400k loan at 6.5%:

/embed/=400000*(0.065/12)/(1-(1+0.065/12)^-360)

4. A quick one-liner

The URL-defined form is great for tiny, self-explanatory calcs. Annual coffee spend, inline:

/embed/=5.25*5*52

5. The legacy suffix form (still works forever)

Old embeds in the wild use /<id>/embed. That's a permanent redirect to the canonical /embed/<id>, so historical iframes keep resolving:

/59699/embed โ€” legacy suffix form (308 โ†’ /embed/59699)

Every iframe above runs the calc on instacalc.com and computes live โ€” they're the most robust embed path. The inline <instacalc> script embed (see the mortgage post) is lighter-weight but relies on loading the engine into your page.

Sizing tip: the iframe doesn't scroll โ€” it shows exactly its height, so set one tall enough for all the calc's rows (a 12-row calc needs ~680px; a one-liner ~220px). Pick the height to fit the calc you're embedding.