Building an epoxy resin calculator sounds simple until you realize the math under the hood spans geometry, unit systems, waste modeling, mix-ratio arithmetic, and multi-layer scheduling. In this post we walk through each calculation and ship 3 short JavaScript functions that power Epoxy Planner, a web tool that turns project dimensions into part quantities. For the full accounting of where every constant comes from, see the methodology page.
1. Volume of the pour
Most pourable epoxies conform to the shape of their container, so the calculator starts by computing volume in cubic inches and later converts to fluid units. Three primitives cover the vast majority of projects.
A rectangular slab (river table, countertop, tray) is length × width × depth. A cylinder (a round table top, a tumbler, a column) is π × r² × height. A sphere (a decorative paperweight, a dome cap) is 4/3 × π × r³.
When a project combines shapes — a rectangular slab with a cylindrical inlay — the calculator sums the primitives. Here is a shape-agnostic volume() that accepts the shape tag and the dimensions the UI collected:
function volume(shape, dims) {
if (shape === 'rect') {
return dims.length * dims.width * dims.depth;
}
if (shape === 'cylinder') {
return Math.PI * dims.radius * dims.radius * dims.height;
}
if (shape === 'sphere') {
return (4 / 3) * Math.PI * Math.pow(dims.radius, 3);
}
return 0;
}
All dimensions are expected in inches at this stage so every primitive returns cubic inches.
2. Unit conversions
Customers rarely think in cubic inches. The calculator converts to the units they buy resin in. The constants below are what the methodology page publishes.
- 1 US gallon = 231 cubic inches (exact by US definition)
- 1 liter = 61.024 cubic inches
- 1 cubic inch ≈ 16.387 milliliters
A small converter keeps the units tractable:
const CU_IN_PER_US_GAL = 231;
const CU_IN_PER_LITER = 61.024;
const ML_PER_CU_IN = 16.387;
function convertVolume(cuIn, to) {
if (to === 'us_gal') return cuIn / CU_IN_PER_US_GAL;
if (to === 'liter') return cuIn / CU_IN_PER_LITER;
if (to === 'ml') return cuIn * ML_PER_CU_IN;
return cuIn;
}
The to argument mirrors the unit selector in the UI. If a user asks for 2.4 liters of a rectangular 12 × 18 × 0.75" slab, volume() produces 162 cu in, convertVolume(162, 'liter') yields ≈ 2.655 L, and the UI rounds up to the nearest available container size.
3. Waste factor and seepage
Real pours consume more resin than the raw volume. Two separate effects are modeled.
A waste factor (typically 5–15%) accounts for pour loss, mixing-container residue, surface cleanup, and the fact that mixing two parts inevitably leaves a small film in each cup. It is applied as a multiplicative factor: total × (1 + waste).
Seepage applies only to porous substrates — raw wood, concrete, green marble — where the substrate soaks up a thin layer of resin. Seepage is modeled as a volume proportional to the exposed surface area times a seepage depth (commonly 0.02–0.05"). A 24 × 36" wood slab with 0.03" seepage on both faces absorbs roughly 2 × 24 × 36 × 0.03 = 51.84 cu in on top of the pour volume.
Both adjustments are additive to the base volume before Part A/B splitting, so the ratio math stays clean.
4. Splitting Part A and Part B by ratio
Most epoxies are two-part systems mixed by volume ratio. 1:1 is the easiest (equal parts resin and hardener). 2:1 is common in cast/resin kits (two parts resin to one part hardener).
Given a total volume V and a ratio expressed as resinParts : hardenerParts, the split is:
A = V × resinParts / (resinParts + hardenerParts)
B = V × hardenerParts / (resinParts + hardenerParts)
In JavaScript:
function splitByRatio(totalVolume, resinParts, hardenerParts) {
const sum = resinParts + hardenerParts;
const partA = totalVolume * resinParts / sum;
const partB = totalVolume * hardenerParts / sum;
return { partA, partB, ratio: `${resinParts}:${hardenerParts}` };
}
// 1:1 example
splitByRatio(100, 1, 1); // { partA: 50, partB: 50, ratio: '1:1' }
// 2:1 example (two parts resin, one part hardener)
splitByRatio(100, 2, 1); // { partA: 66.67, partB: 33.33, ratio: '2:1' }
After the split, each part's volume is converted to the user's chosen unit and rounded up to the nearest container the supplier sells. That is where many DIY calculators over-order — they round the total once and split, instead of splitting then rounding each component.
5. Splitting deep pours into lifts
Epoxy cures exothermically. Cast pours deeper than the manufacturer's maximum layer depth can crack, yellow, or delaminate, so thick pieces are built in lifts (also called layers or coats).
If a slab needs 3" of depth and the resin's max layer depth is 1", the calculator computes:
liftCount = ceil(totalDepth / maxLayerDepth)
layerDepth = totalDepth / liftCount
The layer volume for each lift is footprintArea × layerDepth. The per-lift volume is what gets passed into waste + ratio + unit conversion, then multiplied by liftCount to arrive at the project total.
This matters for two reasons. First, the calculator can tell the builder how many pours they're scheduling. Second, waste is typically quoted per-pour (each new mix event leaves residue in fresh cups), so modeling waste per lift rather than once on the whole depth usually yields a higher and more realistic total.
Putting it together
A real calculator chains these steps:
- Sum volumes across every shape the user added (via
volume()). - Add seepage volume if the substrate is porous.
- Apply the waste factor to the subtotal.
- Split into Part A and Part B via
splitByRatio(). - If the depth exceeds the max layer depth, recompute per-lift volume, apply waste per lift, split per lift, then multiply by
liftCount. - Convert each part to the desired unit via
convertVolume()and round up to sellable containers.
That pipeline is exactly what Epoxy Planner runs client-side. If you want the constants, assumptions, and edge cases in writing, the methodology page documents every factor.
For developers who want to drop this into an existing project instead of copying the functions above, the same math is packaged as epoxy-planner on npm — npm install epoxy-planner — with a stable surface that exposes the shape volumes, unit conversion table, ratio splitter, and lift scheduler as plain functions.
Summary
An epoxy calculator is small on the surface and surprisingly deep under it: elementary geometry for the pour, exact and approximate constants for unit conversion, an additive waste/seepage model, proportional split arithmetic for Part A/B, and a ceiling division to turn a deep pour into schedulable lifts. The three functions in this post — volume, convertVolume, and splitByRatio — cover the core. Try them on your next pour, or grab the npm package if you'd rather not re-derive the constants yourself.
Top comments (0)