Complete guide

How to add a calculator to your website: every route, and the fastest one

There are four ways to put a working calculator on a web page. This guide compares them honestly, explains the embed code line by line, and gives the steps for WordPress, Google Sites, Canvas, Moodle, Blogger, Wix, Squarespace and Notion.

WideMath teamPublished 14 October 20268 min read

You run a class site, a blog or a business website, and your readers need to calculate something: a quadratic, a standard deviation, a dilution, a subnet. You could send them to another site, but they may not come back. Putting the calculator on your own page keeps them where your explanation is. We build the free WideMath calculators, and we wrote this guide to cover every route, including the ones that do not involve us.

On this page

  1. Four ways to add a calculator
  2. Why an embed is usually the fastest
  3. The embed code, line by line
  4. Sizing, and how it looks on phones
  5. Speed
  6. Accessibility
  7. Privacy and ads
  8. Steps for each platform
  9. Opening a ready-made problem
  10. If you decide to build your own
  11. Questions people ask

Four ways to add a calculator

RouteTime to set upWho maintains itBest for
Embed a ready-made widgetMinutesThe providerStandard calculators: scientific, graphing, statistics, unit conversion
Copy and paste codeAn hour or more, with testingYouA very small calculator with one formula
A plugin or appAn hour or soYou, through updatesBusiness calculators around your own formula, such as quotes that collect leads
Build your ownDays to monthsYouWhen the calculator is your product

Embedding means pasting a small piece of code that shows someone else's calculator in a frame on your page. Copy-paste code means HTML and JavaScript from a tutorial that you host yourself; it is quick to paste and slow to trust, because you now own every bug in it. Plugins and apps (WordPress plugins, Wix apps) suit calculators built around your own numbers. Building your own gives full control and costs the most time.

Why an embed is usually the fastest

The trade-offs are real. You depend on the provider staying online, you cannot restyle what is inside the frame, and the frame has a fixed height that you set. For a standard calculator those costs are small. For a calculator that must match your brand exactly or use your own formula, a plugin or your own code is the better route.

The embed code, line by line

This is the code for the WideMath Scientific Calculator, exactly as the calculator widget gallery hands it out. Every one of our 24 widgets uses the same pattern.

<iframe src="https://widemath.com/embed/scientific-calculator/" title="Scientific Calculator by WideMath" width="100%" height="760" style="border:0;max-width:460px" loading="lazy" allow="clipboard-write; fullscreen"></iframe>
<p style="margin:6px 0 0;font:14px/1.4 sans-serif"><a href="https://widemath.com/scientific-calculator/">Scientific Calculator</a> by WideMath</p>

Sizing, and how it looks on phones

Because the width is 100% with a maximum, the frame shrinks on a phone and stops at a sensible width on a laptop. Only the height needs thought. These are the defaults for some popular widgets; the calculator widget gallery lists all 24, and each widget has its own page with a live preview and a size picker.

WidgetHeightMax width
Scientific calculator760 px460 px
Graphing calculator600 px1100 px
Matrix calculator720 px960 px
Statistics calculator820 px960 px
Unit converter1040 px960 px
TI-36X Pro style calculator1000 px480 px

Speed

A frame loads as its own document, separate from your page's HTML. With loading="lazy", which current versions of the major browsers support for iframes (see MDN's iframe reference), a calculator further down the page costs almost nothing until the reader scrolls near it. Two habits keep pages fast: place the calculator after your opening text rather than at the very top, and use one or two widgets per page rather than ten.

Accessibility

The title attribute is what a screen reader announces when it reaches the frame; the W3C describes this as technique H64 for WCAG. Keep it, and add one sentence above the frame saying what the calculator is for. The credit link and the "Open on WideMath" link inside the widget's top bar give readers who zoom or use magnifiers a way to open the full page in its own tab.

Privacy and ads

The calculations run in your reader's browser. We count how often widgets load with Google Analytics, as described in our privacy policy. WideMath shows Google AdSense ads on widemath.com itself, which pay for the free tools, but the embedded widgets carry no ads. If your own privacy notice lists third-party services, add WideMath to it.

Steps for each platform

First press Copy code on a calculator in the widget gallery. Then:

Google Sites

  1. Click Insert, then Embed, then the Embed code tab.
  2. Paste, click Next, then Insert, resize the box and Publish.

Source: Google Sites help. Full guide: embed a calculator in Google Sites.

WordPress (self-hosted)

  1. Add a Custom HTML block (type /html), click Edit HTML on WordPress 7.0 or later, paste and click Update.
  2. In the classic editor, paste into the Text tab.

Only Administrators and Editors (Super Admins on Multisite) can save iframes. Source: WordPress.org documentation. Full guide: add a calculator to WordPress.

WordPress.com

Same Custom HTML block, but iframes need a paid plan with hosting features activated; the Free plan removes them. Source: WordPress.com support.

Canvas

In the Rich Content Editor, click the HTML Editor icon, paste and Save. Canvas keeps every attribute the code uses. Source: Canvas Instructor Guide. Full guide: embed a calculator in Canvas or Moodle.

Moodle

Add a Page or a Text and media area, open View source code in the editor, paste and save. Moodle strips iframes in forums, wikis and other activities every student can post in, and an administrator's settings can strip them elsewhere. Source: MoodleDocs.

Blogger

In the post editor, click HTML at the top left, paste the code where the calculator should go, and publish. Source: Blogger help.

Wix

In the Wix Editor, click Add Elements, Embed Code, Popular Embeds, then Embed HTML. Click Enter Code, paste and click Apply, then drag the element to size. In Wix Studio the path is Add Elements, Embed & Social, Embed Code. Sources: Wix Editor help, Wix Studio help.

Squarespace

Edit the page, click Add block and choose Code. Paste, make sure the mode is HTML and Display Source is off. Squarespace's help says iframes in code blocks need the Core, Plus or Advanced plan, and code sometimes does not show while you are logged in; check with Preview in Safe Mode. Source: Squarespace help.

Notion

Notion takes a web address, not HTML. Type /embed, paste only the address from inside src="...", for example https://widemath.com/embed/scientific-calculator/, and resize by dragging the bars at the sides. Notion drops the credit line, so add a normal link to the tool under the embed. Source: Notion help.

Teachers choosing between subjects can start with free calculator widgets for teachers.

Opening a ready-made problem

The graphing calculators can open with your own equations. Press Share on the full tool, then add the part of the link that starts with #e= to the end of the embed address. Readers see your graph first and can change it. The steps and a tested example are in how to embed a graphing calculator.

If you decide to build your own

If that list sounds like more than you want to maintain, the scientific calculator widget has already been through those tests.

Add a calculator to your website

24 free widgets, a live preview and a size picker. No sign-up, no ads inside the frame.

Open the calculator widgets →

Questions people ask

How do I add a calculator to my website for free?

Copy the embed code for a free calculator widget and paste it where your site accepts HTML: a Custom HTML block in WordPress, the Embed code tab in Google Sites, or the HTML view of your editor. WideMath widgets are free for any site, with no account.

Do I need to know how to code to add a calculator?

No. Embedding is copy and paste. The only number you may change is the height, if part of the calculator is cut off on your page.

Will an embedded calculator slow down my website?

Very little. The frame loads as a separate document, and loading="lazy" delays it until the reader scrolls near it. Keep to one or two calculators per page.

Is an embedded calculator bad for SEO?

No, but the frame's content belongs to the calculator's site, not yours. Write your own text around it explaining what the calculator is for. WideMath's embed pages are marked noindex, so they do not compete with your page in search.

Can I change the colours of the calculator widget?

Not inside the frame: a page cannot style a frame that comes from another website. The credit line under the frame uses your page's own link colour.

Can I remove the credit line under the widget?

Please keep it. The widgets are free because that small link brings people to the full tools. It is one short line under the frame.

WideMath team

The people who build WideMath

WideMath is made by three people in Nepal: Anuj Paudel, Ashish Pandey and Jhalak Prasad Pandey. We build the calculators, the widgets and these guides, and we test every embed on a real page before we write about it. Questions about the widgets go to [email protected].