Methodology

Every calculation on Calculator Porch is a small, published formula. The same code runs in your browser and in an automated test suite, and the site can't be deployed unless every test passes. Each calculator's page shows a worked example computed by that same code, so the published numbers always match what the calculator does.

How results are tested

Formulas by calculator

Math

Fraction Calculator

add / subtract:  a/b ± c/d = (a×d ± c×b) / (b×d), then simplifymultiply:        a/b × c/d = (a×c) / (b×d), then simplifydivide:          a/b ÷ c/d = a/b × d/c = (a×d) / (b×c)mixed number:    w n/d = (w×d + n) / dsimplify:        divide top and bottom by their greatest common divisor

Statistics

Random Number Generator

range size        = highest − lowest + 1chance per pick   = 1 ÷ range sizeunbiased draw     = lowest + (random 32-bit value mod range size), redrawing values that would bias the resultno repeats        = draw again whenever a number has already been picked

Standard Deviation Calculator

mean (x̄)               = Σx ÷ npopulation SD (σ)      = √( Σ(x − x̄)² ÷ n )sample SD (s)          = √( Σ(x − x̄)² ÷ (n − 1) )     ← Bessel’s correctionvariance               = SD²

Everyday Life

Day Counter

days      = end date − start date            (+1 if you count the end date)weeks     = floor(days ÷ 7), remainder = days mod 7weekdays  = days that fall Monday–Friday (public holidays not excluded)

Age Calculator

age (years, months) = the most whole calendar months from the birth date that fit before the "age on" dateage (days) = days from that month-anniversary to the "age on" dateadding a month keeps the day of the month, or the last day of a shorter month (Jan 31 + 1 month = Feb 28 or 29)age in days = days between the two dates, counting every February 29 in betweenleap year: divisible by 4, except century years, which must be divisible by 400 (2000 yes, 1900 no)

Construction

Square Footage Calculator

rectangle   = length × widthcircle      = π × (diameter ÷ 2)²triangle    = base × height ÷ 2sq yd = sq ft ÷ 9      sq m = sq ft ÷ 10.7639      acres = sq ft ÷ 43,560

Gravel Calculator

volume (cu ft) = area (sq ft) × depth (in) ÷ 12 × (1 + waste %)cubic yards    = cu ft ÷ 27tons           = cubic yards × weight (tons per cubic yard)bags           = cu ft ÷ 0.5   (rounded up)cost           = tons × price per ton + delivery fee

Finance

Percent Off and Percentage Calculator

savings               = price × percent off ÷ 100sale price            = price − savings = price × (1 − percent off ÷ 100)with tax              = sale price × (1 + tax rate ÷ 100)P% of X               = X × P ÷ 100X is what % of Y      = X ÷ Y × 100X is P% of what       = X × 100 ÷ Ppercentage change     = (new − old) ÷ |old| × 100percentage difference = |a − b| ÷ ((a + b) ÷ 2) × 100

Tip Calculator

tip        = bill × tip % ÷ 100total      = bill + tipper person = total ÷ number of people

3D Printing Cost Calculator

material      = grams ÷ spool grams × spool priceelectricity   = watts ÷ 1000 × hours × (¢/kWh ÷ 100)machine       = hours × (printer price ÷ lifetime hours + maintenance per hour)failure share = run cost ÷ (1 − failure rate) − run costtotal cost    = material + electricity + machine + failure share + labor + extrasprice         = (total cost + fixed fees) ÷ (1 − margin − fee %)

Gold Calculator

price per gram of 24K = rate ÷ grams in the rate unit ÷ (rate karat ÷ 24)price per gram at your karat = price per gram of 24K × karat ÷ 24gold value = gold weight (g) × price per gram at your karatjewellery price = (gold value + wastage + making + other charges) × (1 + tax %)old gold payout = gold value − deduction1 tola = 180 grains = 11.6638 g;  1 tola = 12 masha = 96 ratti;  1 troy ounce = 31.1035 g

Energy & Solar

Solar Panel Calculator

monthly kWh          = units on your bill ÷ days in the billing period × 30.42,                       or bill amount ÷ price per unit (same period),                       or Σ appliances (qty × watts × hours a day) × 30.42 days ÷ 1,000daily need (kWh)     = monthly kWh × 12 ÷ 365 × share to coverkWh per kW per day   = peak sun hours × (1 − losses)system size (kW)     = daily need ÷ kWh per kW per daypanels               = size × 1,000 ÷ panel watts, rounded upyearly output (kWh)  = panels × panel watts ÷ 1,000 × kWh per kW per day × 365panel area (m²)      = system kW ÷ panel efficiencypanels on your roof  = roof area ÷ (panel watts ÷ 1,000 ÷ efficiency), rounded downdarkest-month sizing = daily need ÷ (the lowest monthly sun hours × (1 − losses))battery, backup      = daily use × share kept running × backup hours ÷ 24 ÷ efficiency ÷ depth of dischargebattery, off-grid    = daily use × cloudy days ÷ efficiency ÷ depth of discharge, in whole modulesinverter (kW)        = system kW ÷ 1.2, or your peak load if largeryearly savings       = kWh you use × price + kWh exported × export credittypical cost         = system watts × typical price per watt (+ battery kWh × typical price per kWh, US only)your own prices      = watts × (panels + mounting and labour per watt) + inverter kW × price per kW + battery kWh × price per kWh + otherpayback (years)      = installed cost ÷ yearly savings25-year savings      = Σ yearly savings × (1 − 0.5%)^year, at today's prices

Pets

Dog Pregnancy Calculator

from mating:     due = mating date + 63 days   (normal window: day 56–68)from ovulation:  due = ovulation date + 63 days (window day 62–64)from LH surge:   due = LH surge date + 65 days (window day 64–66)two matings:     window runs from first mating + 56 to last mating + 68

Data sources

Corrections

Found an error? Email contact@calculatorporch.com with the page and the link from “Copy link”. Fixes are logged below with dates. See also the editorial policy.

Changelog

Last updated