MegaCalc Methodology
How we build and maintain 1,021 engineering, math, finance, science and everyday calculators, which of them are tested against worked examples, published tables or reference software, and to what tolerances. Transparency about our sources and checks is fundamental to the trust you place in our tools.
Methodology architected and reviewed by Christopher Floied, BSME, founder of MegaCalc. This page explains how the calculators and unit conversions on the site are built and checked, and where those checks stop.
Last reviewed: · This page is regenerated whenever any source file under frontend/src/ is modified.
Source Hierarchy
When the same value (a unit conversion factor, a fundamental constant, a formula coefficient) appears in multiple references, MegaCalc follows a strict order of precedence. The higher-tier source always wins; lower-tier sources are used only when the higher tier doesn’t address the question. This ordering is the one Google Quality Raters and academic researchers expect, and it is how we decide between sources that disagree.
- 1Primary metrology bodies (top tier)BIPM SI Brochure (the international SI standard) and NIST SP 811 (the US guide to the SI). Every base unit definition, derived-unit definition, and exact-conversion-factor used across the site is traceable to these documents.
- 2International standards (second tier)ISO 80000 series (Quantities and Units), IEEE 260.1 (Letter Symbols), and IUPAC Gold Book (chemistry nomenclature). Use when (1) addresses a unit or quantity not covered by tier 1, or when (1) describes the unit but not the symbol/notation we should publish.
- 3Domain-specific consensus standards (third tier)ASME (mechanical), ASTM (materials & testing), API (oil-and-gas), AISC (structural steel), ACI (concrete), ASCE (loads), ASHRAE (HVAC), NFPA (fire), IAPWS-IF97 (steam), USP / EP / JP (pharmacopoeial), ICAO (aviation). Used for industry-specific defaults, allowable ranges, and worked-example values that primary-metrology sources don’t address.
- 4Peer-reviewed academic textbooks (fourth tier)Marks’ Handbook for ME, Perry’s for ChemE, Roark’s for stress and strain, Shigley’s for machine design, Hibbeler for statics / dynamics / mechanics of materials, Çengel for thermo / fluid / heat transfer, Incropera & DeWitt for heat transfer, Anderson & Bertin/Cummings for aerodynamics. Used for worked examples, derivations, and the way a topic is conventionally taught.
- 5Government statistical agencies (fifth tier)USGS (geological / hydrological), NOAA (meteorological), EIA (energy), IRS (US tax tables), Bureau of Labor Statistics (cost-of-living inputs), Bureau of Reclamation (water resources). Used for reference values and statistical inputs in finance / ecology / construction calculators.
Our Sources
We take formulas and reference values from published sources: for each calculator type, we identify the governing equations from at least one canonical reference and cross-check against a second source where we can. Where a calculator page lists its references, they are the place to check what it uses. A few reference tables (for example, the flash-point and metal-property tables) do not yet name the source of each value. Our primary references include:
- •Engineering handbooks: Marks' Standard Handbook for Mechanical Engineers, Perry's Chemical Engineers' Handbook, Roark's Formulas for Stress and Strain, Shigley's Mechanical Engineering Design.
- •Published standards: ASME Boiler and Pressure Vessel Code, ASTM material standards, API piping standards, ISO measurement and manufacturing standards, ASHRAE HVAC guidelines, NFPA fire safety codes.
- •Reference data: NIST fundamental constants, IAPWS-IF97 steam properties, reference equations of state for refrigerants (R-134a, R-410A, ammonia) evaluated with coefficients from the open-source CoolProp library, NIST-JANAF thermochemical tables.
- •Peer-reviewed textbooks: Hibbeler (Statics, Dynamics, Mechanics of Materials), Cengel (Thermodynamics, Fluid Mechanics, Heat Transfer), Çengel & Boles, Incropera & DeWitt, Crandall & Dahl, Shames, Budynas & Nisbett, Norton.
- •Government and scientific agencies: NIST (US metrology), BIPM (international metrology), USGS (geological), NOAA (meteorological), IRS and financial regulators for financial calculations.
Calculator Verification Process
These are the steps we use to build and check calculators. Not every calculator has been through every step yet: automated tests cover the tools and engines named under Accuracy Standards below, and where accuracy varies by tool, the references listed on its page are the place to check.
- 1Formula identificationWe identify the governing equation(s) from primary sources, noting any assumptions and limitations. For calculators with multiple possible methods (e.g., different failure criteria), we implement the most widely-used version and note the choice.
- 2ImplementationThe formula is implemented in TypeScript, with explicit unit handling (SI internally, with conversion to/from user-selected units at the interface boundary). Numerical methods are chosen for stability and precision.
- 3Test against worked examples and reference dataWhere a calculator has automated tests, they compare it with worked examples from its sources or from our own pages, with published tables, or with a pinned reference implementation (the iapws, CoolProp, PsychroLib and python-control packages), under the precision policy in Accuracy Standards below. Not every calculator has such tests yet.
- 4Cross-check against alternative methodsWhere multiple methods exist, we implement and compare them. For example, the Moody chart page computes the pipe friction factor from Colebrook-White and shows how far the explicit Swamee-Jain approximation differs from it.
- 5Sanity checks at boundary conditionsWe verify behavior at edge cases: zero inputs, very large inputs, inputs that should produce well-known results (unit values, dimensionless ratio = 1, etc.). This catches implementation errors that testing individual example problems might miss.
- 6Ongoing correction from user feedbackWhen users report issues, we investigate and fix confirmed bugs, usually within 1-3 business days.
Accuracy Standards
What is checked, and how closely:
- •Precision policy. When a calculator is tested against a worked example (from a textbook or from one of our pages), the test requires its result to match every significant figure the example prints, allowing for rounding in the example's own working. Engines tested against published reference tables or reference software are held to the tolerances stated for them below.
- •Pure mathematical calculations (unit conversions, arithmetic, dimensional analysis): computed in IEEE 754 double-precision floating point, with the defined or published conversion factors described under Unit-Conversion-Factor Provenance below.
- •Engineering calculations with standard formulas (beam deflection, thermodynamic cycles, fluid mechanics): the formulas in the sources each page lists. Where a calculator is tested against a textbook worked example, the precision policy above applies.
- •Property calculations (water and steam): computed with IAPWS-IF97 (IAPWS R7-97(2012)) and checked in automated tests against the release’s verification values and an independent implementation (the iapws Python package): property equations agree to 1 part in 10⁸; states solved from temperature or pressure plus one other property agree to 1 part in 10⁶, except within about 0.01 kPa of the critical point. A few property pairs pin the pressure down only weakly (for example, entropy with internal energy for a compressed liquid), and the calculator shows a caution when that happens. Air, liquid-water and common-gas property tables are generated with CoolProp 8.0.0 from reference equations of state and transport formulations (nitric oxide: NIST-JANAF and KDB).
- •Refrigerant properties (R-134a, R-410A, ammonia): computed from each fluid's reference equation of state with coefficients from CoolProp 8.0.0. Automated tests compare them with CoolProp at pinned states for each fluid: about 220 single-phase states from temperature and pressure agree to 1 part in 10⁶; saturated liquid and vapor at every whole kelvin from the lower temperature limit to within 1 K of the critical temperature (145 to 210 temperatures per fluid; for R-410A, the bubble and dew points of its pseudo-pure model up to its nominal critical point) agree to 1 part in 10⁵; and three saturation states within 0.01 % of the critical temperature agree to 1 part in 10⁴. Each two-property input pair is also solved back from a few known states. These checks cover the tested states, not every input: states are found by a bounded numerical search, and for some inputs (for example, very near the critical point) the calculator reports that it cannot resolve the state instead of returning a value. The temperature and pressure limits each tool gives are its equation of state's stated range, not a promise that every state inside them is fluid: the tools do not check the freezing line.
- •Psychrometrics (moist air): computed with the ASHRAE Handbook — Fundamentals (2017) equations and checked in automated tests against PsychroLib 2.5.0 at 452 states from −60 to 200 °C at 10, 80, 101.325 and 200 kPa: saturation and vapor pressure and specific volume agree to 1 part in 10¹², humidity ratio to 1 part in 10¹¹, enthalpy to within 10⁻⁹ kJ/kg and dew point to within 10⁻⁷ K. The wet bulb agrees to within 0.0006 K where PsychroLib solved it (its search stops at a 0.001 K bracket) and to within 10⁻⁶ K for the 80 states whose reference wet bulb was solved separately from PsychroLib's equations. Above 200 kPa the calculator shows a caution.
- •Control-system tools: automated tests compare the gain and phase margins and crossover frequencies of the Bode and Nyquist tools with python-control 0.10.2: margins agree to within 5 × 10⁻⁶ degree or decibel and crossover frequencies to 1 part in 10⁷. The z-transform tool's zero-order-hold coefficients agree with python-control's c2d to within 5 × 10⁻¹³. Textbook worked examples for pole placement, root locus, lead-lag compensation, the Nichols chart and discrete PID control, and the worked examples on the Bode page, are checked under the precision policy above.
- •Financial calculations (mortgage, compound interest, NPV): standard time-value-of-money formulas. Automated tests check that the worked examples and FAQ figures on several finance and health pages quote what their calculators give.
- •Numerical methods (ODE solvers, root finding, numerical integration): approximate methods whose error depends on the step size, the tolerance and the problem. For results that matter, compare with an independent method.
Limitations and Appropriate Use
MegaCalc calculators are intended as educational and professional reference tools, not as replacements for specialized engineering software, licensed professional review, or regulatory compliance processes. Please be aware of the following limitations:
- !Safety-critical applications (aircraft design, nuclear, medical devices, pressure vessels in service) require calculations to be done with software that has been validated and certified for that use. Never use MegaCalc as the sole tool for life-safety calculations.
- !Regulatory submissions (building permits, environmental permits, legal filings) typically require calculations to be performed and signed by a licensed Professional Engineer or equivalent. MegaCalc can be used as a quick check but not as the final authority.
- !Investment and medical advice: our financial and health calculators are informational tools. For decisions with significant consequences, consult a qualified financial advisor or healthcare professional.
- !Idealized assumptions (e.g., incompressible flow, linear elasticity, adiabatic process) sit behind most engineering formulas. Results are only as valid as the assumptions match your actual situation.
Unit-Conversion-Factor Provenance
Every unit-conversion factor used on the site (e.g., 1 inch = exactly 0.0254 m; 1 lbf = 4.4482216152605 N; 1 BTU = 1055.06 J) is traceable through the source hierarchy above. The provenance workflow is:
- 1Look up the factor in NIST SP 811 Appendix BNIST publishes definitive conversion factors, exact where the definitions make them exact and rounded otherwise, for the vast majority of unit pairs in common technical use. Where NIST SP 811 lists the factor, that’s the value used.
- 2Cross-check against the BIPM SI BrochureFor SI-only or SI-derived units, the BIPM brochure is the authoritative source for the definition. We verify the NIST factor (which is derived from the BIPM definition) matches the BIPM-derived value to within rounding.
- 3For non-NIST units, source-vet from ISO / domain standardUnits NIST doesn’t cover (e.g., specific industry pressure units, regional fuel-density conventions, legacy Japanese / Russian engineering units) are sourced from the relevant ISO or industry standard and the source is recorded in the unit’s code comments and on the /units/<slug> description page itself.
- 4Checks in testsVitest suites at
__tests__/conversions/check named landmark conversions against published values (1 in = 2.54 cm, 1 ft = 0.3048 m, and others) and, for several units, that converting there and back returns the original value.
Conversion factors that disagree between sources (a rare event since modern metrology is highly standardized) are resolved by taking the higher-tier source and noting the alternative in code comments. Example: kgf · m torque is exactly 9.80665 N·m by the CIPM 1901 definition of standard gravity, NOT 9.81 — the latter is a common rounded value that produces a 0.034% error.
Review Cadence & Versioning
Methodology and content updates are versioned via git, with a visible “Last reviewed” date on every calculator page derived from the underlying source file’s git mtime. That’s the same data Google’s SERP-snippet generator uses for the “Updated” line, so the dates you see on this site are the dates Google sees in itsdateModified schema.org markup — one source of truth.
- •Automated checks on every pull request. CI runs the TypeScript type check, ESLint, the full Vitest test suite and the IndexNow script tests on every pull request and every push to main, then runs the date tests again in four time zones (Los Angeles, Berlin, Kolkata and Sydney). The suite includes the reference-data tests described under Accuracy Standards; the title gate, which keeps the titles of calculator, converter, unit, comparison, blog, class, hub and information pages under 60 characters, including the brand suffix; and the description gate, which keeps calculator, converter, unit, comparison and blog-article descriptions to 160 characters or fewer. Pull requests that change calculators also run the broken-calculator gate (every config-driven calculator must produce a result for its starting inputs) and check that the dates on calculator pages match the git history or, for calculators added since October 20, 2026, their recorded production release; reference links are checked nightly.
- •Quarterly content refresh. Q1: refresh finance calculators with current-year IRS limits, inflation indices, and tax tables. Q2: re-survey construction-material pricing (concrete, lumber). Q3: re-pull NIST CODATA fundamental constants (revised every 4 years). Q4: refresh health calculators against the latest AHA / AMA / WHO guideline changes.
- •Source-update notifications. When BIPM revises the SI brochure, NIST publishes new CODATA values, or a domain consensus standard issues an amendment that touches a value we publish, the relevant calculator(s) are flagged for review within 30 days of the source change.
- •User-reported errors. Acknowledged within 1 business day, root-caused and fixed within 1-3 business days for confirmed bugs.
Reporting Errors
If you find an error in any calculator, formula explanation, reference table, or example problem, please contact us. We take corrections seriously and will investigate, verify, and fix them promptly — usually within 1-3 business days. Include the calculator URL, your specific inputs, and the expected versus actual output so we can reproduce the issue.