Embed a calculator

The calculators below can run on your own website in a frame. Copy the code of one into your page, and your visitors get the calculator with its result.

Updated

How to add a calculator

Open a calculator in the list below and copy its code into the HTML of your page, where the calculator should go. The code is an iframe that loads the calculator from this site, then a line with a link to the full calculator page. “Open the widget” shows the calculator as your visitors will see it, and “Dark version” shows it in dark colors.

In the frame, the result updates as visitors type. The code lets the frame use the clipboard, so “Share link” and the copy buttons work there too.

Options

The src address in the code ends with ?theme=light. For a dark page, change it to ?theme=dark; remove it, and the widget follows the light or dark setting of the visitor’s device.

The code makes the frame as wide as your column, up to 720 px, with width="100%" and max-width:720px. Change either value to suit your layout.

The height in the code holds the calculator with a result on a phone screen. When a visitor opens More options, the calculator grows and scrolls inside the frame. To make the frame follow the height of the calculator, add this line once, anywhere in your page:

<script src="https://ruleworth.com/embed.js" async></script>

The script sets the height of each calculator frame on the page to the height of its calculator, and changes nothing else. Paste it as a plain line of HTML, as shown: it does not work when its code is copied into another script. Without it, the frame keeps the height in the code.

If your site sets a Content-Security-Policy that limits frame-src, add the address of this site to it, and to script-src for the height script.

The line under the frame links the site name to the full calculator page, where visitors find how the result is calculated, questions and answers, and sources. The link is optional and nothing requires it: you may remove it or mark it rel="nofollow", and the calculator works the same without it.

The widget has its own line under the calculator, “Powered by Ruleworth”, which links to the full calculator page.

What the widget shows

The widget shows the calculator of the page and nothing else of this site: no ads, no menu, no search, no steps of the calculation and no questions and answers. A cost calculator shows the month of its prices, the same prices as on the full page.

“Share link” copies the address of the full calculator page with the visitor’s numbers, not the address of the widget, and a printed estimate names that page too. Every link in the widget opens in a new tab.

The widget counts its page views with the same analytics tag as this site; the privacy policy describes what it collects.

Calculators you can embed

Concrete

Drywall

Insulation

Roofing

Masonry

Measurements