Home Developers REST API

CalculatorX Developers

REST API

Call deterministic calculation engines over HTTP. MCP capabilities live in the catalog — this page documents REST engine ids, including tools that are not MCP capabilities yet.

curl -X POST 'https://www.calculatorx.com/api/v1/calc/amps-to-va' \
  -H 'Content-Type: application/json' \
  -H 'CalculatorX-Spec-Version: 1.4.3' \
  -d '{"inputs":{"mode":"amps-va","primary":12,"volts":230,"phase":"single"}}'

Public beta HTTP access to the same deterministic engines that power CalculatorX pages. No API key yet — treat responses as informational and verify critical numbers yourself.

Call with a page alias (tool_id, for example amps-to-va). The response always includes the resolved engine. MCP agents should use capability_id instead — see MCP, the agent guide, and the mapping below.

Ids: tool, engine, capability

Use capability_id when you need a stable semantic identity (MCP and the catalog). REST tool_id is a human-friendly page alias. engine is the implementation that ran — do not couple client logic to it.

Kind Example Role
capability_id electrical.apparent_power Canonical semantic ID
tool_id amps-to-va REST / page alias (POST /api/v1/calc/amps-to-va)
engine amps-va Resolved implementation in the response

Not every REST engine is an MCP capability yet. Some grade/dev helpers (for example gpa) stay engine-tested REST until promoted. Browse templated agent capabilities at /capabilities/.

Endpoint

GET  /api/v1/calc
POST /api/v1/calc/:id
Content-Type: application/json

:id may be a public tool alias (amps-to-va) or a callable engine id (amps-va). The response engine is the implementation that ran.

GET /api/v1/calc returns calculation_version, the full list of acceptable ids (canonical + aliases), plus electrical and math catalogs with page links.

Pin a published calculation version with CalculatorX-Spec-Version or calculation_version in the body — mismatch returns HTTP 409. Immutable snapshots and share URLs: Snapshots. Error payloads and rate limits: Errors.

Every supplied pin must agree: header, body calculation_version, legacy calculationVersion, and the corresponding fields inside inputs. Conflicts return HTTP 409 / VERSION_PIN_CONFLICT; there is no body-over-header priority. A supplied pin must be a nonempty string (INVALID_VERSION_PIN, HTTP 400). MCP execute_calculation checks both argument names against each other and an outer CalculatorX-Spec-Version header. Do not silently remove a version lock when retrying.

Request contract 1.0.2 rejects nonzero JSON numeric literals that would convert to binary64 zero, including inside arrays/objects: {"inputs":{"x":1e-400}} returns NUMERIC_UNDERFLOW instead of an exact-zero result. Literal zero (including 0e-400) and representable subnormal values remain distinct; the numerical model may reject a representable input if its outputs are outside its supported range. This transport rule is separate from calculator calculation versions. Decimal strings are accepted only where the calculator declares them, and do not extend binary64 precision. If a client already serialized a rounded value as 0, the server cannot recover its original nonzero source.

POST body

{ "inputs": { … } }

You may also send the inputs object as the top-level JSON body (without wrapping in inputs).

Success (200)

{
  "id": "amps-to-va",
  "tool": "amps-to-va",
  "engine": "amps-va",
  "status": "success",
  "inputs": {
    "mode": "amps-va",
    "primary": 12,
    "volts": 230,
    "phase": "single"
  },
  "result": 2760,
  "result_detail": {
    "value": 2760,
    "unit": "VA",
    "formatted": "2,760 VA"
  },
  "formula": {
    "id": "amps-to-va_primary",
    "expression": "S = V_RMS × I_RMS",
    "label": "Single-phase apparent power"
  },
  "assumptions": [
    "AC steady-state with RMS voltage and current magnitudes.",
    "Three-phase mode is balanced sinusoidal AC using line-to-line RMS voltage, where V_LL = √3 V_LN and line currents are equal. IEEE 1459 covers a wider set of conditions; this calculator does not.",
    "Total power factor λ is not applied to VA/kVA results."
  ],
  "warnings": [
    "Result is engine-tested but not expert-reviewed; verify critical use independently."
  ],
  "verification": {
    "engine_tested": true,
    "expert_reviewed": false,
    "source_checked": true,
    "reviewed_by": null,
    "last_reviewed": null
  },
  "api_version": "v1",
  "api_contract_version": "1.0.2",
  "calculation_version": "1.4.3",
  "spec_version": "1.4.3",
  "page": "https://www.calculatorx.com/calc/electric/amps-to-va"
}

result remains the raw engine value for backward compatibility. Prefer result_detail, formula, assumptions, warnings, and verification for agents. Computational verification is defined by CVP. Supplemental domain review is defined by the Review policy.

Reference capability math.scientific_notation (calculation_version 2.0.0) publishes a mode-discriminated input oneOf (convert / engineering / normalize / operate). Share-URL aliases such as numInput and dec-sci are not Agent fields. Its success envelope splits CVP (verification.cvp) from Review policy (review.tier). Other tools still nest review-policy fields under verification until they opt in.

When power_factor (λ) is supplied for electrical.apparent_power, the success body also includes derived.estimated_real_power (P_est = S × λ, unit W). Omit power_factor and derived is omitted. Apparent power itself is unchanged.

Version fields:

Field Meaning
api_version HTTP API surface (v1)
api_contract_version Shared API contract; 1.0.2 also checks the MCP calculationVersion alias against every supplied pin, independently of numerical-model versions
calculation_version / spec_version This tool's calculation version (matches the on-page Spec)

Incomplete or illegal inputs return HTTP 400 with status: "error" — never success with a NaN result. A valid empty dataset (for example GPA with no counted credits) is HTTP 200 with engine status: "empty" and a null result value. Full status table, ApiError shape, and rate limits: Errors.

id is the id you requested (page alias or canonical). engine is the resolved engine that ran. Both are always present.

CORS is open (Access-Control-Allow-Origin: *).

Base URL is your CalculatorX host, for example https://www.calculatorx.com.

Runnable examples live on Quick start. Agent tools: MCP. Catalog: /capabilities/.

Engine catalog

Engines are grouped like the site hubs. Field names are case-sensitive and match the JSON inputs object. Electrical page aliases (slug leaf) resolve to the same engines used on the calculator pages.

Finance

engineId Inputs Result highlights
compound-interest principal, ratePct, years, compoundsPerYear fv, interest
simple-interest principal, ratePct, term, termUnit (years / months / days), optional mode interest, balance
vat mode (add / extract), amount, ratePct net, vat, gross
loan-payment principal, ratePct, termMonths payment, totalPaid, totalInterest
amortization same as loan-payment payment totals + schedule (first 12 periods)
roi cost, gain roiPct, profit
break-even fixedCost, price, variableCost units, contribution, revenue
profit-margin revenue, cost marginPct, profit
cagr startValue, endValue, years cagrPct
discount originalPrice, discountPct salePrice, saved
markup cost, sellingPrice markupPct, marginPct
present-value futureValue, ratePct, years, compoundsPerYear pv
savings-goal goal, ratePct, years, principal payment

Matching pages: Finance calculators.

Electrical (page alias → engine)

Generated from the capability registry. MCP electrical tool ids, including adc-error-budget:

Call with (id)EngineCapabilityVersionPage
ac-dc-rectifierac-dc-rectifierelectrical.ac_dc_rectifier1.1.2/calc/electric/ac-dc-rectifier
adc-error-budgetadc-error-budgetelectrical.adc.error_budget1.0.0/calc/electric/adc-error-budget
adc-snradc-snrelectrical.adc.snr1.1.0/calc/electric/adc-snr
amps-to-kwamps-kwelectrical.amps_to_kw1.4.3/calc/electric/amps-to-kw
amps-to-vaamps-vaelectrical.apparent_power1.4.3/calc/electric/amps-to-va
amps-to-voltsamps-voltselectrical.amps_to_volts1.4.2/calc/electric/amps-to-volts
antenna-lengthantenna-lengthelectrical.rf.antenna_length1.0.3/calc/electric/antenna-length
awg-to-mmawgelectrical.awg_to_mm1.5.0/calc/wire/awg-to-mm
battery-agingbattery-agingelectrical.battery.aging1.0.2/calc/electric/battery-aging
battery-pack-sizingbattery-pack-sizingelectrical.battery.pack_sizing1.2.0/calc/electric/battery-pack-sizing
battery-runtimebattery-runtimeelectrical.battery_runtime1.2.1/calc/electric/battery-runtime
battery-runtime-tempbattery-runtime-tempelectrical.battery.runtime_temp1.2.1/calc/electric/battery-runtime-temp
buck-ripplebuck-rippleelectrical.buck.ripple1.1.0/calc/electric/buck-ripple
capacitancecapacitanceelectrical.capacitance1.1.0/calc/electric/capacitance
cascaded-nfcascaded-nfelectrical.rf.cascaded_nf1.1.1/calc/electric/cascaded-nf
coax-impedancecoax-impedanceelectrical.rf.coax1.0.1/calc/electric/coax-impedance
current-dividercurrent-dividerelectrical.current_divider1.0.2/calc/electric/current-divider
diode-equationdiode-equationelectrical.diode.equation1.1.0/calc/electric/diode-equation
electricityelectricity-billelectrical.electricity_bill1.3.1/calc/electric/electricity
energy-consumptionenergyelectrical.energy_consumption1.4.2/calc/electric/energy-consumption
energy-costenergy-costelectrical.energy_cost1.4.2/calc/electric/energy-cost
ev-to-voltsev-voltageelectrical.ev_voltage1.3.0/calc/electric/ev-to-volts
fsplfsplelectrical.rf.fspl1.0.0/calc/electric/fspl
gamma-zgamma-zelectrical.rf.gamma_z1.0.0/calc/electric/gamma-z
heatsink-rthheatsink-rthelectrical.thermal.heatsink_rth1.1.0/calc/electric/heatsink-rth
hpfhpfelectrical.hpf1.0.0/calc/electric/hpf
kirchhoffkirchhoffelectrical.kirchhoff1.0.0/calc/electric/kirchhoff
kva-to-ampskva-ampselectrical.kva_to_amps1.4.1/calc/electric/kva-to-amps
kva-to-kwkva-kwelectrical.kva_to_kw1.4.1/calc/electric/kva-to-kw
kw-to-vakw-vaelectrical.kw_to_va1.3.1/calc/electric/kw-to-va
kwh-to-kwkwh-to-kwelectrical.kwh_to_kw1.2.1/calc/electric/kwh-to-kw
kwh-to-wattsscale-quotientelectrical.kwh_to_watts1.2.1/calc/electric/kwh-to-watts
lc-matchlc-matchelectrical.rf.lc_match1.0.0/calc/electric/lc-match
ldo-thermalldo-thermalelectrical.ldo.thermal1.0.0/calc/electric/ldo-thermal
led-resistorled-resistorelectrical.led_resistor1.0.0/calc/electric/led-resistor
logic-gatelogic-gateelectrical.digital.logic_gate1.0.0/calc/electric/logic-gate
lpflpfelectrical.lpf1.0.0/calc/electric/lpf
mah-to-whmah-to-whelectrical.mah_to_wh1.3.1/calc/electric/mah-to-wh
mosfet-conduction-lossmosfet-conduction-losselectrical.mosfet.conduction_loss1.2.2/calc/electric/mosfet-conduction-loss
mosfet-switching-lossmosfet-switching-losselectrical.mosfet.switching_loss1.0.0/calc/electric/mosfet-switching-loss
mosfet-tjmosfet-tjelectrical.mosfet.tj1.1.2/calc/electric/mosfet-tj
mosfet-total-lossmosfet-total-losselectrical.mosfet.total_loss1.1.2/calc/electric/mosfet-total-loss
mosfet-vthmosfet-vthelectrical.mosfet.vth1.3.1/calc/electric/mosfet-vth
ohms-lawohms-lawelectrical.ohms_law1.5.1/calc/electric/ohms-law
opamp-error-budgetopamp-error-budgetelectrical.opamp.error_budget1.0.0/calc/electric/opamp-error-budget
opamp-gainopamp-gainelectrical.opamp_gain1.0.0/calc/electric/opamp-gain
opamp-noiseopamp-noiseelectrical.opamp.noise1.0.0/calc/electric/opamp-noise
parallel-resistorparallel-resistorelectrical.parallel_resistor1.0.0/calc/electric/parallel-resistor
pcb-diff-impedancepcb-diff-impedanceelectrical.pcb.diff_impedance1.0.0/calc/electric/pcb-diff-impedance
pcb-microstrippcb-microstripelectrical.pcb.microstrip1.0.0/calc/electric/pcb-microstrip
pcb-striplinepcb-striplineelectrical.pcb.stripline1.0.0/calc/electric/pcb-stripline
pcb-trace-thermalpcb-trace-thermalelectrical.pcb.trace_thermal1.0.0/calc/electric/pcb-trace-thermal
pcb-trace-widthpcb-trace-widthelectrical.pcb.trace_width1.1.1/calc/electric/pcb-trace-width
pcb-via-currentpcb-via-currentelectrical.pcb.via_current1.0.0/calc/electric/pcb-via-current
powerelectric-powerelectrical.power1.3.0/calc/electric/power
power-factorpower-factorelectrical.power_factor1.5.1/calc/electric/power-factor
rc-time-constantrc-time-constantelectrical.rc_time_constant1.0.0/calc/electric/rc-time-constant
receiver-sensitivityreceiver-sensitivityelectrical.rf.receiver_sensitivity1.0.0/calc/electric/receiver-sensitivity
rectifier-ripple-caprectifier-ripple-capelectrical.rectifier.ripple_cap1.0.0/calc/electric/rectifier-ripple-cap
resistor-colorresistor-colorelectrical.resistor_color_code1.0.0/calc/electric/resistor-color-code
rf-link-budgetrf-link-budgetelectrical.rf.link_budget1.1.1/calc/electric/rf-link-budget
rlc-resonancerlc-resonanceelectrical.rlc_resonance1.0.0/calc/electric/rlc-resonance
series-capacitorseries-capacitorelectrical.series_capacitor1.0.0/calc/electric/series-capacitor
skin-depthskin-depthelectrical.rf.skin_depth1.0.0/calc/electric/skin-depth
smith-chartsmith-chartelectrical.rf.smith1.6.3/calc/electric/smith-chart
swg-to-mmswgelectrical.swg_to_mm1.3.1/calc/wire/swg-to-mm
timer-555timer-555electrical.timer_5551.2.0/calc/electric/timer-555
transformer-sizingtransformer-sizingelectrical.transformer_sizing1.0.0/calc/electric/transformer-sizing
va-to-kvascaleelectrical.va_to_kva1.3.1/calc/electric/va-to-kva
voltage-dividervoltage-dividerelectrical.voltage_divider1.5.1/calc/electric/voltage-divider
voltage-dropvoltage-dropelectrical.voltage_drop1.5.2/calc/wire/voltage-drop
volts-to-joulesproductelectrical.volts_to_joules1.2.0/calc/electric/volts-to-joules
volts-to-kwvolts-kwelectrical.volts_to_kw1.3.1/calc/electric/volts-to-kw
vswrvswrelectrical.rf.vswr1.0.0/calc/electric/vswr
watt-volt-ampwatt-volt-ampelectrical.watt_volt_amp1.5.1/calc/electric/watt-volt-amp
watts-to-ampswatts-ampselectrical.watts_amps1.4.1/calc/electric/watts-to-amps
watts-to-joulesproductelectrical.watts_to_joules1.2.1/calc/electric/watts-to-joules
watts-to-kvascale-quotientelectrical.watts_to_kva1.3.1/calc/electric/watts-to-kva
watts-to-vawatts-vaelectrical.watts_to_va1.3.1/calc/electric/watts-to-va
watts-to-voltswatts-to-voltselectrical.watts_to_volts1.3.1/calc/electric/watts-to-volts
wavelengthwavelengthelectrical.rf.wavelength1.0.0/calc/electric/wavelength
wheatstone-bridgewheatstone-bridgeelectrical.wheatstone1.0.0/calc/electric/wheatstone-bridge
Call with (id) Resolves to engine Inputs (summary) Page
amps-to-va / amps-va amps-va mode, primary, volts, phase /calc/electric/amps-to-va
watts-to-amps / watts-amps watts-amps dir, powerOrCurrent, volts, circuit, pf /calc/electric/watts-to-amps
ohms-law ohms-law any two of V, I, R, P /calc/electric/ohms-law
power-factor power-factor mode, V, I, P_kW /calc/electric/power-factor
voltage-drop voltage-drop mode, I, length_m, R_ohm_per_km /calc/wire/voltage-drop
voltage-divider voltage-divider exactly three of Vin, R1, R2, Vout /calc/electric/voltage-divider
energy-consumption / energy energy W, hours /calc/electric/energy-consumption
energy-cost energy-cost mode, W, hours, days, kWh, rate /calc/electric/energy-cost
watt-volt-amp watt-volt-amp any two of P, V, I, R /calc/electric/watt-volt-amp
electricity / electricity-bill electricity-bill mode, kWh/prev/curr, rate, standing, days, fee /calc/electric/electricity
amps-to-kw phase-product a, b, phase, pf, factor (e.g. 0.001) /calc/electric/amps-to-kw
volts-to-kw volts-kw mode v-kw|kw-v, a, b, phase, pf in (0, 1] /calc/electric/volts-to-kw
power electric-power mode power-vi|power-ir|power-energy (aliases vi_dc vi_ac_single vi_ac_three_phase_ll i2r energy_average); V×I: a|V, b|I, phase, power_factor in [0, 1] (blank→1, PF=0 is valid); I²R: a|R, b|I; energy: a|E, b|Δt>0 /calc/electric/power · MCP electrical.power
kva-to-amps phase-quotient a, b, phase, pf, factor /calc/electric/kva-to-amps
amps-to-volts amps-volts mode plus current/resistance/power/voltage; watts: system; AC requires power_factor; DC must omit it (REST ignore + POWER_FACTOR_IGNORED) /calc/electric/amps-to-volts
watts-to-volts watts-to-volts a, b, phase, pf related electric pages
va-to-kva scale a, factor /calc/electric/va-to-kva
kw-to-va kw-va a, b related electric pages
watts-to-kva watts-to-kva a, b related electric pages
kwh-to-watts kwh-to-watts a, b related electric pages
watts-to-va watts-va mode, a|P|S, b|power_factor PF required in (0, 1]
kva-to-kw kva-kw a, b related electric pages
volts-to-joules volts-to-joules a, b related electric pages
watts-to-joules watts-to-joules a, b related electric pages
ev-to-volts / volts-to-ev ev-voltage mode ev-v-e|ev-v-c|v-ev-e|v-ev-c (or direction + charge_unit); energy_eV|a, voltage_V|a, charge_value|b. Charge is magnitude; Q=0 when solving for V → ZERO_CHARGE. Exact SI e = 1.602176634×10⁻¹⁹ C. MCP electrical.ev_voltage /calc/electric/ev-to-volts
kwh-to-kw kwh-to-kw a, b related electric pages
mah-to-wh scale-product a, b (and scale fields) /calc/electric/mah-to-wh
awg-to-mm / wire-gauge-chart / awg awg awg, optional field (mm/mm2) /calc/wire/awg-to-mm
swg-to-mm / swg swg swg, optional field /calc/wire/swg-to-mm
adc-error-budget adc-error-budget n_bits (integer 1…32), FSR_V, gain_err_LSB, offset_err_LSB, inl_LSB, dnl_LSB, combine (rss / worst_case). MCP electrical.adc.error_budget /calc/electric/adc-error-budget

Canonical helper ids (phase-product, scale-quotient, …) remain callable directly. Browse: Electrical · Wire. The full electrical.* MCP list is generated from the capability registry at the bottom of this page.

Math

Call with (id) Resolves to engine Inputs (summary) Page
percentage / percent percentage mode (of / is-what / of-what / change / adjust-up / adjust-down / difference; UI aliases what whole adjust diff); p x y old new a b (share aliases pInput xInput yInput oldInput newInput aInput bInput) /calc/math/percentage · MCP math.percentage
percent-change / percentage-change percent-change any two of v1, v2, p; optional solve_for (p default / v2 / v1). Aliases v1Input/oldV, v2Input/newV, pInput. Inverse v1 can have 0, 1, or 2 solutions because the denominator is ` V₁
anti-log / antilog antilog y (log value); optional base (10 / e / 2 / custom) or b /calc/math/anti-log
log / logarithm log any two of x, y, optional base/b; optional solve_for (y / x / b) /calc/math/log · MCP math.log
ln / natural-log ln x (argument > 0; token e allowed) /calc/math/ln
exponent exponent optional solve_for (y default / a / n); a, n, and/or y /calc/math/exponent
square-root / sqrt square-root x (radicand; x < 0 → principal imaginary) /calc/math/square-root
pythagorean / pythagoras pythagorean any two of a, b, c; optional solve_for (a / b / c) or mode=verify. All three without solve_for → verify. Aliases aInput, bInput, cInput. /calc/math/pythagorean · MCP math.pythagorean
root / nth-root root a (radicand); optional n (positive safe integer index, default 2) /calc/math/root
sin / sine sin theta; optional unit (deg default / rad) /calc/math/sin
cos / cosine cos theta; optional unit (deg default / rad) /calc/math/cos
tan / tangent tan theta; optional unit (deg default / rad); exact poles → UNDEFINED; near-pole → finite + NEAR_SINGULARITY /calc/math/tan
arcsin / asin arcsin x ∈ [−1, 1]; result { deg, rad } /calc/math/arcsin
arccos / acos arccos x ∈ [−1, 1]; result { deg, rad } /calc/math/arccos
arctan / atan arctan x any finite real; result { deg, rad } /calc/math/arctan
multiplication multiplication a, b; optional mode (product / long) /calc/math/multiplication · MCP math.multiplication
add / sum sum values array or sumInput text list; optional mode (sum / long) /calc/math/add · MCP math.sum
division / divide divide a, b; optional mode (quotient / long), decimals /calc/math/division · MCP math.divide
exponential-growth exponential-growth x0, ratePct, t; optional model (periodic / continuous) /calc/math/exponential-growth · MCP math.exponential_growth
scientific-notation scientific-notation Canonical MCP/Agent mode (convert / engineering / normalize / operate) plus mode fields. REST still accepts legacy adapter aliases dec-sci / sci-dec (and share-URL numInput); they are not published Agent modes. /calc/math/scientific-notation · MCP math.scientific_notation
subtraction / subtract subtraction any two of minuend, subtrahend, difference; optional mode (difference / long). Share aliases minInput, subInput, diffInput. Long mode: non-negative, minuend may be smaller (negative difference). /calc/math/subtraction · MCP math.subtraction
factorial factorial n (integer, 0 ≤ n ≤ 5000; alias nInput) /calc/math/factorial · MCP math.factorial
gcf / gcd / hcf gcf values (integer array, ≥ 2) or share-URL numsInput /calc/math/gcf · MCP math.gcf
lcm / lcd lcm values (2–32 integers, ≤48 digits each) or share-URL numsInput /calc/math/lcm · MCP math.lcm
ratio ratio mode (simplify / proportion / scale / split / compare / convert); a b optional c d k total (share aliases aInput…) /calc/math/ratio · MCP math.ratio
fractions fractions mode (operate / simplify / to-dec / from-dec); op (+ − * /, aliases add…); aNum aDen bNum bDen (optional aWhole bWhole); decimal for from-dec /calc/math/fractions · MCP math.fractions
POST /api/v1/calc/percentage
Request
{
  "inputs": {
    "mode": "of",
    "p": 20,
    "x": 250
  }
}
Returns
{ "mode": "of", "value": 50, "Y": 50, "formula": "Y = X × P / 100", … }
Share URL: /calc/math/percentage?pInput=20&xInput=250&mode=of. UI aliases pInput/xInput and REST names p/x are equivalent. MCP capability: math.percentage. Percent change uses |old| in the denominator; percentage difference is defined for A ≥ 0, B ≥ 0, A+B ≠ 0.
POST /api/v1/calc/percent-change
Request
{
  "inputs": {
    "v1": 60,
    "v2": 72
  }
}
Returns
{ "solve_for": "p", "value": 20, "direction": "increase", … }
Inverse: { "inputs": { "solve_for": "v1", "v2": 25, "p": 200 } } → status: "multiple_solutions" with solutions: [8.333…, -25]. Share URL: /calc/math/percentage-change?solve_for=p&v1Input=60&v2Input=72. Alias percentage-change. Signed convention: % change = (V₂−V₁)/|V₁|×100%. MCP capability: math.percent_change. CVP cross-interface PASS for this tool is SSR query-result HTML · REST · MCP handler equivalence, not a live browser session.
POST /api/v1/calc/anti-log
Request
{
  "inputs": {
    "y": 3,
    "base": "10"
  }
}
Returns
1000
Share URL: /calc/math/anti-log?y=3&base=10. MCP capability: math.antilog.
POST /api/v1/calc/log
Request
{
  "inputs": {
    "x": 100,
    "base": "10"
  }
}
Returns
{
  "solve_for": "y",
  "value": 2,
  "b": 10,
  "x": 100,
  "y": 2
}
Inverse: { "inputs": { "base": "10", "y": 3 } } → x = 1000; { "inputs": { "x": 8, "y": 3 } } → b = 2. Share URL: /calc/math/log?x=100&base=10. MCP capability: math.log. The Log page also shows an engine-linked Live graph of y = log_b(x) sampled with the same formulas as the numeric result and clipped to x > 0. Function view (default) uses a canonical window 0.1 ≤ x ≤ 10 so (1, 0) stays readable; Focus zooms around the current point. The same Live graph template (Function / Focus, engine-linked sampling) is used on ln, antilog, exponent, square root, root, sin, cos, tan, arcsin, arccos, and arctan.
POST /api/v1/calc/ln
Request
{
  "inputs": {
    "x": 10
  }
}
Returns
{ "y": ln(10), "value": ln(10), "verification": { "expression": "exp(result)", "passed": true } }
Share URL: /calc/math/ln?x=10. MCP capability: math.ln. Inverse x = e^y is Antilog with base: "e".
POST /api/v1/calc/exponent
Request
{
  "inputs": {
    "a": 2,
    "n": 10
  }
}
Returns
1024
Inverse: { "inputs": { "solve_for": "n", "a": 2, "y": 1024 } } → { "solve_for": "n", "value": 10, ... }; { "inputs": { "solve_for": "a", "n": 2, "y": 4 } } → principal 2 with solutions: [2, -2] and TWO_REAL_SOLUTIONS. Share URL: /calc/math/exponent?solve_for=y&a=2&n=10. MCP capability: math.exponent. Forward 0^0 is UNDEFINED_POWER. Even integer bases of a positive power report both real signs.
POST /api/v1/calc/square-root
Request
{
  "inputs": {
    "x": 144
  }
}
Returns
{
  "principal": 12,
  "real": 12,
  "imag": 0
}
Share URL: /calc/math/square-root?x=144. MCP capability: math.square_root. For x < 0 the principal imaginary is in imag (for example x: -9 → imag: 3).
POST /api/v1/calc/pythagorean
Request
{
  "inputs": {
    "a": 3,
    "b": 4
  }
}
Returns
{ "solve_for": "c", "value": 5, "c": 5, "area": 6, "perimeter": 12, … }
Inverse: { "inputs": { "solve_for": "a", "b": 4, "c": 5 } } → a = 3. All three sides without solve_for verifies a²+b²=c² instead of overwriting c: { "inputs": { "a": 3, "b": 4, "c": 5 } } → mode: "verify". Share URLs: /calc/math/pythagorean?solve_for=c&aInput=3&bInput=4 and /calc/math/pythagorean?mode=verify&aInput=3&bInput=4&cInput=5. MCP capability: math.pythagorean.
POST /api/v1/calc/root
Request
{
  "inputs": {
    "a": 27,
    "n": 3
  }
}
Returns
3
Share URL: /calc/math/root?a=27&n=3. MCP capability: math.root. Index n is a positive safe integer (Number.isSafeInteger(n) && n ≥ 1, default 2, maximum Number.MAX_SAFE_INTEGER = 9007199254740991). Even roots of a < 0 return NOT_REAL (unlike Square Root, which returns an imaginary). Non-integer, negative, or non-safe-integer n (including n outside JavaScript’s safe-integer range) returns INVALID_INDEX — those are generalized powers on Exponent, not this nth-root contract. For a < 0 and odd n, the engine uses −(|a|)^(1/n), not the complex principal power.
POST /api/v1/calc/sin
Request
{
  "inputs": {
    "theta": 30,
    "unit": "deg"
  }
}
Returns
0.5
Share URL: /calc/math/sin?theta=30. MCP capability: math.sin. Default unit is degrees.
POST /api/v1/calc/cos
Request
{
  "inputs": {
    "theta": 60,
    "unit": "deg"
  }
}
Returns
0.5
Share URL: /calc/math/cos?theta=60. MCP capability: math.cos.
POST /api/v1/calc/tan
Request
{
  "inputs": {
    "theta": 45,
    "unit": "deg"
  }
}
Returns
1
Share URL: /calc/math/tan?theta=45. MCP capability: math.tan. Exact odd multiples of 90° return UNDEFINED (not Infinity). Angles extremely close to a pole return a finite value with warnings: [{ code: "NEAR_SINGULARITY" }].
POST /api/v1/calc/arcsin
Request
{
  "inputs": {
    "x": 0.5
  }
}
Returns
{ "deg": 30, "rad": π/6 }
Share URL: /calc/math/arcsin?x=0.5. MCP capability: math.arcsin. Values outside [−1, 1] return NOT_REAL.
POST /api/v1/calc/arccos
Request
{
  "inputs": {
    "x": 0.5
  }
}
Returns
{ "deg": 60, "rad": π/3 }
Share URL: /calc/math/arccos?x=0.5. MCP capability: math.arccos.
POST /api/v1/calc/arctan
Request
{
  "inputs": {
    "x": 1
  }
}
Returns
{ "deg": 45, "rad": π/4 }
Share URL: /calc/math/arctan?x=1. MCP capability: math.arctan.
POST /api/v1/calc/factorial
Request
{
  "inputs": {
    "n": 5
  }
}
Returns
{
  "n": 5,
  "value": 120,
  "exact": "120",
  "digits": 3,
  "expansion": "5! = 5 × 4 × 3 × 2 × 1",
  "scientific": "1.2 × 10^2",
  "max_n": 5000
}
Share URL: /calc/math/factorial?n=5. MCP: search_capabilities → inspect_capability → execute_calculation with capability_id: "math.factorial" (pin 1.0.2). Ordinary factorial only; Gamma for non-integers is out of scope. Domain 0 ≤ n ≤ 5000 is a CalculatorX product bound, not a NIST bound. On-page display omits scientific notation when digits ≤ 30.
POST /api/v1/calc/gcf
Request
{
  "inputs": {
    "values": [
      8,
      12,
      20
    ]
  }
}
Returns
{ "value": 4, "exact": "4", "formula": "GCF(a,b,c,…) = GCF(GCF(a,b),c,…)", "methods": { "agree": true, … } }
Share URL: /calc/math/gcf?numsInput=8,12,20. MCP: execute_calculation with capability_id: "math.gcf" (pin 1.0.2). Exact BigInt Euclidean fold; zeros are ignored unless every input is 0 (UNDEFINED). Integers beyond Number.MAX_SAFE_INTEGER must be decimal strings. Each integer ≤ 48 digits.
POST /api/v1/calc/lcm
Request
{ "inputs": { "values": [8, 12] } }</code> returns a <code>result</code> object containing <code>{ "value": 24, "exact": "24", "formula": "LCM(a,b,c,…) = LCM(LCM(a,b),c,…)", "methods": { "agree": true, … } }</code>. Share URL: <code>/calc/math/lcm?numsInput=8,12</code>. MCP: <code>execute_calculation</code> with <code>capability_id: "math.lcm"</code> (pin <code>1.0.4</code>). Exact BigInt GCF-identity fold <code>LCM(a,b)=|a/GCF(a,b)×b|</code> (divide first; both nonzero). If any input is 0, LCM = 0; <code>LCM(0,0)=0</code> is a CalculatorX/Python convention (the identity would divide by zero). Integers beyond <code>Number.MAX_SAFE_INTEGER</code> must be decimal strings. Use2–32 integers, each ≤48 digits; matching ordered aliases are required. Result/work data remain complete in summary/full. Explicit empty and unknown/conflicting inputs are rejected; unsafe JSON integers require strings.</p>
<p>REST <code>POST /api/v1/calc/ratio</code> with <code>{ "inputs": { "mode": "simplify", "a": 12, "b": 18 } }
Returns
{ "value": "2:3", "terms": [2, 3], "gcf": 6, … }
Share URL: /calc/math/ratio?aInput=12&bInput=18&mode=simplify. MCP: execute_calculation with capability_id: "math.ratio" (pin 1.0.2). Terms are exact rationals (integers, terminating decimals, simple a/b). Simplify clears denominators by their LCM, then divides by GCF. Split requires every term ≥ 0 and Σ terms > 0 (SPLIT_NEGATIVE_TERM / SPLIT_ZERO_SUM). Integer simplify work omits a no-op decimal-clearing step.
POST /api/v1/calc/fractions
Request
{
  "inputs": {
    "mode": "operate",
    "op": "+",
    "aNum": 3,
    "aDen": 4,
    "bNum": 1,
    "bDen": 6
  }
}
Returns
{ "improper": "11/12", "n": 11, "d": 12, … }
Share URL: /calc/math/fractions?aNum=3&aDen=4&bNum=1&bDen=6&mode=operate. MCP: execute_calculation with capability_id: "math.fractions" (pin 1.0.6). Add/subtract use LCD (LCM of denominators); (ad ± bc)/bd is an equivalent check only. Denominator 0 → DENOMINATOR_MUST_BE_NONZERO; a/b ÷ 0/n → DIVISION_BY_ZERO. Fraction integer inputs and arithmetic intermediates must stay within ±(2^53−1); otherwise the API returns VALUE_OUT_OF_RANGE.
POST /api/v1/calc/subtraction
Request
{
  "inputs": {
    "minuend": 245,
    "subtrahend": 147
  }
}
Returns
{ "solve_for": "difference", "value": 98, "formula": "a − b = d", … }
Share URL: /calc/math/subtraction?minInput=245&subInput=147&mode=difference. Solve-for: omit minuend to get ? − 6 = 9 → 15. Long mode (mode=long) keeps the minuend on top; 45 − 123 = −78. MCP capability: math.subtraction.
POST /api/v1/calc/add
Request
{
  "inputs": {
    "sumInput": "1,2,3"
  }
}
Returns
{ "value": 6, "sum": 6, … }
Share URL: /calc/math/add?sumInput=1,2,3. MCP capability: math.sum.
POST /api/v1/calc/multiplication
Request
{
  "inputs": {
    "a": 8,
    "b": 6
  }
}
Returns
{
  "product": 48,
  "productStr": "48",
  "mode": "product"
}
Share URL: /calc/math/multiplication?a=8&b=6. MCP capability: math.multiplication. Long mode (mode: "long") adds partial-product work. Missing a or b → INVALID_INPUT.
POST /api/v1/calc/division
Request
{
  "inputs": {
    "a": 20,
    "b": 4
  }
}
Returns
{ "mode": "quotient", "value": 5, … }
Share URL: /calc/math/division?a=20&b=4. MCP capability: math.divide. b = 0 → DIVISION_BY_ZERO.
POST /api/v1/calc/exponential-growth
Request
{
  "inputs": {
    "x0": 100,
    "ratePct": 5,
    "t": 2
  }
}
Returns
110.25
Share URL: /calc/math/exponential-growth?x0=100&ratePct=5&t=2. MCP capability: math.exponential_growth. Periodic model requires ratePct > −100.
POST /api/v1/calc/scientific-notation
Request
{
  "inputs": {
    "mode": "convert",
    "value": 12300
  }
}
Returns
{
  "mode": "convert",
  "coef": 1.23,
  "exp": 4,
  "value": 12300
}
Share URL: /calc/math/scientific-notation?mode=convert&value=12300 (numInput is a share-URL alias, not an Agent field). MCP/Agent modes are only convert / engineering / normalize / operate. REST still accepts dec-sci / sci-dec as legacy adapter aliases. MCP capability: math.scientific_notation.

Grade

Call with (id) Resolves to engine Inputs (summary) Page
gpa gpa mode (courses / quick / planner), scale (4.33 / 4.0; legacy custom = 4.33 base), optional aplus (A+ overlay on the selected base), courses or totals / planner fields /calc/grade/gpa
final-grade final-grade mode (need / overall / weighted / points), currentInput, goalInput, weightInput (and mode-specific fields) /calc/grade/final-grade · MCP education.final_grade

Courses mode accepts courses as an array of { name?, credits, grade } or compact name:credits:grade rows.

Empty dataset is a valid non-result, not an input error. Zero counted credits return HTTP 200 with { gpa: null, status: "empty" } — never NaN. Negative credits, incomplete prior GPA/credits, or planner A = 0 return engine status: "invalid" with a code (CREDITS_OUT_OF_RANGE, PRIOR_CREDITS_REQUIRED, ADDITIONAL_CREDITS_MUST_BE_POSITIVE, …). Unknown scale ids canonicalize to 4.33; a filled aplus replaces A+ only and keeps other letters on the selected 4.33 or 4.0 base (scale=custom is the legacy 4.33-base alias).

Planner mode adds reachability (secured / attainable / unreachable), unreachable, minAdditionalCredits, and unreachableExact when the target equals the selected scale maximum while current GPA is below it (no finite credit load hits the exact cap; limitApproaches is the scale maximum).

Need-on-final uses Needed = (Goal×100 − Current×(100−W)) / W. W = 0 returns { status: "invalid", code: "WEIGHT_REQUIRED" }. Results include reachability: attainable, unreachable (> 100%), or secured (≤ 0%). Share URL example: /calc/grade/final-grade?currentInput=85&goalInput=90&weightInput=40&mode=need. MCP: search_capabilities → inspect_capability → execute_calculation with capability_id: "education.final_grade" (pin 1.1.1).

Dev / data helpers

engineId Inputs Result
base64 mode (encode / decode), text Encoded or decoded string
url-codec mode (encode / decode), text URL-encoded string
ascii char dec, hex, bin
http-status code Status metadata
hex-to-rgb hex r, g, b
rgb-to-hex r, g, b #RRGGBB
base-convert value, fromBase, toBase Converted string

Versioning

api_contract_version is 1.0.0. It bumps only when the HTTP response shape or engine contract breaks callers.

Each tool response sets calculation_version / spec_version from that tool's on-page Spec (for example Amps to VA is 1.4.3). Pin integrations against both the numeric result and the tool version. See Versioning & trust.

Limits and beta notes

  • No authentication or per-key quota yet — do not hammer the endpoint. Rate limits: Errors.
  • Engines throw on illegal inputs → HTTP 400 with an error message.
  • Image converters and similar UI-only tools are not in this API.
  • Prefer page aliases (amps-to-kw) in integrations so URLs match the site; engine in the response tells you what ran.
  • MCP execute_calculation covers the core capability catalog, including education.final_grade, math.factorial, math.fractions, math.gcf, math.lcm, and math.ratio. Registry engines such as gpa and antilog are available on REST POST /api/v1/calc/:id even when they are not yet MCP capabilities.

See also

Capability engine catalog

Generated from the capability registry (GET /.well-known/calculatorx-capabilities.json). Every electrical.* MCP tool is listed here — including adc-error-budget. Prefer this table over hand-maintained summaries when discovering Agent endpoints.

Call with (id)CapabilityVersionPage
ac-dc-rectifierelectrical.ac_dc_rectifier1.1.2/calc/electric/ac-dc-rectifier
adc-error-budgetelectrical.adc.error_budget1.0.0/calc/electric/adc-error-budget
adc-snrelectrical.adc.snr1.1.0/calc/electric/adc-snr
amps-to-kwelectrical.amps_to_kw1.4.3/calc/electric/amps-to-kw
amps-to-vaelectrical.apparent_power1.4.3/calc/electric/amps-to-va
amps-to-voltselectrical.amps_to_volts1.4.2/calc/electric/amps-to-volts
antenna-lengthelectrical.rf.antenna_length1.0.3/calc/electric/antenna-length
awg-to-mmelectrical.awg_to_mm1.5.0/calc/wire/awg-to-mm
battery-agingelectrical.battery.aging1.0.2/calc/electric/battery-aging
battery-pack-sizingelectrical.battery.pack_sizing1.2.0/calc/electric/battery-pack-sizing
battery-runtimeelectrical.battery_runtime1.2.1/calc/electric/battery-runtime
battery-runtime-tempelectrical.battery.runtime_temp1.2.1/calc/electric/battery-runtime-temp
buck-rippleelectrical.buck.ripple1.1.0/calc/electric/buck-ripple
capacitanceelectrical.capacitance1.1.0/calc/electric/capacitance
cascaded-nfelectrical.rf.cascaded_nf1.1.1/calc/electric/cascaded-nf
coax-impedanceelectrical.rf.coax1.0.1/calc/electric/coax-impedance
current-dividerelectrical.current_divider1.0.2/calc/electric/current-divider
diode-equationelectrical.diode.equation1.1.0/calc/electric/diode-equation
electricityelectrical.electricity_bill1.3.1/calc/electric/electricity
energy-consumptionelectrical.energy_consumption1.4.2/calc/electric/energy-consumption
energy-costelectrical.energy_cost1.4.2/calc/electric/energy-cost
ev-to-voltselectrical.ev_voltage1.3.0/calc/electric/ev-to-volts
fsplelectrical.rf.fspl1.0.0/calc/electric/fspl
gamma-zelectrical.rf.gamma_z1.0.0/calc/electric/gamma-z
heatsink-rthelectrical.thermal.heatsink_rth1.1.0/calc/electric/heatsink-rth
hpfelectrical.hpf1.0.0/calc/electric/hpf
kirchhoffelectrical.kirchhoff1.0.0/calc/electric/kirchhoff
kva-to-ampselectrical.kva_to_amps1.4.1/calc/electric/kva-to-amps
kva-to-kwelectrical.kva_to_kw1.4.1/calc/electric/kva-to-kw
kw-to-vaelectrical.kw_to_va1.3.1/calc/electric/kw-to-va
kwh-to-kwelectrical.kwh_to_kw1.2.1/calc/electric/kwh-to-kw
kwh-to-wattselectrical.kwh_to_watts1.2.1/calc/electric/kwh-to-watts
lc-matchelectrical.rf.lc_match1.0.0/calc/electric/lc-match
ldo-thermalelectrical.ldo.thermal1.0.0/calc/electric/ldo-thermal
led-resistorelectrical.led_resistor1.0.0/calc/electric/led-resistor
logic-gateelectrical.digital.logic_gate1.0.0/calc/electric/logic-gate
lpfelectrical.lpf1.0.0/calc/electric/lpf
mah-to-whelectrical.mah_to_wh1.3.1/calc/electric/mah-to-wh
mosfet-conduction-losselectrical.mosfet.conduction_loss1.2.2/calc/electric/mosfet-conduction-loss
mosfet-switching-losselectrical.mosfet.switching_loss1.0.0/calc/electric/mosfet-switching-loss
mosfet-tjelectrical.mosfet.tj1.1.2/calc/electric/mosfet-tj
mosfet-total-losselectrical.mosfet.total_loss1.1.2/calc/electric/mosfet-total-loss
mosfet-vthelectrical.mosfet.vth1.3.1/calc/electric/mosfet-vth
ohms-lawelectrical.ohms_law1.5.1/calc/electric/ohms-law
opamp-error-budgetelectrical.opamp.error_budget1.0.0/calc/electric/opamp-error-budget
opamp-gainelectrical.opamp_gain1.0.0/calc/electric/opamp-gain
opamp-noiseelectrical.opamp.noise1.0.0/calc/electric/opamp-noise
parallel-resistorelectrical.parallel_resistor1.0.0/calc/electric/parallel-resistor
pcb-diff-impedanceelectrical.pcb.diff_impedance1.0.0/calc/electric/pcb-diff-impedance
pcb-microstripelectrical.pcb.microstrip1.0.0/calc/electric/pcb-microstrip
pcb-striplineelectrical.pcb.stripline1.0.0/calc/electric/pcb-stripline
pcb-trace-thermalelectrical.pcb.trace_thermal1.0.0/calc/electric/pcb-trace-thermal
pcb-trace-widthelectrical.pcb.trace_width1.1.1/calc/electric/pcb-trace-width
pcb-via-currentelectrical.pcb.via_current1.0.0/calc/electric/pcb-via-current
powerelectrical.power1.3.0/calc/electric/power
power-factorelectrical.power_factor1.5.1/calc/electric/power-factor
rc-time-constantelectrical.rc_time_constant1.0.0/calc/electric/rc-time-constant
receiver-sensitivityelectrical.rf.receiver_sensitivity1.0.0/calc/electric/receiver-sensitivity
rectifier-ripple-capelectrical.rectifier.ripple_cap1.0.0/calc/electric/rectifier-ripple-cap
resistor-colorelectrical.resistor_color_code1.0.0/calc/electric/resistor-color-code
rf-link-budgetelectrical.rf.link_budget1.1.1/calc/electric/rf-link-budget
rlc-resonanceelectrical.rlc_resonance1.0.0/calc/electric/rlc-resonance
series-capacitorelectrical.series_capacitor1.0.0/calc/electric/series-capacitor
skin-depthelectrical.rf.skin_depth1.0.0/calc/electric/skin-depth
smith-chartelectrical.rf.smith1.6.3/calc/electric/smith-chart
swg-to-mmelectrical.swg_to_mm1.3.1/calc/wire/swg-to-mm
timer-555electrical.timer_5551.2.0/calc/electric/timer-555
transformer-sizingelectrical.transformer_sizing1.0.0/calc/electric/transformer-sizing
va-to-kvaelectrical.va_to_kva1.3.1/calc/electric/va-to-kva
voltage-dividerelectrical.voltage_divider1.5.1/calc/electric/voltage-divider
voltage-dropelectrical.voltage_drop1.5.2/calc/wire/voltage-drop
volts-to-jouleselectrical.volts_to_joules1.2.0/calc/electric/volts-to-joules
volts-to-kwelectrical.volts_to_kw1.3.1/calc/electric/volts-to-kw
vswrelectrical.rf.vswr1.0.0/calc/electric/vswr
watt-volt-ampelectrical.watt_volt_amp1.5.1/calc/electric/watt-volt-amp
watts-to-ampselectrical.watts_amps1.4.1/calc/electric/watts-to-amps
watts-to-jouleselectrical.watts_to_joules1.2.1/calc/electric/watts-to-joules
watts-to-kvaelectrical.watts_to_kva1.3.1/calc/electric/watts-to-kva
watts-to-vaelectrical.watts_to_va1.3.1/calc/electric/watts-to-va
watts-to-voltselectrical.watts_to_volts1.3.1/calc/electric/watts-to-volts
wavelengthelectrical.rf.wavelength1.0.0/calc/electric/wavelength
wheatstone-bridgeelectrical.wheatstone1.0.0/calc/electric/wheatstone-bridge