# A quantity calculator in a Webflow Code Embed

> Add a free quantity calculator to Webflow with the Code Embed element: plans, the exact clicks, code that fits its height and what to check once published.

Page: https://craftquantities.com/embeds/webflow/ (embed guide). This is the page's Markdown copy; the HTML page is the canonical version.

Webflow's **Code Embed** element puts HTML into the published page, so the frame, the credit line and the script that sizes the frame all work. In the Designer the script is only a placeholder; the calculator comes alive on the published site.

- Code Embed Element
- Runs when published Fitting script
- 50,000 characters Element limit
- Paid site or workspace Plan

**On this page Before you start**

## Before you start

- A paid **Site plan**, or a **Core**, **Growth**, **Agency** or **Freelancer** Workspace; Webflow reserves custom code embeds for them.
- The page open in the Designer, with a container or section where the calculator should sit.
- The site published at least once, to see the result.

## Step by step

1. Open the Add panel

   In the Designer open the **Add** panel and scroll to **Advanced**.
2. Drag in a Code Embed

   Drag **Code Embed** onto the canvas, into the section where the calculator belongs. Its code editor opens.
3. Paste the code

   Paste the code below and click **Save & Close**. The canvas shows the iframe and a placeholder for the script.
4. Let it take the width

   Select the embed and give it, or its parent, a width of 100% so the frame follows the column on every breakpoint.
5. Publish and check

   Click **Publish**, open the live page and type a measurement: the result updates and the frame grows to fit.

## Your code

_Code Embed_

```
<iframe src="https://craftquantities.com/embed/?calc=deck-board-calculator&ev=1&fmt=compact" width="100%" height="460" loading="lazy" style="border:1px solid #e4e4e7;border-radius:12px;max-width:100%" title="Deck Board Calculator — Craft Quantities"></iframe>
<p style="margin:4px 0 0;font:12px/1.4 system-ui,sans-serif">Calculator by <a href="https://craftquantities.com/calculators/renovation-construction/deck-board-calculator/">Craft Quantities</a></p>
<script>(function(){if(window.cqEmbedFit)return;window.cqEmbedFit=1;window.addEventListener("message",function(e){var d=e.data;if(!d||d.source!=="craft-quantities"||d.type!=="size"||typeof d.height!=="number"||!isFinite(d.height))return;var f=document.getElementsByTagName("iframe");for(var i=0;i<f.length;i++){if(f[i].contentWindow!==e.source)continue;var a=document.createElement("a");a.href=f[i].src;if(a.protocol+"//"+a.host!==e.origin)return;f[i].style.height=Math.min(6000,Math.max(200,Math.ceil(d.height)))+"px";return}})})();</script>
```

The frame, the credit line and the fitting script, well under the element's 50,000-character limit.

Every other option is in the [full builder](https://craftquantities.com/embeds/#calculator=deck-board-calculator).

## What visitors see

Your Webflow page · Projects · Decking

Calculator by [Craft Quantities](https://craftquantities.com/calculators/renovation-construction/deck-board-calculator/)

## Checking every breakpoint

Webflow styles the largest breakpoint first and passes those styles down to tablet and the two mobile sizes. A width set in pixels on the desktop view therefore follows the embed to a phone, where it overflows; a width of 100% does not.

Click through each breakpoint in the Designer's top bar with the embed selected. The calculator itself is not drawn on the canvas, so look at the box the embed occupies: full column width, no fixed height, no overflow hidden on its parents.

On the published page the frame stacks its inputs on narrow screens and grows; the fitting script follows it, so no breakpoint needs a height of its own.

## Troubleshooting

**The calculator is not in the Designer**

Expected: Webflow shows scripts as placeholders on the canvas and runs them only on the published site. Publish and check the live page.

**The frame stays at its first height**

Check the site's publishing options: loading JavaScript asynchronously can delay scripts. Or set the iframe's `height` to the size you need.

**The frame is wider than the phone**

The embed or its parent has a fixed width. Set it to 100% at the smaller breakpoints.

**Webflow will not save the embed**

The site's plan does not include custom code. Move to a paid Site plan or a qualifying Workspace.

## Why it helps

- Studios and builders who design in Webflow can add a working estimate tool to a project page without writing one.
- The frame inherits nothing from your styles and changes none of them, so it cannot break the design around it.
- Readers get quantities in metric and imperial, with the method one click away through the credit link.

## Sources

Checked against these help pages on 26 November 2026.

1. [Webflow Help Center: Custom code embed](https://help.webflow.com/hc/en-us/articles/33961332238611-Custom-code-embed)
2. [Webflow University: Custom code embed (video)](https://university.webflow.com/videos/custom-code-embed)
3. [Webflow Help Center: Advanced publishing options](https://help.webflow.com/hc/en-us/articles/33961287288339-Advanced-publishing-options)

On this page

At a glance

**Element**

Code Embed

**Fitting script**

Runs when published

**Element limit**

50,000 characters

**Plan**

Paid site or workspace

Official links

- [The plugin on WordPress.org](https://wordpress.org/plugins/craft-quantities-calculators/)
- [Developer hub](https://craftquantities.com/developers/)
- [Static JSON API](https://craftquantities.com/api/)
- [Remote MCP server](https://craftquantities.com/developers/mcp/)
- [npm package](https://craftquantities.com/developers/npm/)

The one rule

Keep the visible credit line under the frame: it is the one condition of the free embed.

**Open:** the engine’s answers (its JSON API, MCP server and npm package), the data files under /api/v1/ and the formula library (/formulas/) are published under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse them, commercially too, crediting “Craft Quantities” with a link. **Reserved:** the page text, the design and the software, the engine’s code included. [The terms of use](https://craftquantities.com/terms/)

[The terms, in full](https://craftquantities.com/embeds/#terms)

[Home](https://craftquantities.com/)

Embed & integrations

Pages

- [Overview and builder](https://craftquantities.com/embeds/)
- [WordPress plugin](https://craftquantities.com/embeds/wordpress/)
- [Shopify](https://craftquantities.com/embeds/shopify/)
- [Wix](https://craftquantities.com/embeds/wix/)
- [Squarespace](https://craftquantities.com/embeds/squarespace/)
- [Webflow](https://craftquantities.com/embeds/webflow/)
- [Google Sites](https://craftquantities.com/embeds/google-sites/)
- [Blogger](https://craftquantities.com/embeds/blogger/)
- [Any HTML page](https://craftquantities.com/embeds/html/)

Developers & integrations

- [Overview and live call](https://craftquantities.com/developers/)
- [API reference](https://craftquantities.com/developers/api-reference/)
- [Static JSON API](https://craftquantities.com/api/)
- [Remote MCP server](https://craftquantities.com/developers/mcp/)
- [npm package](https://craftquantities.com/developers/npm/)
- [Command line](https://craftquantities.com/developers/cli/)
- [WebMCP in the browser](https://craftquantities.com/developers/webmcp/)
- [Claude and ChatGPT](https://craftquantities.com/ai/)
- [Embeds and WordPress](https://craftquantities.com/embeds/)
- [Browser extension](https://craftquantities.com/tools/browser-extension/)
- [Changelog](https://craftquantities.com/developers/changelog/)
- [Service status](https://craftquantities.com/status/)

On this page

- Before you start
- Step by step
- Your code
- What visitors see
- Checking every breakpoint
- Troubleshooting
- Why it helps
- Sources

---
Source: https://craftquantities.com/embeds/webflow/
Craft Quantities: free to read, cite and link to; the pages are not licensed for republication. Quantities only: no prices, no design and no certification.
