Embeds

No key, no quota

Put a calculator on your own page

Any of the 1,151 calculators here can run inside your page. It is free, there is no key and no quota, and the maths is the same code this site runs — not a cut-down copy that drifts.

  • 1,151Calculators to choose from
  • 3Themes
  • 3Starting widths

Build your snippet

1,151 calculators

Theme
Units
Width

The height is only the starting size — what a host sees before any script runs. The frame measures itself and posts its real height; with automatic fitting on, the snippet applies it. The fit button above is this page reading that same message.

Your snippet

<iframe src="https://craftquantities.com/embed/?calc=concrete-calculator" width="100%" height="900" loading="lazy" style="border:1px solid #e4e4e7;border-radius:12px;max-width:100%" title="Concrete Calculator — Craft Quantities"></iframe>
<p style="margin:4px 0 0;font:12px/1.4 system-ui,sans-serif">Calculator by <a href="https://craftquantities.com/calculators/materials-quantities/concrete-calculator/">Craft Quantities</a></p>

Paste it where the calculator should appear. The second line is the credit link the terms below ask you to keep.

Live preview

The real frame, from the real address — not a mock-up.

Waiting for the frame to report its height…

Reading the result from your page

The frame posts every recompute to your page. This is what makes it worth wiring into a quote form rather than just dropping on a blog post.

ready
— posted once, with the calculator’s slug, title and canonical URL.
result
— posted on every recompute, with the unrounded value, its unit and the breakdown lines where the calculator produces them.
size
— posted whenever the frame’s height changes.

The channel is one-way. The frame posts and never acts on what it receives, because it is embedded on pages this site has never heard of and so has no origin to validate a sender against. Check event.source against your frame’s contentWindow in your listener: a page’s window is a shared bus, and analytics, chat widgets and video players all post into it — any of them could spell source the same way.

Your page’s listener

const frame = document.querySelector("#cq-frame");

window.addEventListener("message", (event) => {
  // Only this frame's window, and only a message of ours.
  if (event.source !== frame.contentWindow) return;
  if (event.data?.source !== "craft-quantities") return;

  if (event.data.type === "result") {
    // A number: set it as a value, never as HTML.
    document.querySelector("#quantity").value = event.data.value;
  }

  if (event.data.type === "size" && Number.isFinite(event.data.height)) {
    frame.style.height = Math.ceil(event.data.height) + "px";
  }
});

Every message is an object with source: "craft-quantities", version: 1, type and slug. A size message adds height, in CSS pixels; a result adds value, unit and, where there is one, breakdown. The builder’s fitting script is this check, ready-made, for every frame on the page at once:

<script>(function(){if(window.cqEmbedFit)return;window.cqEmbedFit=1;window.addEventListener("message",function(e){var d=e.data;if(!d||d.source!=="craft-quantities"||d.type!=="size"||typeof d.height!=="number"||!isFinite(d.height))return;var f=document.getElementsByTagName("iframe");for(var i=0;i<f.length;i++){if(f[i].contentWindow!==e.source)continue;var a=document.createElement("a");a.href=f[i].src;if(a.protocol+"//"+a.host!==e.origin)return;f[i].style.height=Math.min(6000,Math.max(200,Math.ceil(d.height)))+"px";return}})})();</script>

The terms, in full

  • Free, commercial use included.

    No key, no quota, no tracking of who embeds what.

  • The attribution link stays.

    Every frame carries one visible link back to the full calculator. It is the whole reason this is free; removing or hiding it is the one thing that is not allowed.

  • It is a calculator, not advice.

    The frame carries the same estimate disclaimer the full page does. Do not present a result as a specification.

  • Nothing is sent anywhere.

    The frame computes in the reader’s browser. Your readers’ inputs do not reach this site or anyone else.

Prefer to work with the data directly? There is a free static JSON API