WordPress

How to add a calculator to WordPress without a plugin

A Custom HTML block and the embed code are all it takes. Here are the steps for the block editor, the classic editor and page builders, the user role that can quietly remove the calculator, and the WordPress.com plan rule.

WideMath teamPublished 14 October 20265 min read

Search the WordPress plugin directory for "calculator" and you will find plenty of options. For a standard calculator, such as a scientific, graphing, statistics or unit calculator, you do not need any of them. WordPress can show a calculator widget with the Custom HTML block it already has, and nothing new gets installed on your site.

On this page

  1. Plugin or embed?
  2. Block editor: the Custom HTML block
  3. Classic editor: the Text tab
  4. Elementor, Divi and other page builders
  5. If the calculator disappears after saving
  6. WordPress.com: the plan rule
  7. Size, sidebars and security headers
  8. Questions people ask

Plugin or embed?

A calculator plugin runs on your server. It needs updates, adds settings pages and can load its scripts on pages where no calculator appears. An embed is a frame that loads the calculator from another site, only on the page where you paste it, and the provider maintains it.

Plugins still have a place. If you need a calculator built around your own formula, such as a price quote that sends leads to your inbox, a form-builder plugin is the right tool. For a ready-made maths, science or finance calculator, an embed is less work and less to maintain.

Block editor: the Custom HTML block

These steps follow the WordPress.org Custom HTML block documentation.

  1. In the calculator widget gallery, press Copy code on a calculator, or open its own page to change the size first.
  2. Open the post or page in the editor. Click the Block Inserter (the + button) and choose Custom HTML, or type /html on a new line and press Enter.
  3. Click Edit HTML, paste the code, and check the preview that appears to the right of the code. Click Update.
  4. Save or publish the post, then open it on the front end to check the calculator.

The Edit HTML button arrived with WordPress 7.0. On earlier versions you paste straight into the block and use Preview in the block toolbar to see the result.

This is the code for the Statistics Calculator, exactly as the widget gallery gives it:

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

The iframe loads the calculator from widemath.com/embed/, a page made for frames with no menus and no ads. The p line under it is a credit with a link to the full tool. Please keep it; it is the only thing we ask in return for the free widget.

Classic editor: the Text tab

Sites that use the Classic Editor have two tabs above the right side of the editing area, Visual and Text. The WordPress.org classic editor guide explains that Text mode shows you the code.

  1. Click the Text tab.
  2. Paste the embed code on its own line where the calculator should appear.
  3. Click Update or Publish.

Avoid switching back and forth between Visual and Text after pasting. WordPress's own user manual warns that switching views can lose some HTML.

Elementor, Divi and other page builders

If the calculator disappears after saving

WordPress removes iframe tags from content saved by users who lack a permission called unfiltered_html. According to the WordPress roles and capabilities documentation:

The fix is to have an Editor or Administrator (on Multisite, a Super Admin) paste the code once the author has finished. If an Author saves the post again later, the frame is stripped again.

WordPress.com: the plan rule

On WordPress.com the steps are the same: add a Custom HTML block, click Edit HTML, paste, then Update. Whether the frame survives depends on the plan. The WordPress.com Custom HTML block page says that to add tags like iframe "you will need a paid plan with hosting features activated".

WordPress.com has changed its plans and wording several times, so check those two support pages if your plan behaves differently.

Size, sidebars and security headers

Other platforms, from Google Sites to Squarespace, are covered in the complete guide to adding a calculator to your website. Running a class blog? Pick a calculator by subject in free calculator widgets for teachers.

Get a calculator for your WordPress site

24 free widgets, no plugin, no ads inside the frame.

Open the calculator widgets →

Questions people ask

Do I need a plugin to add a calculator to WordPress?

No. For a standard calculator, paste the embed code into a Custom HTML block in the block editor, or into the Text tab of the classic editor. Nothing is installed on your site.

Why did my calculator disappear after I saved the post?

WordPress strips iframes from content saved by users without the unfiltered_html permission. On a single site only Administrators and Editors have it, and on Multisite only Super Admins. Ask one of them to paste the code.

Does the calculator embed work on WordPress.com?

Only on a paid plan with hosting features activated. On the Free plan, WordPress.com removes iframes, so link to the calculator page instead.

Will an embedded calculator slow down my WordPress site?

Very little. The calculator loads from widemath.com in its own frame, only on the page where you paste it, and the loading="lazy" attribute delays it until a reader scrolls near it.

Can I put a calculator in my WordPress sidebar?

Yes. Add a Custom HTML block to the widget area and paste the code. The scientific calculator suits a sidebar best because it is at most 460 px wide.

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].