Embed the AspectCalc Calculator on Your Website

Give your readers a free, live aspect ratio calculator without building one. Paste a single line of code, and every embed links back to AspectCalc with a 'Powered by AspectCalc' credit.

The widget is the same calculator that runs on this site, so the numbers your readers see match what they would get here. It needs JavaScript and an internet connection, and it drops into any standard iframe.

Why embed it

A calculator answers the question your readers already have. Instead of sending them away to work out a ratio, they do it right where they are reading - and the widget asks nothing of you in return.

  • Free and lightweight. One small iframe, no script to host, no dependency to maintain.
  • No ads on your pages. The embed stays clean; the only addition is a short credit line linking back to AspectCalc.
  • Answers the question on the page. Instead of sending readers away to calculate a ratio, they do it right where they are reading.
  • Predictable height. The frame is sized up front, so your layout never shifts. Keep the optional script in the snippet if you would rather the frame track the widget's real height.
  • Works on mobile. The widget is built responsive, so it stays usable at the narrow widths of a phone column.
  • Accessible. Inputs are labelled and the result is announced to screen readers, the same as on this site.

How to embed in three steps

  1. Copy the snippet below.
  2. Paste it into the HTML of any page or post where you want the calculator to appear.
  3. Save and view. The calculator loads immediately - no setup, no account.
<div class="aspectcalc-embed" style="max-width:100%">
  <iframe id="aspectcalc-frame" src="https://aspectcalc.com/embed?h=640"
          width="100%" height="700" style="border:0;border-radius:12px"
          loading="lazy" title="AspectCalc aspect ratio calculator"></iframe>
  <p style="margin:8px 0 0;font:13px/1.4 system-ui,sans-serif;color:#64748b;text-align:center">Powered by <a href="https://aspectcalc.com/" style="color:#2563eb;text-decoration:none">AspectCalc</a> - free aspect ratio calculator</p>
</div>
<script>
  // Optional: grow the frame to the widget's real height.
  // Delete this whole block to keep a fixed-height frame instead.
  addEventListener('message', function (e) {
    if (e.origin !== 'https://aspectcalc.com') return;
    if (!e.data || e.data.type !== 'aspectcalc-height') return;
    var f = document.getElementById('aspectcalc-frame');
    if (f) f.style.height = e.data.height + 'px';
  });
</script>

Prefer to see it first? Open the live embed demo.

Set the height

The snippet's frame starts at height="700" with ?h=640 in the source. ?h= caps the widget's own scroll area in pixels; the frame height is the space your page reserves for it. Change ?h= to make the widget shorter or taller - for example https://aspectcalc.com/embed?h=520. Width is controlled by your own CSS (the snippet uses width="100%" so it fills its container).

Optional: exact-fit height. The snippet ends with a small script that listens for the widget's aspectcalc-height message (after checking the message comes from https://aspectcalc.com) and sets the frame to the exact height. Keep it if you want the frame to always fit with no inner scrollbar; delete it if you would rather pin one fixed height and never have the frame move.

If you want a different look, wrap the iframe in a <div> and style that wrapper - rounded corners, a border, a max-width, anything that fits your page. The widget inside keeps working regardless of how you present the frame around it.

Embedding FAQ

Is the embed really free?

Yes. There is no account, API key, or fee, and nothing is served from the embed except the calculator itself. Paste the snippet and it works.

Does the embedded calculator show ads?

No. The embed stays ad-free on your pages. The only thing it adds is a short 'Powered by AspectCalc' line that links back to this site.

Can I change the size or height?

Yes. Add ?h= to the source URL - for example /embed?h=640 - to set the iframe height in pixels. Width is yours to control with CSS.

Will it match my site's styling?

The widget ships its own minimal styles so it looks consistent everywhere it appears. You control the frame's width and height with the iframe attributes and your own CSS wrapper, so it sits naturally inside your layout.