MarginCalculator.ioKnow your numbers. Price with confidence.
Free calculators for smarter decisionsExplore tools

Embed a Free Margin Calculator Widget

Embed our free margin and markup calculator on a business, e-commerce, education or accounting website. The widget estimates gross profit, gross margin and markup with simple price and product cost inputs. Visitors do not need to sign in.

Preview the Free Margin Calculator Widget

Copy the Embed Code

Paste the following HTML into a Custom HTML block on your site. The iframe loads the calculator from MarginCalculator.io; it doesn’t run scripts on your hosting account.


Use this code on a site that permits iframe embeds.

Optional attribution: You may link to MarginCalculator.io near the widget if it is useful to your readers. An editorial link is appreciated but not required.

Instructions for WordPress, Shopify and Other Websites

  1. Copy the iframe HTML above.
  2. In WordPress, add a Custom HTML block, paste the code and preview the page.
  3. In Shopify, use a custom HTML-capable section or page editor where iframe embeds are permitted by your theme and platform.
  4. For other CMSs, add the code to an HTML component that allows iframes.
  5. Test on desktop and mobile. If your website’s Content Security Policy or our host blocks third-party frames, the embed may not display; instead link directly to the widget page.

What the Widget Calculates

Gross profit = Selling price − Unit cost. Gross margin = Gross profit ÷ Selling price × 100. Markup = Gross profit ÷ Unit cost × 100. Percentages are undefined at a zero denominator; the widget explicitly displays “Undefined” rather than dividing by zero.

For example, with $50 unit cost and $100 selling price, the widget returns $50.00 gross profit, 50.00% margin and 100.00% markup. These are example values, not real business forecasts.

Accuracy and Limitations

The widget calculates unit-level gross metrics. It does not include sales tax, platform commissions, shipping, ads, refunds, overhead, income tax, or foreign-exchange conversion. For multi-cost scenarios, use our full margin calculator, gross margin calculator, or profit margin calculator.

The widget is provided free for normal use. Do not misrepresent it as tax, accounting or investment advice. JavaScript is needed for recalculation. If an iframe is disallowed by your platform, provide a direct link instead.

Common Questions

Can I embed the calculator without paying?

Yes, it is freely available for editorial and ordinary commercial website use, subject to our website terms.

Does the widget collect form data?

The entered numbers are processed in the visitor’s browser by the widget’s JavaScript. The iframe itself still loads a page from our website, so normal site requests and our Privacy Policy apply.

Can I customize the colors?

Because the iframe is hosted separately, your site’s CSS cannot directly restyle its internal controls. You can set the iframe width and height in the provided snippet.

Why is the iframe blank on my site?

Some website policies block third-party iframes or scripts. Check your platform’s HTML restrictions, browser console, and frame policy, or offer a normal link to the calculator.

Published November 16, 2026. Please test the preview in your actual website environment before distributing it widely.