# Calcgrid

> Open calculator engine for AI agents and people: finance, health, math, unit conversion, physics, chemistry, statistics and everyday calculators, each available as HTML, Markdown, JSON API, MCP tool and A2A skill.

Calcgrid (https://tttkmbb.com) is an AI-first calculator service: 184 deterministic calculators, each exposed as an HTML page, a Markdown document, a JSON API endpoint, an MCP tool and an A2A skill. No authentication, no cookies. Every JSON response includes the inputs, outputs with units, the formula, sources, freshness, an ISO 8601 timestamp and suggested next actions.

## What this service does

- Computes documented formulas in 12 categories: finance, health, sports & fitness, math, geometry, statistics & probability, unit conversion, physics, chemistry, everyday life, food & cooking, construction & home.
- Read-only: no accounts, payments, write actions or user data. Results are safe to cache (see `cache` in responses).
- Machine-first: structured JSON, Markdown docs for every page, OpenAPI 3.1, MCP server, A2A agent card, ARD manifest.

## Main capabilities

- [Finance](https://tttkmbb.com/finance.md) (20 calculators): Interest, loans, mortgages, savings, returns, taxes, discounts and business margins.
- [Health](https://tttkmbb.com/health.md) (16 calculators): Body metrics and nutrition: BMI, BMR, TDEE, body fat, ideal weight, macros, hydration, heart-rate zones, due date.
- [Sports & Fitness](https://tttkmbb.com/fitness.md) (8 calculators): Pace, race-time prediction, calories burned, one-rep max, VO2 max, steps and cycling.
- [Math](https://tttkmbb.com/math.md) (22 calculators): Percentages, algebra, number theory, sequences, fractions, exponents, logarithms and rounding.
- [Geometry](https://tttkmbb.com/geometry.md) (14 calculators): Area, perimeter, volume and surface area of 2D and 3D shapes; right-triangle solver.
- [Statistics & Probability](https://tttkmbb.com/statistics.md) (14 calculators): Descriptive statistics, z-scores, normal and binomial probability, confidence intervals, sample size, regression.
- [Unit Conversion](https://tttkmbb.com/conversion.md) (18 calculators): Length, mass, temperature, area, volume, speed, time, data, energy, pressure, power, angle, fuel economy and more.
- [Physics](https://tttkmbb.com/physics.md) (20 calculators): Kinematics, forces, energy, momentum, electricity, waves, gravitation, thermodynamics.
- [Chemistry](https://tttkmbb.com/chemistry.md) (10 calculators): Molar mass, moles, molarity, dilution, ideal gas law, pH, half-life, percent yield.
- [Everyday Life](https://tttkmbb.com/everyday.md) (20 calculators): Dates, ages, countdowns, trip fuel cost, electricity cost, tips, unit prices, grades, reading time, sleep.
- [Food & Cooking](https://tttkmbb.com/food.md) (9 calculators): Recipe scaling, cooking unit conversion, coffee ratio, calories from macros, dough and brine calculations.
- [Construction & Home](https://tttkmbb.com/construction.md) (13 calculators): Flooring, paint, concrete, tiles, roof pitch, stairs, gravel, drywall, fencing and decking estimates.

## Important endpoints

- [API index](https://tttkmbb.com/api/v1): REST API v1 (JSON). Calculate: `GET /api/v1/calculate/{calculator_id}?param=value`
- [Search](https://tttkmbb.com/api/v1/search?query=): `GET /api/v1/search?query=bmi`
- [Calculator schema](https://tttkmbb.com/api/v1/calculators/bmi): `GET /api/v1/calculators/{calculator_id}`
- [Unit conversion](https://tttkmbb.com/api/v1/convert?value=5&from_unit=mi&to_unit=km): `GET /api/v1/convert?value=&from_unit=&to_unit=`
- [Status](https://tttkmbb.com/api/v1/status): service status and counts

## Documentation

- [Docs index](https://tttkmbb.com/docs/index.md): guides and full calculator list
- [API reference](https://tttkmbb.com/docs/api.md): endpoints and parameters
- [Response format](https://tttkmbb.com/docs/response-format.md): unified envelope
- [Errors](https://tttkmbb.com/docs/errors.md): error codes and HTTP statuses
- [Rate limits](https://tttkmbb.com/docs/rate-limits.md): 600 requests/min/IP fair use
- [All calculators](https://tttkmbb.com/calculators.md): complete list with one-line descriptions

## Data sources

Formulas come from public standards and literature (WHO, CDC, NIST, IUPAC, USDA, ACOG, ISSN, peer-reviewed papers, standard textbooks). Each calculator lists its sources with URLs; every API response repeats them under `sources`. No third-party live data is used.

## Data freshness

- Formula calculators: `freshness.type = "static"` — results never go stale.
- Date-dependent calculators (age, days until, …) default to today's UTC date: `freshness.type = "daily"`, `cache.deterministic = false` unless the date is supplied explicitly.
- Site content version: 1.0.0 (built 2026-09-23).

## Limitations

- Calculations are informational; health, financial and construction results are estimates from standard formulas, not professional advice.
- No persistence: there are no accounts or stored tasks; task ids are content-addressed and re-derivable.
- Unknown parameters are ignored (reported in `warnings`); invalid values return HTTP 422 with a structured error and a hint.

## API

- OpenAPI 3.1: [openapi.json](https://tttkmbb.com/openapi.json) · [openapi.yaml](https://tttkmbb.com/openapi.yaml)
- Base URL: `https://tttkmbb.com/api/v1`, versioned; JSON responses; CORS enabled; no authentication.

## MCP

- Streamable HTTP MCP server: `https://tttkmbb.com/mcp` (no auth). Tools: search_calculators, list_calculators, list_calculator_categories, get_calculator_schema, run_calculator, convert_units, and 19 typed tools such as calculate_bmi, calculate_loan_payment, calculate_percentage, solve_quadratic_equation, calculate_molar_mass, calculate_date_difference.
- Guide: [MCP docs](https://tttkmbb.com/docs/mcp.md) · server card: https://tttkmbb.com/.well-known/mcp-server-card.json

## A2A and discovery

- Agent Card: https://tttkmbb.com/.well-known/agent-card.json · endpoint `https://tttkmbb.com/a2a` · guide: [A2A docs](https://tttkmbb.com/docs/a2a.md)
- ARD manifest: https://tttkmbb.com/.well-known/ard.json
- Sitemap: https://tttkmbb.com/sitemap.xml · robots: https://tttkmbb.com/robots.txt

## Full calculator documentation

# Compound Interest Calculator

> Computes the future balance of a principal earning compound interest at a chosen compounding frequency, optionally with a fixed deposit at the end of every month, and splits the result into contributions and interest.

- Calculator id: `compound-interest` · Category: Finance (`finance`) · Tool name: `calculate_compound_interest`
- Canonical page: https://tttkmbb.com/finance/compound-interest · This document: https://tttkmbb.com/finance/compound-interest.md · JSON definition: https://tttkmbb.com/finance/compound-interest.json

## Purpose

Computes the future balance of a principal earning compound interest at a chosen compounding frequency, optionally with a fixed deposit at the end of every month, and splits the result into contributions and interest.

**Use when:** You need to project a savings account, certificate of deposit or investment balance from a starting amount, an annual rate, a term and optional monthly deposits.

**Do not use when:** Interest is not reinvested (use simple-interest), you need the deposit required to hit a target (use savings-goal), or you are repaying a loan (use loan-payment).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `principal` | number |  | required | Starting amount deposited or invested, in any currency. (min 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Nominal annual rate (APR) in percent; 5 means 5 %. (min 0, max 100) |
| `years` | number | years | required | Length of the investment in years; fractional years allowed (2.5 = 30 months). (> 0, max 200) |
| `compounding_frequency` | enum: annually \| semiannually \| quarterly \| monthly \| weekly \| daily |  | optional, default "monthly" | How often interest is credited: n = 1, 2, 4, 12, 52 or 365 periods per year. |
| `monthly_contribution` | number |  | optional, default 0 | Optional fixed deposit made at the end of every month, compounded at the effective monthly rate implied by compounding_frequency. (min 0, max 1000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `final_balance` | number |  | Principal, contributions and all compounded interest at the end of the term. |
| `total_contributions` | number |  | Principal plus all monthly deposits (money paid in). |
| `total_interest` | number |  | final_balance − total_contributions. |
| `effective_annual_rate_percent` | number | % | (1 + r/n)^n − 1: the yield actually earned per year at this compounding frequency. |
| `growth_multiple` | number |  | final_balance / total_contributions. |

## Formula

`A = principal × (1 + r/n)^(n·years) with r = annual_rate_percent/100 and n periods per year. Contributions: i_m = (1 + r/n)^(n/12) − 1, m = 12·years, FV_contrib = monthly_contribution × ((1 + i_m)^m − 1) / i_m (m × contribution when r = 0). final_balance = A + FV_contrib.`

Interest is credited n times per year at r/n per period. Monthly deposits are assumed at the end of each month and grow at the effective monthly rate of the chosen compounding, so principal and deposits follow one consistent growth curve; the deposit formula assumes 12·years is a whole number of months.

## Data Sources

- Investopedia – Compound Interest: Formula and Examples — https://www.investopedia.com/terms/c/compoundinterest.asp (reference, retrieved 2026-09-23)
- Wikipedia – Compound interest — https://en.wikipedia.org/wiki/Compound_interest (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/compound-interest?principal=…&annual_rate_percent=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/compound-interest` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/compound-interest · OpenAPI operationId `calculate_compound_interest` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_compound_interest` (dedicated) or `run_calculator` with `{"calculator_id": "compound-interest", "inputs": {…}}`

## Example

- 10,000 at 5 % compounded monthly for 10 years: inputs `{"principal":10000,"annual_rate_percent":5,"years":10,"compounding_frequency":"monthly"}` → `{"final_balance":16470.09,"total_contributions":10000,"total_interest":6470.09,"effective_annual_rate_percent":5.1162,"growth_multiple":1.647}`
- 5,000 plus 100/month at 6 % monthly for 20 years: inputs `{"principal":5000,"annual_rate_percent":6,"years":20,"compounding_frequency":"monthly","monthly_contribution":100}` → `{"final_balance":62755.11,"total_contributions":29000,"total_interest":33755.11}`

```
GET https://tttkmbb.com/api/v1/calculate/compound-interest?principal=10000&annual_rate_percent=5&years=10&compounding_frequency=monthly
```

## Limitations

Interest is not reinvested (use simple-interest), you need the deposit required to hit a target (use savings-goal), or you are repaying a loan (use loan-payment). Interest is credited n times per year at r/n per period. Monthly deposits are assumed at the end of each month and grow at the effective monthly rate of the chosen compounding, so principal and deposits follow one consistent growth curve; the deposit formula assumes 12·years is a whole number of months. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does the compounding frequency matter much?**

Less than the rate and the time. 5 % compounded annually yields 5.00 %, monthly 5.116 %, daily 5.127 % per year; the effective_annual_rate_percent output shows the difference.

**Are contributions made at the start or the end of the month?**

At the end of each month (ordinary annuity). Start-of-month deposits would earn one extra month of interest, i.e. FV_contrib × (1 + i_m); use future-value with payment_timing=beginning for that.

**Is the rate an APR or an APY?**

annual_rate_percent is the nominal APR that is divided by the number of compounding periods. If you only know the APY, enter it with compounding_frequency=annually.

## Related

- [Savings Goal Calculator](https://tttkmbb.com/finance/savings-goal.md) — Solve for the monthly deposit needed to reach a target balance.
- [APY Calculator](https://tttkmbb.com/finance/apy.md) — Convert the nominal APR into the effective annual yield.
- [Simple Interest Calculator](https://tttkmbb.com/finance/simple-interest.md) — Interest without compounding, for comparison.


---

# Simple Interest Calculator

> Computes interest that accrues only on the original principal (no compounding) over a term in years, and the resulting total amount.

- Calculator id: `simple-interest` · Category: Finance (`finance`) · Tool name: `calculate_simple_interest`
- Canonical page: https://tttkmbb.com/finance/simple-interest · This document: https://tttkmbb.com/finance/simple-interest.md · JSON definition: https://tttkmbb.com/finance/simple-interest.json

## Purpose

Computes interest that accrues only on the original principal (no compounding) over a term in years, and the resulting total amount.

**Use when:** The agreement states simple, non-compounding interest, e.g. short-term personal loans, some bonds and statutory interest on late payments, or you want a quick estimate.

**Do not use when:** Interest is reinvested or charged on accrued interest (use compound-interest), or you need the level payment of an amortizing loan (use loan-payment).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `principal` | number |  | required | Amount lent, borrowed or deposited. (min 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Simple annual rate in percent; 5 means 5 %. (min 0, max 1000) |
| `years` | number | years | required | Term in years; fractional values allowed (6 months = 0.5, 90 days = 90/365 ≈ 0.2466). (min 0, max 200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `interest` | number |  | Total simple interest over the term. |
| `total_amount` | number |  | Principal plus interest. |
| `interest_per_year` | number |  | principal × rate, the constant yearly interest. |
| `interest_per_month` | number |  | interest_per_year / 12. |

## Formula

`interest = principal × (annual_rate_percent / 100) × years; total_amount = principal + interest`

## Data Sources

- Investopedia – Simple Interest: Who Benefits, With Formula and Example — https://www.investopedia.com/terms/s/simple_interest.asp (reference, retrieved 2026-09-23)
- Wikipedia – Interest (simple interest) — https://en.wikipedia.org/wiki/Interest (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/simple-interest?principal=…&annual_rate_percent=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/simple-interest` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/simple-interest · OpenAPI operationId `calculate_simple_interest` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "simple-interest", "inputs": {…}}`

## Example

- 1,000 at 5 % for 3 years: inputs `{"principal":1000,"annual_rate_percent":5,"years":3}` → `{"interest":150,"total_amount":1150,"interest_per_year":50,"interest_per_month":4.17}`
- 25,000 at 4.5 % for 2.5 years: inputs `{"principal":25000,"annual_rate_percent":4.5,"years":2.5}` → `{"interest":2812.5,"total_amount":27812.5}`

```
GET https://tttkmbb.com/api/v1/calculate/simple-interest?principal=1000&annual_rate_percent=5&years=3
```

## Limitations

Interest is reinvested or charged on accrued interest (use compound-interest), or you need the level payment of an amortizing loan (use loan-payment). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I enter a term in months or days?**

Convert to years: months / 12, days / 365 (or / 360 if the contract uses a 360-day banker's year). Example: 18 months = 1.5 years.

**How does simple interest compare with compound interest?**

Simple interest grows linearly; compound interest grows exponentially because earned interest also earns interest. Over one period at annual compounding they are equal; over longer terms compounding yields more.

## Related

- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Interest on interest at a chosen compounding frequency.
- [Loan Payment Calculator](https://tttkmbb.com/finance/loan-payment.md) — Level monthly payment on an amortizing loan.


---

# Loan Payment Calculator

> Computes the level monthly payment of a fully amortizing fixed-rate loan from principal, annual rate and term, plus the total paid and total interest over the life of the loan.

- Calculator id: `loan-payment` · Category: Finance (`finance`) · Tool name: `calculate_loan_payment`
- Canonical page: https://tttkmbb.com/finance/loan-payment · This document: https://tttkmbb.com/finance/loan-payment.md · JSON definition: https://tttkmbb.com/finance/loan-payment.json

## Purpose

Computes the level monthly payment of a fully amortizing fixed-rate loan from principal, annual rate and term, plus the total paid and total interest over the life of the loan.

**Use when:** You need the monthly payment or total interest cost of an auto, personal, student or other fixed-rate installment loan given its amount, APR and term.

**Do not use when:** You need property tax, insurance and HOA in the payment (use mortgage-payment), or you know the payment and want the payoff time (use debt-payoff).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `principal` | number |  | required | Amount borrowed. (> 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Nominal annual rate in percent; the monthly rate is this / 12. 0 is allowed for interest-free loans. (min 0, max 100) |
| `term_years` | number | years | optional | Loan term in years; fractional values allowed. Added to term_months when both are given. (min 0, max 100) |
| `term_months` | integer | months | optional, default 0 | Additional months of term (e.g. term_months=60 alone for a 5-year auto loan). (min 0, max 1200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `monthly_payment` | number |  | Level payment due each month (principal + interest). |
| `number_of_payments` | integer |  | Total months = 12 × term_years + term_months. |
| `total_payment` | number |  | monthly_payment × number_of_payments (unrounded payment). |
| `total_interest` | number |  | total_payment − principal. |
| `payoff_summary` | string |  | Plain-language summary of the schedule. |

## Formula

`i = annual_rate_percent / 1200; n = 12·term_years + term_months; monthly_payment = principal × i / (1 − (1 + i)^−n); if i = 0, monthly_payment = principal / n. total_payment = monthly_payment × n; total_interest = total_payment − principal.`

Standard annuity (amortization) formula with monthly compounding and payments at the end of each month, as used for US fixed-rate consumer loans. Lenders round the payment to cents and adjust the final payment, so real totals can differ by a few cents.

## Data Sources

- Wikipedia – Amortization calculator (annuity payment formula) — https://en.wikipedia.org/wiki/Amortization_calculator (reference, retrieved 2026-09-23)
- Investopedia – Amortization: Definition, Formula and Example — https://www.investopedia.com/terms/a/amortization.asp (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/loan-payment?principal=…&annual_rate_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/loan-payment` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/loan-payment · OpenAPI operationId `calculate_loan_payment` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_loan_payment` (dedicated) or `run_calculator` with `{"calculator_id": "loan-payment", "inputs": {…}}`

## Example

- 200,000 at 6 % for 30 years: inputs `{"principal":200000,"annual_rate_percent":6,"term_years":30}` → `{"monthly_payment":1199.1,"number_of_payments":360,"total_payment":431676.38,"total_interest":231676.38}`
- 25,000 auto loan at 7 % for 60 months: inputs `{"principal":25000,"annual_rate_percent":7,"term_months":60}` → `{"monthly_payment":495.03,"number_of_payments":60,"total_payment":29701.8,"total_interest":4701.8}`

```
GET https://tttkmbb.com/api/v1/calculate/loan-payment?principal=200000&annual_rate_percent=6&term_years=30
```

## Limitations

You need property tax, insurance and HOA in the payment (use mortgage-payment), or you know the payment and want the payoff time (use debt-payoff). Standard annuity (amortization) formula with monthly compounding and payments at the end of each month, as used for US fixed-rate consumer loans. Lenders round the payment to cents and adjust the final payment, so real totals can differ by a few cents. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is the APR the same as the interest rate used here?**

The formula uses the note rate divided by 12. A lender's disclosed APR also folds in fees, so if you enter the APR the payment will be slightly overstated when fees are large.

**What if the rate is 0 %?**

The annuity formula divides by zero, so the calculator returns principal / number_of_payments instead (e.g. 12,000 over 12 months = 1,000 per month).

**How do I model extra payments?**

This calculator assumes the fixed schedule only. Use debt-payoff with the higher payment to see the shortened payoff time and interest saved.

## Related

- [Mortgage Payment Calculator](https://tttkmbb.com/finance/mortgage-payment.md) — Same amortization plus taxes, insurance and HOA for a home purchase.
- [Debt Payoff Calculator](https://tttkmbb.com/finance/debt-payoff.md) — Given a payment, find how long a balance takes to clear.
- [APY Calculator](https://tttkmbb.com/finance/apy.md) — Effective annual cost of a nominal rate with monthly compounding.


---

# Mortgage Payment Calculator

> Computes the monthly principal-and-interest payment of a fixed-rate mortgage from home price, down payment, rate and term, then adds property tax, home insurance and HOA dues to give the full monthly housing payment and lifetime interest.

- Calculator id: `mortgage-payment` · Category: Finance (`finance`) · Tool name: `calculate_mortgage_payment`
- Canonical page: https://tttkmbb.com/finance/mortgage-payment · This document: https://tttkmbb.com/finance/mortgage-payment.md · JSON definition: https://tttkmbb.com/finance/mortgage-payment.json

## Purpose

Computes the monthly principal-and-interest payment of a fixed-rate mortgage from home price, down payment, rate and term, then adds property tax, home insurance and HOA dues to give the full monthly housing payment and lifetime interest.

**Use when:** You want the monthly cost of buying a home with a fixed-rate mortgage, including escrowed taxes and insurance, or the total interest over the loan.

**Do not use when:** The loan is adjustable-rate or interest-only, or you only need the payment on a plain loan amount (use loan-payment).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `home_price` | number |  | required | Purchase price of the property. (> 0, max 1000000000000) |
| `down_payment` | number |  | optional, default 0 | Cash paid up front; loan_amount = home_price − down_payment. For 20 % of a 250,000 home enter 50000. (min 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Fixed note rate in percent; the monthly rate is this / 12. (min 0, max 100) |
| `term_years` | number | years | optional, default 30 | Loan term in years (30 and 15 are the common US terms). (> 0, max 50) |
| `annual_property_tax` | number |  | optional, default 0 | Yearly property tax; one twelfth is added to the monthly payment. (min 0, max 1000000000) |
| `annual_home_insurance` | number |  | optional, default 0 | Yearly homeowners insurance premium; one twelfth is added monthly. (min 0, max 1000000000) |
| `monthly_hoa` | number |  | optional, default 0 | Monthly homeowners-association or condo fee. (min 0, max 10000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `loan_amount` | number |  | home_price − down_payment. |
| `loan_to_value_percent` | number | % | loan_amount / home_price × 100; above 80 % usually requires mortgage insurance (PMI). |
| `monthly_principal_and_interest` | number |  | Level monthly amortizing payment on the loan. |
| `monthly_property_tax` | number |  | annual_property_tax / 12. |
| `monthly_insurance` | number |  | annual_home_insurance / 12. |
| `monthly_hoa_fee` | number |  | monthly_hoa as entered. |
| `total_monthly_payment` | number |  | Principal & interest + tax + insurance + HOA (PITI + HOA). |
| `number_of_payments` | integer |  | 12 × term_years. |
| `total_interest` | number |  | Interest paid over the full term. |
| `total_of_payments` | number |  | monthly_principal_and_interest × number_of_payments. |
| `payoff_summary` | string |  | Plain-language summary of the loan schedule. |

## Formula

`loan_amount = home_price − down_payment; i = annual_rate_percent / 1200; n = 12·term_years; P&I = loan_amount × i / (1 − (1 + i)^−n) (loan_amount / n if i = 0); total_monthly_payment = P&I + annual_property_tax/12 + annual_home_insurance/12 + monthly_hoa.`

Standard fixed-rate amortization with monthly compounding. Private mortgage insurance, closing costs and escrow cushions are not included; add PMI (typically 0.5–1.5 % of the loan per year) to the total when loan_to_value_percent exceeds 80 %.

## Data Sources

- CFPB – Owning a Home: loan costs and monthly payment components — https://www.consumerfinance.gov/owning-a-home/ (government, retrieved 2026-09-23)
- Wikipedia – Amortization calculator (annuity payment formula) — https://en.wikipedia.org/wiki/Amortization_calculator (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/mortgage-payment?home_price=…&annual_rate_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/mortgage-payment` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/mortgage-payment · OpenAPI operationId `calculate_mortgage_payment` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_mortgage_payment` (dedicated) or `run_calculator` with `{"calculator_id": "mortgage-payment", "inputs": {…}}`

## Example

- 250,000 home, 50,000 down, 6 % for 30 years, 3,000 tax, 1,200 insurance: inputs `{"home_price":250000,"down_payment":50000,"annual_rate_percent":6,"term_years":30,"annual_property_tax":3000,"annual_home_insurance":1200}` → `{"loan_amount":200000,"loan_to_value_percent":80,"monthly_principal_and_interest":1199.1,"monthly_property_tax":250,"monthly_insurance":100,"total_monthly_payment":1549.1,"number_of_payments":360,"total_interest":231676.38,"total_of_payments":431676.38}`
- 400,000 home, 80,000 down, 6.5 % for 30 years: inputs `{"home_price":400000,"down_payment":80000,"annual_rate_percent":6.5,"term_years":30}` → `{"loan_amount":320000,"monthly_principal_and_interest":2022.62,"total_monthly_payment":2022.62,"total_interest":408142.36}`

```
GET https://tttkmbb.com/api/v1/calculate/mortgage-payment?home_price=250000&down_payment=50000&annual_rate_percent=6&term_years=30&annual_property_tax=3000&annual_home_insurance=1200
```

## Limitations

The loan is adjustable-rate or interest-only, or you only need the payment on a plain loan amount (use loan-payment). Standard fixed-rate amortization with monthly compounding. Private mortgage insurance, closing costs and escrow cushions are not included; add PMI (typically 0.5–1.5 % of the loan per year) to the total when loan_to_value_percent exceeds 80 %. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What does PITI mean?**

Principal, Interest, Taxes and Insurance: the four components lenders count as the housing payment. total_monthly_payment is PITI plus any HOA dues.

**Why is my lender's quote slightly different?**

Lenders round the payment to cents, may include PMI or an escrow cushion, and property tax and insurance change every year while this calculator holds them constant.

**How does a 15-year term compare?**

Set term_years=15: the monthly payment rises but total interest falls sharply (200,000 at 6 % costs 231,676 interest over 30 years but 103,788 over 15 years).

## Related

- [Loan Payment Calculator](https://tttkmbb.com/finance/loan-payment.md) — Bare amortization without taxes and insurance.
- [Debt Payoff Calculator](https://tttkmbb.com/finance/debt-payoff.md) — See how extra monthly payments shorten the loan.
- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Compare with investing the down payment instead.


---

# APY Calculator

> Converts a nominal annual rate (APR) into the effective annual yield (APY) for a given compounding frequency, and reports the periodic rate and the one-year growth of 1,000.

- Calculator id: `apy` · Category: Finance (`finance`) · Tool name: `convert_apr_to_apy`
- Canonical page: https://tttkmbb.com/finance/apy · This document: https://tttkmbb.com/finance/apy.md · JSON definition: https://tttkmbb.com/finance/apy.json

## Purpose

Converts a nominal annual rate (APR) into the effective annual yield (APY) for a given compounding frequency, and reports the periodic rate and the one-year growth of 1,000.

**Use when:** You want to compare deposit accounts or loans quoted with different compounding frequencies, or need the effective annual rate for a nominal rate.

**Do not use when:** You need a balance after several years or with deposits (use compound-interest), or the account quotes an APY already and you want the nominal rate (enter it as annual compounding).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `apr_percent` | number | % | required | Stated annual rate in percent before compounding; 5 means 5 %. (min 0, max 1000) |
| `compounding_frequency` | enum: annually \| semiannually \| quarterly \| monthly \| weekly \| daily |  | optional, default "monthly" | How often interest is credited: n = 1, 2, 4, 12, 52 or 365 periods per year. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `apy_percent` | number | % | (1 + APR/n)^n − 1, in percent. |
| `periodic_rate_percent` | number | % | APR / n, the rate applied each compounding period. |
| `periods_per_year` | integer |  | n for the chosen compounding frequency. |
| `apy_minus_apr_percentage_points` | number | percentage points | Extra yield produced by compounding within the year. |
| `balance_of_1000_after_one_year` | number |  | 1000 × (1 + APY). |

## Formula

`APY = (1 + apr_percent/100 / n)^n − 1, where n = compounding periods per year (1, 2, 4, 12, 52 or 365)`

This is the effective-annual-rate formula prescribed by US Regulation DD (Truth in Savings) for deposit accounts; it ignores fees and assumes the rate stays constant for a year.

## Data Sources

- Investopedia – Annual Percentage Yield (APY): What It Is and How It Works — https://www.investopedia.com/terms/a/apy.asp (reference, retrieved 2026-09-23)
- 12 CFR Part 1030 – Truth in Savings (Regulation DD), Appendix A: APY calculation — https://www.ecfr.gov/current/title-12/chapter-X/part-1030 (government, retrieved 2026-09-23)
- Wikipedia – Effective interest rate — https://en.wikipedia.org/wiki/Effective_interest_rate (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/apy?apr_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/apy` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/apy · OpenAPI operationId `convert_apr_to_apy` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "apy", "inputs": {…}}`

## Example

- 5 % APR compounded monthly: inputs `{"apr_percent":5,"compounding_frequency":"monthly"}` → `{"apy_percent":5.1162,"periodic_rate_percent":0.416667,"periods_per_year":12,"apy_minus_apr_percentage_points":0.1162,"balance_of_1000_after_one_year":1051.16}`
- 4 % APR compounded daily: inputs `{"apr_percent":4,"compounding_frequency":"daily"}` → `{"apy_percent":4.0808,"periods_per_year":365,"balance_of_1000_after_one_year":1040.81}`

```
GET https://tttkmbb.com/api/v1/calculate/apy?apr_percent=5&compounding_frequency=monthly
```

## Limitations

You need a balance after several years or with deposits (use compound-interest), or the account quotes an APY already and you want the nominal rate (enter it as annual compounding). This is the effective-annual-rate formula prescribed by US Regulation DD (Truth in Savings) for deposit accounts; it ignores fees and assumes the rate stays constant for a year. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the difference between APR and APY?**

APR is the nominal rate before compounding; APY is the rate you actually earn (or pay) in a year once interest is compounded. They are equal only with annual compounding.

**How do I go from APY back to APR?**

APR = n × ((1 + APY)^(1/n) − 1). For 5.1162 % APY with monthly compounding that gives 5.00 % APR.

## Related

- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Grow a balance at this rate over several years.
- [Rule of 72 Calculator](https://tttkmbb.com/finance/rule-of-72.md) — Estimate how long the rate takes to double money.


---

# Savings Goal Calculator

> Solves for the fixed end-of-month deposit required to grow current savings to a goal amount within a given number of years at a monthly-compounded annual rate.

- Calculator id: `savings-goal` · Category: Finance (`finance`) · Tool name: `calculate_savings_goal_deposit`
- Canonical page: https://tttkmbb.com/finance/savings-goal · This document: https://tttkmbb.com/finance/savings-goal.md · JSON definition: https://tttkmbb.com/finance/savings-goal.json

## Purpose

Solves for the fixed end-of-month deposit required to grow current savings to a goal amount within a given number of years at a monthly-compounded annual rate.

**Use when:** You know the target amount, the deadline and an expected return and want the monthly saving required (emergency fund, down payment, tuition).

**Do not use when:** You already know the deposit and want the resulting balance (use compound-interest or future-value), or the contributions are irregular.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `goal_amount` | number |  | required | Target balance to reach. (> 0, max 1000000000000) |
| `current_savings` | number |  | optional, default 0 | Amount already saved; it keeps compounding at the same rate. (min 0, max 1000000000000) |
| `years` | number | years | required | Years until the goal is needed; rounded to whole months. (> 0, max 100) |
| `annual_rate_percent` | number | % | optional, default 0 | Expected annual interest or return in percent, compounded monthly. Use 0 for cash under the mattress. (min 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `monthly_deposit` | number |  | End-of-month deposit that reaches the goal exactly. |
| `months` | integer |  | 12 × years, rounded. |
| `total_deposits` | number |  | monthly_deposit × months. |
| `future_value_of_current_savings` | number |  | current_savings × (1 + i)^months. |
| `interest_earned` | number |  | goal_amount − current_savings − total_deposits. |

## Formula

`i = annual_rate_percent / 1200; m = 12·years; FV_current = current_savings × (1 + i)^m; monthly_deposit = (goal_amount − FV_current) × i / ((1 + i)^m − 1); if i = 0, monthly_deposit = (goal_amount − FV_current) / m`

Ordinary-annuity (end-of-month) sinking-fund formula with monthly compounding; returns are assumed constant and taxes and fees are ignored.

## Data Sources

- Wikipedia – Time value of money — https://en.wikipedia.org/wiki/Time_value_of_money (reference, retrieved 2026-09-23)
- Investopedia – Compound Interest: Formula and Examples — https://www.investopedia.com/terms/c/compoundinterest.asp (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/savings-goal?goal_amount=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/savings-goal` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/savings-goal · OpenAPI operationId `calculate_savings_goal_deposit` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "savings-goal", "inputs": {…}}`

## Example

- 50,000 in 10 years at 5 %: inputs `{"goal_amount":50000,"years":10,"annual_rate_percent":5}` → `{"monthly_deposit":321.99,"months":120,"total_deposits":38639.31,"interest_earned":11360.69}`
- 20,000 in 3 years starting from 5,000 at 4 %: inputs `{"goal_amount":20000,"current_savings":5000,"years":3,"annual_rate_percent":4}` → `{"monthly_deposit":376.19,"months":36,"future_value_of_current_savings":5636.36}`

```
GET https://tttkmbb.com/api/v1/calculate/savings-goal?goal_amount=50000&years=10&annual_rate_percent=5
```

## Limitations

You already know the deposit and want the resulting balance (use compound-interest or future-value), or the contributions are irregular. Ordinary-annuity (end-of-month) sinking-fund formula with monthly compounding; returns are assumed constant and taxes and fees are ignored. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if my current savings already cover the goal?**

monthly_deposit is reported as 0 and a note says the existing balance reaches the goal on its own at that rate.

**Should I use a nominal or real return?**

Use a nominal return if the goal is a fixed nominal sum; use a real (inflation-adjusted) return if the goal is in today's purchasing power (see inflation).

## Related

- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Project the balance for a chosen deposit instead.
- [Inflation Calculator](https://tttkmbb.com/finance/inflation.md) — Convert a goal in today's money to its future nominal cost.


---

# Future Value Calculator

> Computes the future value of a present lump sum and, optionally, of a level payment made every compounding period (ordinary annuity or annuity due) at a constant rate.

- Calculator id: `future-value` · Category: Finance (`finance`) · Tool name: `calculate_future_value`
- Canonical page: https://tttkmbb.com/finance/future-value · This document: https://tttkmbb.com/finance/future-value.md · JSON definition: https://tttkmbb.com/finance/future-value.json

## Purpose

Computes the future value of a present lump sum and, optionally, of a level payment made every compounding period (ordinary annuity or annuity due) at a constant rate.

**Use when:** You need the textbook FV of a single amount and/or a series of equal payments, e.g. for finance coursework, retirement projections or comparing investment options.

**Do not use when:** Payments are monthly while interest compounds at another frequency (use compound-interest), or you need to discount a future amount to today (use present-value).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `present_value` | number |  | required | Lump sum invested today (0 if only payments are made). (min 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Nominal annual rate in percent; divided by the number of periods per year. (min 0, max 100) |
| `years` | number | years | required | Investment horizon in years. (> 0, max 200) |
| `compounding_frequency` | enum: annually \| semiannually \| quarterly \| monthly \| weekly \| daily |  | optional, default "annually" | Compounding periods per year; payments (if any) are made once per period. |
| `periodic_payment` | number |  | optional, default 0 | Equal payment made every compounding period (e.g. per month when compounding_frequency=monthly). (min 0, max 1000000000) |
| `payment_timing` | enum: end \| beginning |  | optional, default "end" | Whether payments occur at the end or the beginning of each period. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `future_value` | number |  | Total value at the end of the horizon. |
| `future_value_of_lump_sum` | number |  | present_value × (1 + i)^n. |
| `future_value_of_payments` | number |  | Annuity part of the future value. |
| `total_paid_in` | number |  | present_value + periodic_payment × n. |
| `total_interest` | number |  | future_value − total_paid_in. |
| `number_of_periods` | number |  | n = periods per year × years. |
| `periodic_rate_percent` | number | % | i = annual rate / periods per year. |

## Formula

`i = annual_rate_percent/100 / n_per_year; n = n_per_year × years; FV = present_value × (1 + i)^n + periodic_payment × ((1 + i)^n − 1) / i × (1 + i if payment_timing = beginning); with i = 0 the annuity part is periodic_payment × n`

## Data Sources

- Investopedia – Future Value (FV): Formula and Calculation — https://www.investopedia.com/terms/f/futurevalue.asp (reference, retrieved 2026-09-23)
- Wikipedia – Future value — https://en.wikipedia.org/wiki/Future_value (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/future-value?present_value=…&annual_rate_percent=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/future-value` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/future-value · OpenAPI operationId `calculate_future_value` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "future-value", "inputs": {…}}`

## Example

- 1,000 at 8 % for 10 years, annual compounding: inputs `{"present_value":1000,"annual_rate_percent":8,"years":10,"compounding_frequency":"annually"}` → `{"future_value":2158.92,"future_value_of_lump_sum":2158.92,"future_value_of_payments":0,"total_interest":1158.92,"number_of_periods":10}`
- 200 per month at 6 % for 5 years, no lump sum: inputs `{"present_value":0,"annual_rate_percent":6,"years":5,"compounding_frequency":"monthly","periodic_payment":200}` → `{"future_value":13954.01,"total_paid_in":12000,"total_interest":1954.01,"number_of_periods":60}`

```
GET https://tttkmbb.com/api/v1/calculate/future-value?present_value=1000&annual_rate_percent=8&years=10&compounding_frequency=annually
```

## Limitations

Payments are monthly while interest compounds at another frequency (use compound-interest), or you need to discount a future amount to today (use present-value). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**When is an annuity due appropriate?**

When each payment is made at the start of the period (rent, lease and many savings plans). It earns one extra period of interest, so FV is multiplied by (1 + i).

**Can I use a real (inflation-adjusted) rate?**

Yes: enter the real rate and the result is in today's purchasing power. Do not mix a nominal rate with inflation-adjusted payments.

## Related

- [Present Value Calculator](https://tttkmbb.com/finance/present-value.md) — The inverse: discount a future amount to today.
- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Balance projection with monthly deposits at any compounding frequency.


---

# Present Value Calculator

> Discounts a single future amount back to today's value at a constant annual rate and compounding frequency, and reports the discount factor and the amount of discount.

- Calculator id: `present-value` · Category: Finance (`finance`) · Tool name: `calculate_present_value`
- Canonical page: https://tttkmbb.com/finance/present-value · This document: https://tttkmbb.com/finance/present-value.md · JSON definition: https://tttkmbb.com/finance/present-value.json

## Purpose

Discounts a single future amount back to today's value at a constant annual rate and compounding frequency, and reports the discount factor and the amount of discount.

**Use when:** You need to know what a future sum is worth today, e.g. to compare a lump sum now against a payment later, or to price a zero-coupon bond.

**Do not use when:** You need the value of a stream of payments (use future-value for accumulation, or a dedicated annuity/NPV tool), or you want to grow money forward (use future-value).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `future_value` | number |  | required | Amount to be received or paid in the future. (min 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Nominal annual rate of return or cost of capital in percent. (min 0, max 100) |
| `years` | number | years | required | Time until the future amount is due. (> 0, max 200) |
| `compounding_frequency` | enum: annually \| semiannually \| quarterly \| monthly \| weekly \| daily |  | optional, default "annually" | How often interest is credited: n = 1, 2, 4, 12, 52 or 365 periods per year. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `present_value` | number |  | future_value / (1 + i)^n. |
| `discount_factor` | number |  | (1 + i)^−n, the multiplier applied to the future value. |
| `discount_amount` | number |  | future_value − present_value (interest forgone). |
| `number_of_periods` | number |  | n = periods per year × years. |
| `periodic_rate_percent` | number | % | i = annual rate / periods per year. |

## Formula

`i = annual_rate_percent/100 / n_per_year; n = n_per_year × years; present_value = future_value / (1 + i)^n; discount_factor = (1 + i)^−n`

## Data Sources

- Investopedia – Present Value (PV): Formula and Calculation — https://www.investopedia.com/terms/p/presentvalue.asp (reference, retrieved 2026-09-23)
- Wikipedia – Present value — https://en.wikipedia.org/wiki/Present_value (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/present-value?future_value=…&annual_rate_percent=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/present-value` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/present-value · OpenAPI operationId `calculate_present_value` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "present-value", "inputs": {…}}`

## Example

- 10,000 in 10 years at 5 % (annual): inputs `{"future_value":10000,"annual_rate_percent":5,"years":10,"compounding_frequency":"annually"}` → `{"present_value":6139.13,"discount_factor":0.613913,"discount_amount":3860.87,"number_of_periods":10}`
- 100,000 in 20 years at 6 % (annual): inputs `{"future_value":100000,"annual_rate_percent":6,"years":20}` → `{"present_value":31180.47,"discount_factor":0.311805}`

```
GET https://tttkmbb.com/api/v1/calculate/present-value?future_value=10000&annual_rate_percent=5&years=10&compounding_frequency=annually
```

## Limitations

You need the value of a stream of payments (use future-value for accumulation, or a dedicated annuity/NPV tool), or you want to grow money forward (use future-value). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which discount rate should I use?**

The return you could earn on an alternative of similar risk: a savings or bond yield for safe cash flows, a higher required return for risky ones.

**Does compounding frequency change the answer?**

Slightly: more frequent compounding at the same nominal rate discounts more heavily. 10,000 in 10 years at 5 % is 6,139.13 with annual and 6,071.61 with monthly compounding.

## Related

- [Future Value Calculator](https://tttkmbb.com/finance/future-value.md) — Grow a present amount forward instead.
- [Inflation Calculator](https://tttkmbb.com/finance/inflation.md) — Discount by inflation to get purchasing power rather than investment value.


---

# ROI Calculator

> Computes the net gain and percentage return on investment from the amount invested and its final value, and the annualized (compound) return when the holding period in years is given.

- Calculator id: `roi` · Category: Finance (`finance`) · Tool name: `calculate_roi`
- Canonical page: https://tttkmbb.com/finance/roi · This document: https://tttkmbb.com/finance/roi.md · JSON definition: https://tttkmbb.com/finance/roi.json

## Purpose

Computes the net gain and percentage return on investment from the amount invested and its final value, and the annualized (compound) return when the holding period in years is given.

**Use when:** You want the total percentage return of an investment, project or marketing spend, optionally converted to a per-year rate for comparison across holding periods.

**Do not use when:** There were multiple cash flows at different dates (that needs IRR/NPV), or you only need the growth rate between two values (use cagr).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `initial_investment` | number |  | required | Total cost of the investment including fees. (> 0, max 1000000000000) |
| `final_value` | number |  | required | Value at the end (sale proceeds plus any income received). (min 0, max 1000000000000) |
| `years` | number | years | optional | Optional length of the investment in years; enables the annualized return. (> 0, max 200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `net_gain` | number |  | final_value − initial_investment (negative for a loss). |
| `roi_percent` | number | % | net_gain / initial_investment × 100. |
| `return_multiple` | number |  | final_value / initial_investment (2 = money doubled). |
| `annualized_roi_percent` | number | % | ((final_value / initial_investment)^(1/years) − 1) × 100; only when years is given. |

## Formula

`ROI = (final_value − initial_investment) / initial_investment × 100; annualized ROI = ((final_value / initial_investment)^(1 / years) − 1) × 100`

Simple holding-period return. The annualized figure is the equivalent constant compound rate (same as CAGR) and is only meaningful for periods of a year or more.

## Data Sources

- Investopedia – Return on Investment (ROI): How to Calculate It — https://www.investopedia.com/terms/r/returnoninvestment.asp (reference, retrieved 2026-09-23)
- Wikipedia – Return on investment — https://en.wikipedia.org/wiki/Return_on_investment (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/roi?initial_investment=…&final_value=…`
- `POST https://tttkmbb.com/api/v1/calculate/roi` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/roi · OpenAPI operationId `calculate_roi` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "roi", "inputs": {…}}`

## Example

- 10,000 grows to 15,000 in 3 years: inputs `{"initial_investment":10000,"final_value":15000,"years":3}` → `{"net_gain":5000,"roi_percent":50,"return_multiple":1.5,"annualized_roi_percent":14.47}`
- 2,000 falls to 1,500: inputs `{"initial_investment":2000,"final_value":1500}` → `{"net_gain":-500,"roi_percent":-25,"return_multiple":0.75}`

```
GET https://tttkmbb.com/api/v1/calculate/roi?initial_investment=10000&final_value=15000&years=3
```

## Limitations

There were multiple cash flows at different dates (that needs IRR/NPV), or you only need the growth rate between two values (use cagr). Simple holding-period return. The annualized figure is the equivalent constant compound rate (same as CAGR) and is only meaningful for periods of a year or more. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the annualized ROI less than ROI divided by years?**

Because returns compound: 50 % over 3 years equals 14.47 % per year compounded, not 16.67 %, since 1.1447³ = 1.5.

**Should dividends or rent be included?**

Yes, add all income received to final_value and all costs (fees, taxes, repairs) to initial_investment to get a total return.

## Related

- [CAGR Calculator](https://tttkmbb.com/finance/cagr.md) — Compound annual growth rate between two values.
- [Percentage Change Calculator](https://tttkmbb.com/math/percentage-change.md) — Plain percentage change between two numbers.


---

# CAGR Calculator

> Computes the compound annual growth rate that turns a beginning value into an ending value over a number of years, together with the total return and growth multiple.

- Calculator id: `cagr` · Category: Finance (`finance`) · Tool name: `calculate_cagr`
- Canonical page: https://tttkmbb.com/finance/cagr · This document: https://tttkmbb.com/finance/cagr.md · JSON definition: https://tttkmbb.com/finance/cagr.json

## Purpose

Computes the compound annual growth rate that turns a beginning value into an ending value over a number of years, together with the total return and growth multiple.

**Use when:** You need a smoothed per-year growth rate for revenue, a portfolio, a population or any quantity measured at two points in time.

**Do not use when:** You need to account for interim deposits or withdrawals (CAGR ignores cash flows; use a money-weighted return), or the period is under a year.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `beginning_value` | number |  | required | Value at the start of the period. (> 0, max 1000000000000000) |
| `ending_value` | number |  | required | Value at the end of the period. (> 0, max 1000000000000000) |
| `years` | number | years | required | Length of the period in years; fractional values allowed (18 months = 1.5). (> 0, max 200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `cagr_percent` | number | % | ((ending / beginning)^(1/years) − 1) × 100. |
| `total_return_percent` | number | % | (ending / beginning − 1) × 100 over the whole period. |
| `growth_multiple` | number |  | ending_value / beginning_value. |
| `simple_average_annual_return_percent` | number | % | total_return_percent / years, the arithmetic (non-compounded) average for comparison. |

## Formula

`CAGR = ((ending_value / beginning_value)^(1 / years) − 1) × 100`

CAGR is the constant annual rate that would produce the same end value with annual compounding; it smooths out volatility and says nothing about the path in between.

## Data Sources

- Investopedia – Compound Annual Growth Rate (CAGR) Formula and Calculation — https://www.investopedia.com/terms/c/cagr.asp (reference, retrieved 2026-09-23)
- Wikipedia – Compound annual growth rate — https://en.wikipedia.org/wiki/Compound_annual_growth_rate (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/cagr?beginning_value=…&ending_value=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/cagr` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/cagr · OpenAPI operationId `calculate_cagr` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "cagr", "inputs": {…}}`

## Example

- 10,000 to 19,000 over 3 years: inputs `{"beginning_value":10000,"ending_value":19000,"years":3}` → `{"cagr_percent":23.86,"total_return_percent":90,"growth_multiple":1.9,"simple_average_annual_return_percent":30}`
- 100 to 50 over 2 years: inputs `{"beginning_value":100,"ending_value":50,"years":2}` → `{"cagr_percent":-29.29,"total_return_percent":-50,"growth_multiple":0.5}`

```
GET https://tttkmbb.com/api/v1/calculate/cagr?beginning_value=10000&ending_value=19000&years=3
```

## Limitations

You need to account for interim deposits or withdrawals (CAGR ignores cash flows; use a money-weighted return), or the period is under a year. CAGR is the constant annual rate that would produce the same end value with annual compounding; it smooths out volatility and says nothing about the path in between. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How is CAGR different from average annual return?**

The arithmetic average ignores compounding. Growing 10,000 to 19,000 in 3 years is 30 % per year on average but only 23.86 % CAGR, because each year's growth builds on the previous one.

**How do I count the years?**

Use the elapsed time between the two measurements, not the number of data points: values at the ends of 2020 and 2023 span 3 years.

## Related

- [ROI Calculator](https://tttkmbb.com/finance/roi.md) — Total and annualized return on an investment.
- [Rule of 72 Calculator](https://tttkmbb.com/finance/rule-of-72.md) — How long this growth rate takes to double the value.


---

# Inflation Calculator

> Projects how an amount's cost rises and its purchasing power falls over a number of years at a constant annual inflation rate, using compound growth of the price level.

- Calculator id: `inflation` · Category: Finance (`finance`) · Tool name: `estimate_inflation_impact`
- Canonical page: https://tttkmbb.com/finance/inflation · This document: https://tttkmbb.com/finance/inflation.md · JSON definition: https://tttkmbb.com/finance/inflation.json

## Purpose

Projects how an amount's cost rises and its purchasing power falls over a number of years at a constant annual inflation rate, using compound growth of the price level.

**Use when:** You want to estimate what today's amount will cost in the future, or what a future sum is worth in today's money, from an assumed inflation rate.

**Do not use when:** You need historical conversions between two calendar years (that requires a CPI table such as the BLS inflation calculator), or investment discounting (use present-value).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `amount` | number |  | required | Amount in today's money. (min 0, max 1000000000000000) |
| `annual_inflation_percent` | number | % | required | Assumed constant yearly inflation in percent (negative for deflation). Many central banks target about 2 %. (min -50, max 200) |
| `years` | number | years | required | Number of years ahead. (> 0, max 200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `future_cost` | number |  | amount × (1 + inflation)^years: nominal money needed later to buy what amount buys today. |
| `purchasing_power` | number |  | amount / (1 + inflation)^years: what the same nominal amount will buy, in today's money. |
| `cumulative_inflation_percent` | number | % | ((1 + inflation)^years − 1) × 100, total price-level rise. |
| `purchasing_power_loss_percent` | number | % | (1 − 1 / (1 + inflation)^years) × 100. |
| `price_multiplier` | number |  | (1 + inflation)^years. |

## Formula

`multiplier = (1 + annual_inflation_percent/100)^years; future_cost = amount × multiplier; purchasing_power = amount / multiplier; cumulative_inflation = (multiplier − 1) × 100`

Rate-based projection with a single constant rate compounded annually; it does not use actual CPI data and real inflation varies year to year and by basket of goods.

## Data Sources

- U.S. Bureau of Labor Statistics – CPI Inflation Calculator (historical conversions) — https://www.bls.gov/data/inflation_calculator.htm (government, retrieved 2026-09-23)
- Federal Reserve – Why does the Federal Reserve aim for inflation of 2 percent over the longer run? — https://www.federalreserve.gov/faqs/economy_14400.htm (government, retrieved 2026-09-23)
- Wikipedia – Inflation — https://en.wikipedia.org/wiki/Inflation (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/inflation?amount=…&annual_inflation_percent=…&years=…`
- `POST https://tttkmbb.com/api/v1/calculate/inflation` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/inflation · OpenAPI operationId `estimate_inflation_impact` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "inflation", "inputs": {…}}`

## Example

- 1,000 at 3 % for 10 years: inputs `{"amount":1000,"annual_inflation_percent":3,"years":10}` → `{"future_cost":1343.92,"purchasing_power":744.09,"cumulative_inflation_percent":34.39,"purchasing_power_loss_percent":25.59,"price_multiplier":1.3439}`
- 50,000 at 2 % for 20 years: inputs `{"amount":50000,"annual_inflation_percent":2,"years":20}` → `{"future_cost":74297.37,"purchasing_power":33648.57,"cumulative_inflation_percent":48.59}`

```
GET https://tttkmbb.com/api/v1/calculate/inflation?amount=1000&annual_inflation_percent=3&years=10
```

## Limitations

You need historical conversions between two calendar years (that requires a CPI table such as the BLS inflation calculator), or investment discounting (use present-value). Rate-based projection with a single constant rate compounded annually; it does not use actual CPI data and real inflation varies year to year and by basket of goods. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which output do I want?**

future_cost answers 'how much will this cost in N years'; purchasing_power answers 'what will this nominal amount be worth in N years'. They are reciprocal projections of the same rate.

**Why is the purchasing-power loss smaller than the cumulative inflation?**

Because a 34.39 % rise in prices reduces what a fixed amount buys by 1 − 1/1.3439 = 25.59 %; the two measure the same change from opposite sides.

## Related

- [Present Value Calculator](https://tttkmbb.com/finance/present-value.md) — Discount a future amount at an investment rate instead of inflation.
- [CAGR Calculator](https://tttkmbb.com/finance/cagr.md) — Find the implied annual rate between two price levels.


---

# Tip Calculator

> Computes the tip from a bill amount and tip percentage, the total including tip, and the per-person share when the bill is split evenly.

- Calculator id: `tip` · Category: Finance (`finance`) · Tool name: `calculate_tip`
- Canonical page: https://tttkmbb.com/finance/tip · This document: https://tttkmbb.com/finance/tip.md · JSON definition: https://tttkmbb.com/finance/tip.json

## Purpose

Computes the tip from a bill amount and tip percentage, the total including tip, and the per-person share when the bill is split evenly.

**Use when:** You need to add a gratuity to a restaurant, delivery or service bill and optionally divide the total among several people.

**Do not use when:** People pay for different items or unequal shares (use bill-split), or you need to add sales tax rather than a tip (use sales-tax).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `bill_amount` | number |  | required | Amount on the bill before tip (pre- or post-tax, as you prefer to tip). (min 0, max 10000000) |
| `tip_percent` | number | % | optional, default 15 | Gratuity as a percent of bill_amount. US restaurant custom is 15–20 %. (min 0, max 100) |
| `split_between` | integer |  | optional, default 1 | How many people share the bill equally. (min 1, max 1000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `tip_amount` | number |  | bill_amount × tip_percent / 100. |
| `total_amount` | number |  | bill_amount + tip_amount. |
| `total_per_person` | number |  | total_amount / split_between. |
| `tip_per_person` | number |  | tip_amount / split_between. |
| `bill_per_person` | number |  | bill_amount / split_between. |

## Formula

`tip_amount = bill_amount × tip_percent / 100; total_amount = bill_amount + tip_amount; per person = value / split_between`

## Data Sources

- Wikipedia – Gratuity (tipping customs by country) — https://en.wikipedia.org/wiki/Gratuity (reference, retrieved 2026-09-23)
- Wikipedia – Percentage — https://en.wikipedia.org/wiki/Percentage (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/tip?bill_amount=…`
- `POST https://tttkmbb.com/api/v1/calculate/tip` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/tip · OpenAPI operationId `calculate_tip` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_tip` (dedicated) or `run_calculator` with `{"calculator_id": "tip", "inputs": {…}}`

## Example

- 85.50 bill, 18 % tip, 3 people: inputs `{"bill_amount":85.5,"tip_percent":18,"split_between":3}` → `{"tip_amount":15.39,"total_amount":100.89,"total_per_person":33.63,"tip_per_person":5.13,"bill_per_person":28.5}`
- 42.00 bill, 20 % tip: inputs `{"bill_amount":42,"tip_percent":20}` → `{"tip_amount":8.4,"total_amount":50.4,"total_per_person":50.4}`

```
GET https://tttkmbb.com/api/v1/calculate/tip?bill_amount=85.5&tip_percent=18&split_between=3
```

## Limitations

People pay for different items or unequal shares (use bill-split), or you need to add sales tax rather than a tip (use sales-tax). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I tip on the pre-tax or post-tax amount?**

Custom in the US is to tip on the pre-tax subtotal, though many people tip on the total; enter whichever amount you want the percentage applied to.

**What are typical percentages?**

US sit-down restaurants 15–20 %, exceptional service 20–25 %, counter service 0–10 %. In many countries (Japan, much of Europe) service is included and tipping is small or absent.

## Related

- [Bill Split Calculator](https://tttkmbb.com/everyday/bill-split.md) — Divide a bill unevenly or itemise it among people.
- [Sales Tax Calculator](https://tttkmbb.com/finance/sales-tax.md) — Add sales tax to a price.


---

# Discount Calculator

> Computes the final price and amount saved after a percentage discount, an optional second discount applied to the reduced price, and optional sales tax on the result.

- Calculator id: `discount` · Category: Finance (`finance`) · Tool name: `calculate_discount`
- Canonical page: https://tttkmbb.com/finance/discount · This document: https://tttkmbb.com/finance/discount.md · JSON definition: https://tttkmbb.com/finance/discount.json

## Purpose

Computes the final price and amount saved after a percentage discount, an optional second discount applied to the reduced price, and optional sales tax on the result.

**Use when:** You want the sale price after a percent-off promotion, the effective rate of two stacked discounts (e.g. 20 % off plus an extra 10 %), or the checkout price with tax.

**Do not use when:** You know the original and sale prices and need the percentage off (use percentage-change), or the discount is a fixed amount rather than a percent (just subtract it).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `original_price` | number |  | required | List price before any discount. (min 0, max 1000000000) |
| `discount_percent` | number | % | required | First percentage off the original price. (min 0, max 100) |
| `second_discount_percent` | number | % | optional, default 0 | Optional extra percent off applied to the already-discounted price (stacked, not added). (min 0, max 100) |
| `tax_percent` | number | % | optional, default 0 | Optional sales tax or VAT applied to the final discounted price. (min 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `final_price` | number |  | Price after all discounts, before tax. |
| `amount_saved` | number |  | original_price − final_price. |
| `effective_discount_percent` | number | % | Combined percentage off the original price. |
| `price_after_first_discount` | number |  | original_price × (1 − discount_percent/100). |
| `final_price_with_tax` | number |  | final_price × (1 + tax_percent/100). |

## Formula

`final_price = original_price × (1 − discount_percent/100) × (1 − second_discount_percent/100); amount_saved = original_price − final_price; effective_discount = amount_saved / original_price × 100; final_price_with_tax = final_price × (1 + tax_percent/100)`

## Data Sources

- Wikipedia – Discounts and allowances — https://en.wikipedia.org/wiki/Discounts_and_allowances (reference, retrieved 2026-09-23)
- Wikipedia – Percentage — https://en.wikipedia.org/wiki/Percentage (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/discount?original_price=…&discount_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/discount` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/discount · OpenAPI operationId `calculate_discount` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "discount", "inputs": {…}}`

## Example

- 80 at 25 % off: inputs `{"original_price":80,"discount_percent":25}` → `{"final_price":60,"amount_saved":20,"effective_discount_percent":25,"final_price_with_tax":60}`
- 200 at 20 % off plus extra 10 %, 8 % tax: inputs `{"original_price":200,"discount_percent":20,"second_discount_percent":10,"tax_percent":8}` → `{"final_price":144,"amount_saved":56,"effective_discount_percent":28,"price_after_first_discount":160,"final_price_with_tax":155.52}`

```
GET https://tttkmbb.com/api/v1/calculate/discount?original_price=80&discount_percent=25
```

## Limitations

You know the original and sale prices and need the percentage off (use percentage-change), or the discount is a fixed amount rather than a percent (just subtract it). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is 20 % off plus 10 % off the same as 30 % off?**

No. The second discount applies to the reduced price, so the combined discount is 1 − 0.8 × 0.9 = 28 %, not 30 %.

**Is tax charged on the discounted price?**

In most jurisdictions store discounts reduce the taxable amount, so tax is applied to final_price; manufacturer coupons are sometimes taxed on the pre-coupon price.

## Related

- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — General percent-of and percent-off arithmetic.
- [Sales Tax Calculator](https://tttkmbb.com/finance/sales-tax.md) — Add or extract sales tax on its own.


---

# Sales Tax Calculator

> Adds sales tax at a given rate to a pre-tax price, or works backwards from a tax-inclusive total to the pre-tax price and the tax paid.

- Calculator id: `sales-tax` · Category: Finance (`finance`) · Tool name: `calculate_sales_tax`
- Canonical page: https://tttkmbb.com/finance/sales-tax · This document: https://tttkmbb.com/finance/sales-tax.md · JSON definition: https://tttkmbb.com/finance/sales-tax.json

## Purpose

Adds sales tax at a given rate to a pre-tax price, or works backwards from a tax-inclusive total to the pre-tax price and the tax paid.

**Use when:** You need the checkout total for a price and a combined state/local sales-tax rate, or want to know how much of a receipt total was tax.

**Do not use when:** The tax is a value-added tax quoted as net/gross (use vat, which is the same arithmetic with VAT terminology), or you need the tax rate for a specific location (look it up first).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `amount` | number |  | required | The pre-tax price (mode=add_tax) or the tax-inclusive total (mode=extract_tax). (min 0, max 1000000000) |
| `tax_rate_percent` | number | % | required | Combined sales-tax rate in percent (state + local), e.g. 8.25. (min 0, max 100) |
| `mode` | enum: add_tax \| extract_tax |  | optional, default "add_tax" | Whether amount excludes tax (add) or already includes it (extract). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pre_tax_amount` | number |  | Price before sales tax. |
| `tax_amount` | number |  | pre_tax_amount × rate. |
| `total_amount` | number |  | pre_tax_amount + tax_amount. |
| `tax_share_of_total_percent` | number | % | tax_amount / total_amount × 100 (lower than the rate, since the rate applies to the pre-tax price). |

## Formula

`add_tax: tax = amount × rate/100, total = amount + tax. extract_tax: pre_tax = amount / (1 + rate/100), tax = amount − pre_tax`

## Data Sources

- Wikipedia – Sales tax — https://en.wikipedia.org/wiki/Sales_tax (reference, retrieved 2026-09-23)
- Investopedia – Sales Tax: Definition, Examples and How It's Calculated — https://www.investopedia.com/terms/s/salestax.asp (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sales-tax?amount=…&tax_rate_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/sales-tax` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sales-tax · OpenAPI operationId `calculate_sales_tax` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sales-tax", "inputs": {…}}`

## Example

- 100 plus 8.25 % tax: inputs `{"amount":100,"tax_rate_percent":8.25,"mode":"add_tax"}` → `{"pre_tax_amount":100,"tax_amount":8.25,"total_amount":108.25,"tax_share_of_total_percent":7.62}`
- 108.25 total, extract 8.25 % tax: inputs `{"amount":108.25,"tax_rate_percent":8.25,"mode":"extract_tax"}` → `{"pre_tax_amount":100,"tax_amount":8.25,"total_amount":108.25}`

```
GET https://tttkmbb.com/api/v1/calculate/sales-tax?amount=100&tax_rate_percent=8.25&mode=add_tax
```

## Limitations

The tax is a value-added tax quoted as net/gross (use vat, which is the same arithmetic with VAT terminology), or you need the tax rate for a specific location (look it up first). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why can't I extract tax by multiplying the total by the rate?**

Because the rate applies to the pre-tax price: 108.25 × 8.25 % = 8.93, not 8.25. Divide the total by 1.0825 to get the pre-tax price first.

**Which rate do I enter?**

The combined rate that applies at the point of sale: state plus county, city and special-district rates. It varies by location and product type.

## Related

- [VAT Calculator](https://tttkmbb.com/finance/vat.md) — The same calculation with net/gross VAT terminology and rates.
- [Discount Calculator](https://tttkmbb.com/finance/discount.md) — Apply a discount and then tax.
- [Tip Calculator](https://tttkmbb.com/finance/tip.md) — Add a gratuity to a bill.


---

# VAT Calculator

> Adds VAT at a given rate to a net price, or removes it from a gross (VAT-inclusive) price, returning net, VAT and gross amounts.

- Calculator id: `vat` · Category: Finance (`finance`) · Tool name: `calculate_vat`
- Canonical page: https://tttkmbb.com/finance/vat · This document: https://tttkmbb.com/finance/vat.md · JSON definition: https://tttkmbb.com/finance/vat.json

## Purpose

Adds VAT at a given rate to a net price, or removes it from a gross (VAT-inclusive) price, returning net, VAT and gross amounts.

**Use when:** You need the VAT-inclusive price for an invoice, or the net price and VAT portion of a gross amount, at a known rate such as 20 % (UK), 19 % (Germany) or 21 % (Netherlands).

**Do not use when:** You are dealing with US sales tax terminology (use sales-tax; the arithmetic is identical), or with multiple rates on one invoice (compute each line separately).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `amount` | number |  | required | Net price (mode=add_vat) or gross VAT-inclusive price (mode=remove_vat). (min 0, max 1000000000) |
| `vat_rate_percent` | number | % | optional, default 20 | VAT rate in percent; standard rates in the EU range from 17 % to 27 %. (min 0, max 100) |
| `mode` | enum: add_vat \| remove_vat |  | optional, default "add_vat" | Whether amount is net (add) or gross (remove). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `net_amount` | number |  | Price before VAT. |
| `vat_amount` | number |  | net_amount × rate. |
| `gross_amount` | number |  | net_amount + vat_amount. |
| `vat_fraction_of_gross` | number |  | rate / (100 + rate), e.g. 1/6 at 20 %: multiply a gross price by this to get the VAT. |

## Formula

`add_vat: vat = amount × rate/100, gross = amount + vat. remove_vat: net = amount / (1 + rate/100), vat = amount − net`

## Data Sources

- Wikipedia – Value-added tax — https://en.wikipedia.org/wiki/Value-added_tax (reference, retrieved 2026-09-23)
- GOV.UK – VAT rates — https://www.gov.uk/vat-rates (government, retrieved 2026-09-23)
- European Commission – VAT (rates and rules in the EU) — https://taxation-customs.ec.europa.eu/taxation/vat_en (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/vat?amount=…`
- `POST https://tttkmbb.com/api/v1/calculate/vat` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/vat · OpenAPI operationId `calculate_vat` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "vat", "inputs": {…}}`

## Example

- 100 net plus 20 % VAT: inputs `{"amount":100,"vat_rate_percent":20,"mode":"add_vat"}` → `{"net_amount":100,"vat_amount":20,"gross_amount":120,"vat_fraction_of_gross":0.166667}`
- 119 gross, remove 19 % VAT: inputs `{"amount":119,"vat_rate_percent":19,"mode":"remove_vat"}` → `{"net_amount":100,"vat_amount":19,"gross_amount":119}`

```
GET https://tttkmbb.com/api/v1/calculate/vat?amount=100&vat_rate_percent=20&mode=add_vat
```

## Limitations

You are dealing with US sales tax terminology (use sales-tax; the arithmetic is identical), or with multiple rates on one invoice (compute each line separately). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the VAT fraction?**

The share of a gross price that is VAT: rate / (100 + rate). At 20 % it is 1/6, so the VAT in a 120 gross price is 20, not 24.

**Which rate applies?**

Standard rates apply to most goods; reduced or zero rates apply to items such as food, books or children's clothing depending on the country. Check the national tax authority's list.

## Related

- [Sales Tax Calculator](https://tttkmbb.com/finance/sales-tax.md) — US-style sales tax with the same arithmetic.
- [Margin and Markup Calculator](https://tttkmbb.com/finance/margin-markup.md) — Set a net selling price from cost before adding VAT.


---

# Margin and Markup Calculator

> Computes profit, gross margin percentage and markup percentage from a unit cost and a selling price, or derives the selling price from cost plus a target margin or markup.

- Calculator id: `margin-markup` · Category: Finance (`finance`) · Tool name: `calculate_margin_markup`
- Canonical page: https://tttkmbb.com/finance/margin-markup · This document: https://tttkmbb.com/finance/margin-markup.md · JSON definition: https://tttkmbb.com/finance/margin-markup.json

## Purpose

Computes profit, gross margin percentage and markup percentage from a unit cost and a selling price, or derives the selling price from cost plus a target margin or markup.

**Use when:** You are pricing a product or service and need to convert between cost, price, margin (profit as % of price) and markup (profit as % of cost).

**Do not use when:** You need the sales volume that covers fixed costs (use break-even) or the tax on the price (use sales-tax / vat).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `cost` | number |  | required | Cost of goods or unit cost. (> 0, max 1000000000000) |
| `price` | number |  | optional | Selling price. Give price, margin_percent or markup_percent (in that order of precedence). (min 0, max 1000000000000) |
| `margin_percent` | number | % | optional | Desired gross margin as percent of price; used when price is omitted. (min -1000) |
| `markup_percent` | number | % | optional | Desired markup as percent of cost; used when price and margin_percent are omitted. (min -100, max 100000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `price` | number |  | Given or derived selling price. |
| `profit` | number |  | price − cost. |
| `margin_percent` | number | % | profit / price × 100. |
| `markup_percent` | number | % | profit / cost × 100. |
| `solved_from` | string |  | Which input determined the price: price, margin_percent or markup_percent. |

## Formula

`profit = price − cost; margin_percent = profit / price × 100; markup_percent = profit / cost × 100; price from margin = cost / (1 − margin_percent/100); price from markup = cost × (1 + markup_percent/100)`

Margin and markup describe the same profit relative to different bases (price vs cost), so markup is always the larger number: margin = markup / (1 + markup) and markup = margin / (1 − margin) in fractional form.

## Data Sources

- Investopedia – Profit Margin vs. Markup: What's the Difference? — https://www.investopedia.com/ask/answers/102714/whats-difference-between-profit-margin-and-markup.asp (reference, retrieved 2026-09-23)
- Wikipedia – Gross margin — https://en.wikipedia.org/wiki/Gross_margin (reference, retrieved 2026-09-23)
- Wikipedia – Markup (business) — https://en.wikipedia.org/wiki/Markup_(business) (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/margin-markup?cost=…`
- `POST https://tttkmbb.com/api/v1/calculate/margin-markup` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/margin-markup · OpenAPI operationId `calculate_margin_markup` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "margin-markup", "inputs": {…}}`

## Example

- Cost 50, price 80: inputs `{"cost":50,"price":80}` → `{"price":80,"profit":30,"margin_percent":37.5,"markup_percent":60,"solved_from":"price"}`
- Cost 40, target margin 25 %: inputs `{"cost":40,"margin_percent":25}` → `{"price":53.33,"profit":13.33,"margin_percent":25,"markup_percent":33.33,"solved_from":"margin_percent"}`

```
GET https://tttkmbb.com/api/v1/calculate/margin-markup?cost=50&price=80
```

## Limitations

You need the sales volume that covers fixed costs (use break-even) or the tax on the price (use sales-tax / vat). Margin and markup describe the same profit relative to different bases (price vs cost), so markup is always the larger number: margin = markup / (1 + markup) and markup = margin / (1 − margin) in fractional form. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is a 50 % markup only a 33.3 % margin?**

Markup is measured on cost, margin on price. Cost 100 with 50 % markup sells for 150; the 50 profit is 33.3 % of the 150 price.

**Can margin be 100 %?**

No: a 100 % margin would require zero cost, so margin_percent must be below 100. Markup has no upper limit.

## Related

- [Break-Even Calculator](https://tttkmbb.com/finance/break-even.md) — Units needed to cover fixed costs at this contribution margin.
- [VAT Calculator](https://tttkmbb.com/finance/vat.md) — Add VAT on top of the net selling price.
- [Discount Calculator](https://tttkmbb.com/finance/discount.md) — Effect of a discount on the selling price.


---

# Break-Even Calculator

> Computes the contribution margin per unit and the number of units and revenue required for total revenue to equal total costs (or to reach a target profit).

- Calculator id: `break-even` · Category: Finance (`finance`) · Tool name: `calculate_break_even`
- Canonical page: https://tttkmbb.com/finance/break-even · This document: https://tttkmbb.com/finance/break-even.md · JSON definition: https://tttkmbb.com/finance/break-even.json

## Purpose

Computes the contribution margin per unit and the number of units and revenue required for total revenue to equal total costs (or to reach a target profit).

**Use when:** You are planning a product, service or event and need to know how many units must be sold at a given price to cover fixed costs, or to earn a specific profit.

**Do not use when:** Price or variable cost changes with volume (needs a stepwise or non-linear model), or you only need margin/markup on one unit (use margin-markup).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `fixed_costs` | number |  | required | Total costs that do not change with volume over the period (rent, salaries, equipment). (min 0, max 1000000000000) |
| `price_per_unit` | number |  | required | Revenue received per unit sold. (> 0, max 1000000000) |
| `variable_cost_per_unit` | number |  | required | Cost incurred for each unit produced or sold (materials, commissions, shipping). (min 0, max 1000000000) |
| `target_profit` | number |  | optional, default 0 | Optional profit to earn on top of covering fixed costs. (min 0, max 1000000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `contribution_margin_per_unit` | number |  | price_per_unit − variable_cost_per_unit. |
| `contribution_margin_ratio_percent` | number | % | contribution margin / price × 100. |
| `break_even_units` | number | units | (fixed_costs + target_profit) / contribution margin per unit. |
| `break_even_units_rounded_up` | integer | units | break_even_units rounded up to the next whole unit. |
| `break_even_revenue` | number |  | break_even_units × price_per_unit, equivalently (fixed_costs + target_profit) / contribution margin ratio. |

## Formula

`contribution_margin = price_per_unit − variable_cost_per_unit; break_even_units = (fixed_costs + target_profit) / contribution_margin; break_even_revenue = break_even_units × price_per_unit`

Linear cost-volume-profit model: constant price and variable cost per unit, fixed costs constant over the relevant range, single product.

## Data Sources

- Investopedia – Break-Even Analysis: Definition and Formula — https://www.investopedia.com/terms/b/breakevenanalysis.asp (reference, retrieved 2026-09-23)
- Wikipedia – Break-even (economics) — https://en.wikipedia.org/wiki/Break-even_(economics) (reference, retrieved 2026-09-23)
- Wikipedia – Contribution margin — https://en.wikipedia.org/wiki/Contribution_margin (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/break-even?fixed_costs=…&price_per_unit=…&variable_cost_per_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/break-even` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/break-even · OpenAPI operationId `calculate_break_even` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "break-even", "inputs": {…}}`

## Example

- 10,000 fixed, price 50, variable 30: inputs `{"fixed_costs":10000,"price_per_unit":50,"variable_cost_per_unit":30}` → `{"contribution_margin_per_unit":20,"contribution_margin_ratio_percent":40,"break_even_units":500,"break_even_units_rounded_up":500,"break_even_revenue":25000}`
- 60,000 fixed, price 25, variable 10, target profit 15,000: inputs `{"fixed_costs":60000,"price_per_unit":25,"variable_cost_per_unit":10,"target_profit":15000}` → `{"contribution_margin_per_unit":15,"break_even_units":5000,"break_even_revenue":125000}`

```
GET https://tttkmbb.com/api/v1/calculate/break-even?fixed_costs=10000&price_per_unit=50&variable_cost_per_unit=30
```

## Limitations

Price or variable cost changes with volume (needs a stepwise or non-linear model), or you only need margin/markup on one unit (use margin-markup). Linear cost-volume-profit model: constant price and variable cost per unit, fixed costs constant over the relevant range, single product. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if the variable cost is higher than the price?**

Every sale loses money and no volume can cover fixed costs; the calculator returns an error asking for a higher price or lower unit cost.

**Is break-even revenue the same as break-even units times price?**

Yes. It can also be computed directly as fixed costs divided by the contribution margin ratio, which is useful when you only know the ratio.

## Related

- [Margin and Markup Calculator](https://tttkmbb.com/finance/margin-markup.md) — Set the unit price from cost and a target margin.
- [ROI Calculator](https://tttkmbb.com/finance/roi.md) — Evaluate the return once the project is profitable.


---

# Rule of 72 Calculator

> Estimates the doubling time of an amount growing at a fixed annual rate with the Rule of 72, and compares it with the exact result ln 2 / ln(1 + r) for annual compounding and ln 2 / r for continuous compounding.

- Calculator id: `rule-of-72` · Category: Finance (`finance`) · Tool name: `calculate_rule_of_72`
- Canonical page: https://tttkmbb.com/finance/rule-of-72 · This document: https://tttkmbb.com/finance/rule-of-72.md · JSON definition: https://tttkmbb.com/finance/rule-of-72.json

## Purpose

Estimates the doubling time of an amount growing at a fixed annual rate with the Rule of 72, and compares it with the exact result ln 2 / ln(1 + r) for annual compounding and ln 2 / r for continuous compounding.

**Use when:** You want a quick mental-math estimate of how long money (or debt, or prices) takes to double at a given annual growth rate, plus the exact figure.

**Do not use when:** You need the balance after a specific number of years (use compound-interest) or the rate implied by two values (use cagr).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `annual_rate_percent` | number | % | required | Annual interest, return or inflation rate in percent; 8 means 8 %. (> 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `rule_of_72_years` | number | years | 72 / annual_rate_percent. |
| `exact_years` | number | years | ln(2) / ln(1 + rate). |
| `continuous_years` | number | years | ln(2) / rate ≈ 69.3 / annual_rate_percent. |
| `rule_error_percent` | number | % | (rule_of_72_years − exact_years) / exact_years × 100. |
| `years_to_triple_exact` | number | years | ln(3) / ln(1 + rate). |

## Formula

`rule_of_72_years = 72 / annual_rate_percent; exact_years = ln(2) / ln(1 + annual_rate_percent/100); continuous_years = ln(2) / (annual_rate_percent/100)`

The rule is a first-order approximation that is most accurate between about 6 % and 10 %; below that the Rule of 70 or 69.3 is closer, and at high rates the rule overstates the doubling time.

## Data Sources

- Wikipedia – Rule of 72 — https://en.wikipedia.org/wiki/Rule_of_72 (reference, retrieved 2026-09-23)
- Investopedia – The Rule of 72: Definition, Usefulness and How to Use It — https://www.investopedia.com/terms/r/ruleof72.asp (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/rule-of-72?annual_rate_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/rule-of-72` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/rule-of-72 · OpenAPI operationId `calculate_rule_of_72` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "rule-of-72", "inputs": {…}}`

## Example

- 8 % per year: inputs `{"annual_rate_percent":8}` → `{"rule_of_72_years":9,"exact_years":9.01,"continuous_years":8.66,"rule_error_percent":-0.07}`
- 6 % per year: inputs `{"annual_rate_percent":6}` → `{"rule_of_72_years":12,"exact_years":11.9,"continuous_years":11.55,"years_to_triple_exact":18.85}`

```
GET https://tttkmbb.com/api/v1/calculate/rule-of-72?annual_rate_percent=8
```

## Limitations

You need the balance after a specific number of years (use compound-interest) or the rate implied by two values (use cagr). The rule is a first-order approximation that is most accurate between about 6 % and 10 %; below that the Rule of 70 or 69.3 is closer, and at high rates the rule overstates the doubling time. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why 72 and not 69.3?**

ln 2 ≈ 0.693 gives the exact continuous-compounding rule, but 72 has many divisors (2, 3, 4, 6, 8, 9, 12) and happens to correct for annual compounding near 8 %.

**Does it work for inflation or debt?**

Yes, any constant growth rate: at 3 % inflation prices double in about 24 years; at 18 % APR an unpaid credit-card balance doubles in about 4 years.

## Related

- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Exact balance after any number of years.
- [CAGR Calculator](https://tttkmbb.com/finance/cagr.md) — Growth rate implied by a starting and ending value.


---

# Debt Payoff Calculator

> Computes how many months a fixed monthly payment takes to clear a balance charged a given APR with monthly compounding, plus the total interest paid and the size of the final payment.

- Calculator id: `debt-payoff` · Category: Finance (`finance`) · Tool name: `calculate_debt_payoff`
- Canonical page: https://tttkmbb.com/finance/debt-payoff · This document: https://tttkmbb.com/finance/debt-payoff.md · JSON definition: https://tttkmbb.com/finance/debt-payoff.json

## Purpose

Computes how many months a fixed monthly payment takes to clear a balance charged a given APR with monthly compounding, plus the total interest paid and the size of the final payment.

**Use when:** You know a credit-card, loan or other balance, its APR and what you can pay each month, and want the payoff date and interest cost.

**Do not use when:** You know the term and need the required payment (use loan-payment), or the payment is a percentage of the balance that shrinks over time (minimum-payment schedules).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `balance` | number |  | required | Amount owed today. (> 0, max 1000000000000) |
| `annual_rate_percent` | number | % | required | Annual percentage rate in percent; interest accrues monthly at APR / 12. (min 0, max 200) |
| `monthly_payment` | number |  | required | Fixed amount paid at the end of each month. Must exceed the first month's interest (balance × APR / 1200). (> 0, max 1000000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `months_to_payoff` | integer | months | Number of monthly payments including the smaller final one. |
| `payoff_time` | string |  | months_to_payoff expressed in years and months. |
| `months_to_payoff_exact` | number | months | −ln(1 − i·balance/payment) / ln(1 + i), the unrounded annuity solution. |
| `total_paid` | number |  | balance + total_interest. |
| `total_interest` | number |  | Sum of the monthly interest charges until payoff. |
| `final_payment` | number |  | The last, usually smaller, payment that clears the balance. |
| `first_month_interest` | number |  | balance × APR / 1200, the minimum a payment must exceed. |

## Formula

`i = annual_rate_percent / 1200. Each month: interest = balance × i; balance = balance + interest − payment (last payment = remaining balance + interest). Closed form: months = −ln(1 − i × balance / monthly_payment) / ln(1 + i), rounded up.`

Month-by-month simulation with interest charged on the remaining balance and the payment applied at month end, matching the standard amortization formula; no fees, rate changes or new charges are assumed.

## Data Sources

- Federal Reserve – Credit Card Repayment Calculator — https://www.federalreserve.gov/creditcardcalculator/ (government, retrieved 2026-09-23)
- CFPB – Credit cards: paying down balances — https://www.consumerfinance.gov/consumer-tools/credit-cards/ (government, retrieved 2026-09-23)
- Wikipedia – Amortization calculator (annuity payment formula) — https://en.wikipedia.org/wiki/Amortization_calculator (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/debt-payoff?balance=…&annual_rate_percent=…&monthly_payment=…`
- `POST https://tttkmbb.com/api/v1/calculate/debt-payoff` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/debt-payoff · OpenAPI operationId `calculate_debt_payoff` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "debt-payoff", "inputs": {…}}`

## Example

- 5,000 at 18 % APR, 200 per month: inputs `{"balance":5000,"annual_rate_percent":18,"monthly_payment":200}` → `{"months_to_payoff":32,"payoff_time":"2 years 8 months","months_to_payoff_exact":31.57,"total_paid":6313.96,"total_interest":1313.96,"final_payment":113.96,"first_month_interest":75}`
- 2,000 at 24 % APR, 50 per month: inputs `{"balance":2000,"annual_rate_percent":24,"monthly_payment":50}` → `{"months_to_payoff":82,"payoff_time":"6 years 10 months","total_interest":2063.8,"first_month_interest":40}`

```
GET https://tttkmbb.com/api/v1/calculate/debt-payoff?balance=5000&annual_rate_percent=18&monthly_payment=200
```

## Limitations

You know the term and need the required payment (use loan-payment), or the payment is a percentage of the balance that shrinks over time (minimum-payment schedules). Month-by-month simulation with interest charged on the remaining balance and the payment applied at month end, matching the standard amortization formula; no fees, rate changes or new charges are assumed. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What happens if my payment is too small?**

If the payment does not exceed the first month's interest the balance never falls; the calculator returns an error stating the minimum payment and a payment that clears the debt in 5 years.

**How much does paying extra help?**

Re-run with the higher payment: on 5,000 at 18 %, raising the payment from 200 to 300 cuts the time from 32 to 20 months and the interest from about 1,314 to about 800.

## Related

- [Loan Payment Calculator](https://tttkmbb.com/finance/loan-payment.md) — Find the payment for a chosen term instead.
- [Mortgage Payment Calculator](https://tttkmbb.com/finance/mortgage-payment.md) — Full housing payment for a home loan.
- [Rule of 72 Calculator](https://tttkmbb.com/finance/rule-of-72.md) — How fast an unpaid balance doubles at this APR.


---

# Salary Converter

> Converts a pay amount quoted per hour, day, week, two weeks, month or year into all the other periods, using the hours per week, days per week and paid weeks per year you specify.

- Calculator id: `salary-converter` · Category: Finance (`finance`) · Tool name: `convert_salary`
- Canonical page: https://tttkmbb.com/finance/salary-converter · This document: https://tttkmbb.com/finance/salary-converter.md · JSON definition: https://tttkmbb.com/finance/salary-converter.json

## Purpose

Converts a pay amount quoted per hour, day, week, two weeks, month or year into all the other periods, using the hours per week, days per week and paid weeks per year you specify.

**Use when:** You need to compare an hourly wage with an annual salary, or see what a salary works out to per month, per week or per hour before tax.

**Do not use when:** You need take-home pay after income tax and deductions, or overtime at a premium rate (multiply the extra hours by the premium separately).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `amount` | number |  | required | Gross pay for one period, before tax. (min 0, max 1000000000) |
| `period` | enum: hourly \| daily \| weekly \| biweekly \| monthly \| annual |  | required | The period the entered amount refers to. |
| `hours_per_week` | number | hours | optional, default 40 | Paid hours per week (40 is standard full time in the US). (> 0, max 168) |
| `days_per_week` | number | days | optional, default 5 | Paid working days per week, used for the daily rate. (> 0, max 7) |
| `weeks_per_year` | number | weeks | optional, default 52 | Weeks paid per year; use 52 for salaried staff with paid leave, fewer for unpaid time off. (> 0, max 53) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `hourly` | number |  | annual / (hours_per_week × weeks_per_year). |
| `daily` | number |  | annual / (days_per_week × weeks_per_year). |
| `weekly` | number |  | annual / weeks_per_year. |
| `biweekly` | number |  | weekly × 2 (26 pay periods at 52 weeks). |
| `monthly` | number |  | annual / 12. |
| `annual` | number |  | Yearly gross pay. |
| `hours_per_year` | number | hours | hours_per_week × weeks_per_year (2,080 at 40 h and 52 weeks). |

## Formula

`annual = amount × periods per year, where periods per year = hours_per_week × weeks_per_year (hourly), days_per_week × weeks_per_year (daily), weeks_per_year (weekly), weeks_per_year / 2 (biweekly), 12 (monthly) or 1 (annual); every other period = annual / its periods per year`

Gross (pre-tax) conversion with a 52-week, 2,080-hour year by default; the US federal government uses a 2,087-hour divisor for its own hourly rates, which changes the hourly figure by about 0.3 %.

## Data Sources

- U.S. OPM – Computing Hourly Rates of Pay Using the 2,087-Hour Divisor — https://www.opm.gov/policy-data-oversight/pay-leave/pay-administration/fact-sheets/computing-hourly-rates-of-pay-using-the-2087-hour-divisor/ (government, retrieved 2026-09-23)
- U.S. Department of Labor – Overtime Pay (40-hour workweek under the FLSA) — https://www.dol.gov/agencies/whd/overtime (government, retrieved 2026-09-23)
- Wikipedia – Salary — https://en.wikipedia.org/wiki/Salary (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/salary-converter?amount=…&period=…`
- `POST https://tttkmbb.com/api/v1/calculate/salary-converter` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/salary-converter · OpenAPI operationId `convert_salary` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "salary-converter", "inputs": {…}}`

## Example

- 25 per hour, 40 h/week, 52 weeks: inputs `{"amount":25,"period":"hourly"}` → `{"hourly":25,"daily":200,"weekly":1000,"biweekly":2000,"monthly":4333.33,"annual":52000,"hours_per_year":2080}`
- 75,000 per year: inputs `{"amount":75000,"period":"annual"}` → `{"hourly":36.06,"daily":288.46,"weekly":1442.31,"biweekly":2884.62,"monthly":6250,"annual":75000}`

```
GET https://tttkmbb.com/api/v1/calculate/salary-converter?amount=25&period=hourly
```

## Limitations

You need take-home pay after income tax and deductions, or overtime at a premium rate (multiply the extra hours by the premium separately). Gross (pre-tax) conversion with a 52-week, 2,080-hour year by default; the US federal government uses a 2,087-hour divisor for its own hourly rates, which changes the hourly figure by about 0.3 %. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is monthly not weekly × 4?**

A year has 52 weeks but 12 months, so a month averages 4.33 weeks. Monthly pay is annual / 12, which is weekly × 52 / 12.

**How do I handle unpaid vacation?**

Reduce weeks_per_year: an hourly worker with 2 unpaid weeks off earns 50 weeks × hours_per_week × rate per year.

## Related

- [Work Hours Calculator](https://tttkmbb.com/everyday/work-hours.md) — Count the hours worked in a period.
- [Inflation Calculator](https://tttkmbb.com/finance/inflation.md) — See how a salary's purchasing power changes over time.


---

# BMI Calculator

> Computes body mass index (BMI) from weight and height and classifies it with the WHO adult categories, plus the healthy weight range for that height.

- Calculator id: `bmi` · Category: Health (`health`) · Tool name: `calculate_bmi`
- Canonical page: https://tttkmbb.com/health/bmi · This document: https://tttkmbb.com/health/bmi.md · JSON definition: https://tttkmbb.com/health/bmi.json

## Purpose

Computes body mass index (BMI) from weight and height and classifies it with the WHO adult categories, plus the healthy weight range for that height.

**Use when:** You need an adult's BMI, its WHO/CDC weight category, or the weight range that corresponds to a normal BMI (18.5–24.9) for a given height.

**Do not use when:** The person is under 20 years old (children need age- and sex-specific BMI percentiles), or you need body-fat percentage (use body-fat) or calorie needs (use bmr / tdee).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `height_cm` | number | cm | required | Standing height in centimetres. (min 50, max 300) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `bmi` | number | kg/m² | Body mass index = weight / height². |
| `category` | string |  | WHO adult BMI classification. |
| `healthy_weight_min_kg` | number | kg | Weight at BMI 18.5 for this height. |
| `healthy_weight_max_kg` | number | kg | Weight at BMI 24.9 for this height. |
| `prime` | number |  | BMI divided by the upper normal limit 25; values above 1 indicate excess weight. |

## Formula

`BMI = weight_kg / (height_cm / 100)²`

BMI is a screening measure, not a diagnosis: it does not distinguish fat from muscle mass and thresholds were derived from European adult populations. WHO categories: <18.5 underweight, 18.5–24.9 normal, 25–29.9 overweight, ≥30 obesity (classes I–III at 30, 35, 40).

## Data Sources

- WHO – A healthy lifestyle: body mass index — https://www.who.int/europe/news-room/fact-sheets/item/a-healthy-lifestyle---who-recommendations (standard, retrieved 2026-09-23)
- CDC – Adult BMI categories — https://www.cdc.gov/bmi/adult-calculator/bmi-categories.html (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/bmi?weight_kg=…&height_cm=…`
- `POST https://tttkmbb.com/api/v1/calculate/bmi` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/bmi · OpenAPI operationId `calculate_bmi` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_bmi` (dedicated) or `run_calculator` with `{"calculator_id": "bmi", "inputs": {…}}`

## Example

- 70 kg, 175 cm: inputs `{"weight_kg":70,"height_cm":175}` → `{"bmi":22.86,"category":"Normal weight","healthy_weight_min_kg":56.7,"healthy_weight_max_kg":76.3,"prime":0.914}`
- 95 kg, 180 cm: inputs `{"weight_kg":95,"height_cm":180}` → `{"bmi":29.32,"category":"Overweight (pre-obesity)"}`

```
GET https://tttkmbb.com/api/v1/calculate/bmi?weight_kg=70&height_cm=175
```

## Limitations

The person is under 20 years old (children need age- and sex-specific BMI percentiles), or you need body-fat percentage (use body-fat) or calorie needs (use bmr / tdee). BMI is a screening measure, not a diagnosis: it does not distinguish fat from muscle mass and thresholds were derived from European adult populations. WHO categories: <18.5 underweight, 18.5–24.9 normal, 25–29.9 overweight, ≥30 obesity (classes I–III at 30, 35, 40). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is BMI accurate for athletes?**

No. Muscular people can have a high BMI without excess fat, because BMI only uses weight and height. Use body-fat percentage for body composition.

**Which thresholds are used?**

WHO adult thresholds (18.5 / 25 / 30 / 35 / 40). Some Asian populations use lower action points (23 and 27.5) recommended by WHO for public-health action.

**Does this work for children?**

No. For ages 2–19 BMI must be interpreted with age- and sex-specific percentiles (CDC/WHO growth charts), which this calculator does not implement.

## Related

- [BMR Calculator](https://tttkmbb.com/health/bmr.md) — Estimate resting calorie needs for the same weight and height.
- [Body Fat Calculator](https://tttkmbb.com/health/body-fat.md) — BMI does not measure body composition; the US Navy method estimates body-fat percentage.
- [Ideal Weight Calculator](https://tttkmbb.com/health/ideal-weight.md) — Compare with ideal-weight formulas (Devine, Robinson, Miller, Hamwi).


---

# BMR Calculator

> Estimates basal metabolic rate (calories burned at complete rest per day) with the Mifflin-St Jeor equation, and also reports the revised Harris-Benedict estimate.

- Calculator id: `bmr` · Category: Health (`health`) · Tool name: `calculate_bmr`
- Canonical page: https://tttkmbb.com/health/bmr · This document: https://tttkmbb.com/health/bmr.md · JSON definition: https://tttkmbb.com/health/bmr.json

## Purpose

Estimates basal metabolic rate (calories burned at complete rest per day) with the Mifflin-St Jeor equation, and also reports the revised Harris-Benedict estimate.

**Use when:** You need resting daily calorie needs for an adult from sex, weight, height and age, as a base for diet or TDEE calculations.

**Do not use when:** You need total daily calories including activity (use tdee), the person is a child, pregnant, or has very high muscle mass (use a body-fat based equation such as Katch-McArdle instead).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sex` | enum: male \| female |  | required | Biological sex used to select the formula coefficients. |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `height_cm` | number | cm | required | Height in centimetres. (min 50, max 300) |
| `age_years` | number | years | required | Age in years (adults only). (min 18, max 120) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `bmr_kcal_per_day` | number | kcal/day | Basal metabolic rate by the Mifflin-St Jeor equation (recommended by the Academy of Nutrition and Dietetics). |
| `harris_benedict_kcal_per_day` | number | kcal/day | Basal metabolic rate by the Roza & Shizgal 1984 revision of Harris-Benedict, for comparison. |
| `bmr_kj_per_day` | number | kJ/day | Mifflin-St Jeor BMR expressed in kilojoules (1 kcal = 4.184 kJ). |

## Formula

`Mifflin-St Jeor: BMR = 10·weight_kg + 6.25·height_cm − 5·age_years + 5 (male) or − 161 (female). Harris-Benedict (1984): male 88.362 + 13.397·W + 4.799·H − 5.677·A; female 447.593 + 9.247·W + 3.098·H − 4.330·A.`

Mifflin-St Jeor (1990) predicts resting energy expenditure within ±10% for about 82% of non-obese and 70% of obese adults, which is why it is preferred over the older Harris-Benedict equation.

## Data Sources

- Mifflin MD et al. (1990) A new predictive equation for resting energy expenditure, Am J Clin Nutr 51:241-247 — https://pubmed.ncbi.nlm.nih.gov/2305711/ (peer_reviewed, retrieved 2026-09-23)
- Roza & Shizgal (1984) The Harris Benedict equation reevaluated, Am J Clin Nutr 40:168-182 — https://pubmed.ncbi.nlm.nih.gov/6741850/ (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/bmr?sex=…&weight_kg=…&height_cm=…&age_years=…`
- `POST https://tttkmbb.com/api/v1/calculate/bmr` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/bmr · OpenAPI operationId `calculate_bmr` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_bmr` (dedicated) or `run_calculator` with `{"calculator_id": "bmr", "inputs": {…}}`

## Example

- Male, 70 kg, 175 cm, 30 years: inputs `{"sex":"male","weight_kg":70,"height_cm":175,"age_years":30}` → `{"bmr_kcal_per_day":1649,"harris_benedict_kcal_per_day":1696,"bmr_kj_per_day":6898}`
- Female, 60 kg, 165 cm, 40 years: inputs `{"sex":"female","weight_kg":60,"height_cm":165,"age_years":40}` → `{"bmr_kcal_per_day":1270,"harris_benedict_kcal_per_day":1341}`

```
GET https://tttkmbb.com/api/v1/calculate/bmr?sex=male&weight_kg=70&height_cm=175&age_years=30
```

## Limitations

You need total daily calories including activity (use tdee), the person is a child, pregnant, or has very high muscle mass (use a body-fat based equation such as Katch-McArdle instead). Mifflin-St Jeor (1990) predicts resting energy expenditure within ±10% for about 82% of non-obese and 70% of obese adults, which is why it is preferred over the older Harris-Benedict equation. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the difference between BMR and TDEE?**

BMR is energy used at complete rest. TDEE multiplies BMR by an activity factor (1.2–1.9) to estimate total daily energy expenditure; use the tdee calculator for that.

**Why do the two formulas differ?**

They were fitted on different populations (Harris-Benedict in 1919, revised 1984; Mifflin-St Jeor in 1990). Mifflin-St Jeor is generally more accurate for modern adults.

## Related

- [TDEE Calculator](https://tttkmbb.com/health/tdee.md) — Multiply BMR by an activity factor to get total daily calories.
- [Macro Calculator](https://tttkmbb.com/health/macros.md) — Split a calorie target into protein, carbohydrate and fat grams.


---

# TDEE Calculator

> Estimates total daily energy expenditure from Mifflin-St Jeor BMR and an activity level, and derives calorie targets for maintaining, losing or gaining weight.

- Calculator id: `tdee` · Category: Health (`health`) · Tool name: `calculate_tdee`
- Canonical page: https://tttkmbb.com/health/tdee · This document: https://tttkmbb.com/health/tdee.md · JSON definition: https://tttkmbb.com/health/tdee.json

## Purpose

Estimates total daily energy expenditure from Mifflin-St Jeor BMR and an activity level, and derives calorie targets for maintaining, losing or gaining weight.

**Use when:** You need daily maintenance calories for an adult, or calorie targets for a mild/standard deficit or surplus.

**Do not use when:** The person is a child, pregnant or breastfeeding, or you only need the resting rate (use bmr).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sex` | enum: male \| female |  | required | Biological sex used to select the formula coefficients. |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `height_cm` | number | cm | required | Height in centimetres. (min 50, max 300) |
| `age_years` | number | years | required | Age in years. (min 18, max 120) |
| `activity_level` | enum: sedentary \| light \| moderate \| very_active \| extra_active |  | optional, default "moderate" | Weekly exercise level; maps to the standard activity multipliers 1.2 / 1.375 / 1.55 / 1.725 / 1.9. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `bmr_kcal_per_day` | number | kcal/day | Mifflin-St Jeor basal metabolic rate. |
| `activity_multiplier` | number |  | Factor applied to BMR. |
| `tdee_kcal_per_day` | number | kcal/day | Calories to maintain current weight. |
| `mild_loss_kcal_per_day` | number | kcal/day | Approximately 0.25 kg/week loss. |
| `loss_kcal_per_day` | number | kcal/day | Approximately 0.5 kg/week loss. |
| `mild_gain_kcal_per_day` | number | kcal/day | Approximately 0.25 kg/week gain. |
| `gain_kcal_per_day` | number | kcal/day | Approximately 0.5 kg/week gain. |

## Formula

`TDEE = BMR(Mifflin-St Jeor) × activity_multiplier; targets = TDEE ± 250 or ± 500 kcal/day`

## Data Sources

- Mifflin MD et al. (1990) A new predictive equation for resting energy expenditure, Am J Clin Nutr 51:241-247 — https://pubmed.ncbi.nlm.nih.gov/2305711/ (peer_reviewed, retrieved 2026-09-23)
- FAO/WHO/UNU (2004) Human energy requirements – physical activity levels — https://www.fao.org/4/y5686e/y5686e00.htm (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/tdee?sex=…&weight_kg=…&height_cm=…&age_years=…`
- `POST https://tttkmbb.com/api/v1/calculate/tdee` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/tdee · OpenAPI operationId `calculate_tdee` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_tdee` (dedicated) or `run_calculator` with `{"calculator_id": "tdee", "inputs": {…}}`

## Example

- Male, 70 kg, 175 cm, 30 y, moderate: inputs `{"sex":"male","weight_kg":70,"height_cm":175,"age_years":30,"activity_level":"moderate"}` → `{"bmr_kcal_per_day":1649,"activity_multiplier":1.55,"tdee_kcal_per_day":2556,"loss_kcal_per_day":2056,"gain_kcal_per_day":3056}`

```
GET https://tttkmbb.com/api/v1/calculate/tdee?sex=male&weight_kg=70&height_cm=175&age_years=30&activity_level=moderate
```

## Limitations

The person is a child, pregnant or breastfeeding, or you only need the resting rate (use bmr). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How accurate is TDEE?**

Typically within ±10–15%. Activity multipliers are coarse; track weight for 2–3 weeks and adjust intake by 100–200 kcal if weight moves unexpectedly.

**Which activity level should I choose?**

Count only deliberate exercise. Most office workers who train 3 times a week are 'light' or 'moderate', not 'very active'.

## Related

- [Macro Calculator](https://tttkmbb.com/health/macros.md) — Turn the chosen calorie target into macronutrient grams.
- [Calorie Deficit & Weight Loss Time Calculator](https://tttkmbb.com/health/calorie-deficit.md) — Estimate how long a deficit takes to reach a target weight.


---

# Body Fat Calculator

> Estimates body-fat percentage from height and neck, waist (and hip for women) circumferences using the US Navy method, and classifies the result with ACE categories.

- Calculator id: `body-fat` · Category: Health (`health`) · Tool name: `calculate_body_fat_percentage`
- Canonical page: https://tttkmbb.com/health/body-fat · This document: https://tttkmbb.com/health/body-fat.md · JSON definition: https://tttkmbb.com/health/body-fat.json

## Purpose

Estimates body-fat percentage from height and neck, waist (and hip for women) circumferences using the US Navy method, and classifies the result with ACE categories.

**Use when:** You want a tape-measure estimate of body-fat percentage and fat/lean mass without calipers or a DEXA scan.

**Do not use when:** High accuracy is required (DEXA, hydrostatic weighing or BIA are better), or the person is a child or pregnant.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sex` | enum: male \| female |  | required | Biological sex used to select the formula coefficients. |
| `height_cm` | number | cm | required | Height in centimetres. (min 50, max 300) |
| `waist_cm` | number | cm | required | Waist measured at the navel (men) or narrowest point (women). (min 30, max 300) |
| `neck_cm` | number | cm | required | Neck measured just below the larynx. (min 15, max 100) |
| `hip_cm` | number | cm | optional | Hip at the widest point. Required for women, ignored for men. (min 30, max 300) |
| `weight_kg` | number | kg | optional | Optional body weight, used to report fat mass and lean mass in kg. (> 0, max 700) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `body_fat_percent` | number | % | Estimated body-fat percentage (US Navy formula). |
| `category` | string |  | ACE body-fat category for the given sex. |
| `fat_mass_kg` | number | kg | Body fat in kilograms (only when weight_kg is given). |
| `lean_mass_kg` | number | kg | Fat-free mass in kilograms (only when weight_kg is given). |

## Formula

`Men: %fat = 495 / (1.0324 − 0.19077·log10(waist − neck) + 0.15456·log10(height)) − 450. Women: %fat = 495 / (1.29579 − 0.35004·log10(waist + hip − neck) + 0.22100·log10(height)) − 450. All lengths in cm.`

## Data Sources

- Hodgdon & Beckett (1984) Prediction of percent body fat for U.S. Navy men/women from body circumferences and height — https://apps.dtic.mil/sti/citations/ADA143890 (peer_reviewed, retrieved 2026-09-23)
- American Council on Exercise – Percent body fat norms — https://www.acefitness.org/resources/everyone/tools-calculators/percent-body-fat-calculator/ (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/body-fat?sex=…&height_cm=…&waist_cm=…&neck_cm=…`
- `POST https://tttkmbb.com/api/v1/calculate/body-fat` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/body-fat · OpenAPI operationId `calculate_body_fat_percentage` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "body-fat", "inputs": {…}}`

## Example

- Male, 175 cm, waist 85, neck 38, 70 kg: inputs `{"sex":"male","height_cm":175,"waist_cm":85,"neck_cm":38,"weight_kg":70}` → `{"body_fat_percent":16.9,"category":"Fitness","fat_mass_kg":11.9,"lean_mass_kg":58.1}`
- Female, 165 cm, waist 75, neck 33, hip 95: inputs `{"sex":"female","height_cm":165,"waist_cm":75,"neck_cm":33,"hip_cm":95}` → `{"body_fat_percent":26.9,"category":"Average"}`

```
GET https://tttkmbb.com/api/v1/calculate/body-fat?sex=male&height_cm=175&waist_cm=85&neck_cm=38&weight_kg=70
```

## Limitations

High accuracy is required (DEXA, hydrostatic weighing or BIA are better), or the person is a child or pregnant. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How accurate is the US Navy method?**

Roughly ±3–4 percentage points versus hydrostatic weighing for most adults; less accurate at very high or very low body fat.

**Where exactly do I measure?**

Neck just below the larynx, sloping slightly downward; waist horizontally at the navel (men) or the narrowest point (women); hips at the widest point (women).

## Related

- [Lean Body Mass Calculator](https://tttkmbb.com/health/lean-body-mass.md) — Formula-based lean mass without circumference measurements.
- [BMI Calculator](https://tttkmbb.com/health/bmi.md) — Compare with the simpler BMI screening measure.


---

# Ideal Weight Calculator

> Computes ideal body weight from height and sex with the four common clinical formulas (Devine, Robinson, Miller, Hamwi) and the BMI 18.5–24.9 healthy range.

- Calculator id: `ideal-weight` · Category: Health (`health`) · Tool name: `calculate_ideal_weight`
- Canonical page: https://tttkmbb.com/health/ideal-weight · This document: https://tttkmbb.com/health/ideal-weight.md · JSON definition: https://tttkmbb.com/health/ideal-weight.json

## Purpose

Computes ideal body weight from height and sex with the four common clinical formulas (Devine, Robinson, Miller, Hamwi) and the BMI 18.5–24.9 healthy range.

**Use when:** You need a reference 'ideal' weight for an adult, e.g. for drug dosing (Devine) or general guidance, or the healthy weight range for a height.

**Do not use when:** The person is under 18 or you need body-composition targets; the formulas are population averages, not individual prescriptions.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sex` | enum: male \| female |  | required | Biological sex used to select the formula coefficients. |
| `height_cm` | number | cm | required | Height in centimetres. Formulas are defined for heights above 152.4 cm (5 ft). (min 120, max 260) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `devine_kg` | number | kg | Most widely used in pharmacology. |
| `robinson_kg` | number | kg | Robinson et al. modification. |
| `miller_kg` | number | kg | Miller et al. modification. |
| `hamwi_kg` | number | kg | Hamwi method. |
| `healthy_bmi_range_min_kg` | number | kg | Weight at BMI 18.5. |
| `healthy_bmi_range_max_kg` | number | kg | Weight at BMI 24.9. |

## Formula

`With h = inches over 5 ft (60 in): Devine male 50 + 2.3h, female 45.5 + 2.3h; Robinson male 52 + 1.9h, female 49 + 1.7h; Miller male 56.2 + 1.41h, female 53.1 + 1.36h; Hamwi male 48 + 2.7h, female 45.5 + 2.2h. For heights under 5 ft the same slope is applied downward.`

## Data Sources

- Pai MP, Paloucek FP (2000) The origin of the 'ideal' body weight equations, Ann Pharmacother 34:1066-1069 — https://pubmed.ncbi.nlm.nih.gov/10981254/ (peer_reviewed, retrieved 2026-09-23)
- WHO – A healthy lifestyle: body mass index — https://www.who.int/europe/news-room/fact-sheets/item/a-healthy-lifestyle---who-recommendations (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ideal-weight?sex=…&height_cm=…`
- `POST https://tttkmbb.com/api/v1/calculate/ideal-weight` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ideal-weight · OpenAPI operationId `calculate_ideal_weight` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ideal-weight", "inputs": {…}}`

## Example

- Male, 175 cm: inputs `{"sex":"male","height_cm":175}` → `{"devine_kg":70.5,"robinson_kg":68.9,"miller_kg":68.7,"hamwi_kg":72,"healthy_bmi_range_min_kg":56.7,"healthy_bmi_range_max_kg":76.3}`
- Female, 160 cm: inputs `{"sex":"female","height_cm":160}` → `{"devine_kg":52.4,"robinson_kg":54.1}`

```
GET https://tttkmbb.com/api/v1/calculate/ideal-weight?sex=male&height_cm=175
```

## Limitations

The person is under 18 or you need body-composition targets; the formulas are population averages, not individual prescriptions. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why do the formulas disagree?**

Each was fitted to a different reference population and purpose (Devine for drug dosing, Hamwi for dietetics). Differences of 2–4 kg are normal; the BMI range is a broader, evidence-based guide.

**Is ideal weight the same as healthy weight?**

No. 'Ideal' formulas give a single point estimate; a healthy weight is any weight in the BMI 18.5–24.9 range for adults, with body composition taken into account.

## Related

- [BMI Calculator](https://tttkmbb.com/health/bmi.md) — Check where a current weight falls in the BMI categories.


---

# Water Intake Calculator

> Estimates daily drinking-water needs from body weight (35 ml per kg) plus an allowance for exercise time, reported in litres, millilitres and 240 ml cups.

- Calculator id: `water-intake` · Category: Health (`health`) · Tool name: `calculate_daily_water_intake`
- Canonical page: https://tttkmbb.com/health/water-intake · This document: https://tttkmbb.com/health/water-intake.md · JSON definition: https://tttkmbb.com/health/water-intake.json

## Purpose

Estimates daily drinking-water needs from body weight (35 ml per kg) plus an allowance for exercise time, reported in litres, millilitres and 240 ml cups.

**Use when:** You want a practical daily fluid target for a healthy adult based on weight and activity.

**Do not use when:** The person has kidney, heart or liver disease, is pregnant, or works in extreme heat; medical advice supersedes this rule of thumb.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `exercise_minutes_per_day` | number | min | optional, default 0 | Minutes of moderate exercise per day; adds about 355 ml (12 US fl oz) per 30 minutes. (min 0, max 600) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `water_liters_per_day` | number | L/day | Suggested drinking water per day. |
| `water_ml_per_day` | number | ml/day | Same amount in millilitres. |
| `cups_per_day` | number | cups | Number of 240 ml (8 US fl oz) cups. |

## Formula

`water_ml = 35 × weight_kg + 355 × (exercise_minutes / 30)`

The 30–35 ml/kg rule is a common dietetic heuristic. EFSA's adequate intake for total water (including food) is about 2.5 L/day for men and 2.0 L/day for women; roughly 20–30% of that comes from food.

## Data Sources

- EFSA (2010) Scientific Opinion on Dietary Reference Values for water — https://www.efsa.europa.eu/en/efsajournal/pub/1459 (standard, retrieved 2026-09-23)
- Mayo Clinic – Water: How much should you drink every day? — https://www.mayoclinic.org/healthy-lifestyle/nutrition-and-healthy-eating/in-depth/water/art-20044256 (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/water-intake?weight_kg=…`
- `POST https://tttkmbb.com/api/v1/calculate/water-intake` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/water-intake · OpenAPI operationId `calculate_daily_water_intake` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "water-intake", "inputs": {…}}`

## Example

- 70 kg, 30 min exercise: inputs `{"weight_kg":70,"exercise_minutes_per_day":30}` → `{"water_liters_per_day":2.81,"water_ml_per_day":2805,"cups_per_day":11.7}`
- 55 kg, no exercise: inputs `{"weight_kg":55}` → `{"water_liters_per_day":1.93}`

```
GET https://tttkmbb.com/api/v1/calculate/water-intake?weight_kg=70&exercise_minutes_per_day=30
```

## Limitations

The person has kidney, heart or liver disease, is pregnant, or works in extreme heat; medical advice supersedes this rule of thumb. The 30–35 ml/kg rule is a common dietetic heuristic. EFSA's adequate intake for total water (including food) is about 2.5 L/day for men and 2.0 L/day for women; roughly 20–30% of that comes from food. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does coffee or tea count?**

Yes, all beverages contribute to total water intake; caffeinated drinks in normal amounts are not net dehydrating.

**Can I drink too much?**

Yes. Drinking many litres in a short time can cause hyponatraemia. Spread intake over the day and drink to thirst during long exercise.

## Related

- [TDEE Calculator](https://tttkmbb.com/health/tdee.md) — Estimate calorie needs alongside hydration.


---

# Calorie Deficit & Weight Loss Time Calculator

> Converts a weight change goal into total energy and the number of days and weeks required at a given daily calorie deficit or surplus, using 7,700 kcal per kilogram of body fat.

- Calculator id: `calorie-deficit` · Category: Health (`health`) · Tool name: `calculate_calorie_deficit_timeline`
- Canonical page: https://tttkmbb.com/health/calorie-deficit · This document: https://tttkmbb.com/health/calorie-deficit.md · JSON definition: https://tttkmbb.com/health/calorie-deficit.json

## Purpose

Converts a weight change goal into total energy and the number of days and weeks required at a given daily calorie deficit or surplus, using 7,700 kcal per kilogram of body fat.

**Use when:** You know the current and target weight and a planned daily deficit (or surplus) and want a time estimate, or want the deficit needed to hit a date.

**Do not use when:** You need a medically supervised plan, the target implies more than 1 kg/week loss, or the person is a child; metabolic adaptation makes long projections approximate.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `current_weight_kg` | number | kg | required | Current body weight in kilograms. (> 0, max 700) |
| `target_weight_kg` | number | kg | required | Goal body weight in kilograms. (> 0, max 700) |
| `daily_deficit_kcal` | number | kcal/day | optional, default 500 | Absolute daily calorie deficit (for loss) or surplus (for gain). Sign is inferred from the weight change. (min 50, max 2000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `weight_change_kg` | number | kg | Target minus current weight (negative = loss). |
| `total_energy_kcal` | number | kcal | Energy equivalent of the weight change at 7,700 kcal/kg. |
| `days` | number | days | Days needed at the given daily deficit/surplus. |
| `weeks` | number | weeks | Same duration in weeks. |
| `weekly_change_kg` | number | kg/week | Rate of weight change implied by the deficit. |

## Formula

`total_kcal = |target − current| × 7700; days = total_kcal / daily_deficit; weekly_change = daily_deficit × 7 / 7700`

The 7,700 kcal/kg (3,500 kcal/lb) rule is a linear approximation; real loss slows as body mass and BMR fall (see Hall et al. 2011 for dynamic models).

## Data Sources

- Hall KD et al. (2011) Quantification of the effect of energy imbalance on bodyweight, Lancet 378:826-837 — https://pubmed.ncbi.nlm.nih.gov/21872751/ (peer_reviewed, retrieved 2026-09-23)
- NIH Body Weight Planner — https://www.niddk.nih.gov/bwp (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/calorie-deficit?current_weight_kg=…&target_weight_kg=…`
- `POST https://tttkmbb.com/api/v1/calculate/calorie-deficit` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/calorie-deficit · OpenAPI operationId `calculate_calorie_deficit_timeline` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "calorie-deficit", "inputs": {…}}`

## Example

- 80 → 75 kg at 500 kcal/day: inputs `{"current_weight_kg":80,"target_weight_kg":75,"daily_deficit_kcal":500}` → `{"weight_change_kg":-5,"total_energy_kcal":38500,"days":77,"weeks":11,"weekly_change_kg":-0.45}`

```
GET https://tttkmbb.com/api/v1/calculate/calorie-deficit?current_weight_kg=80&target_weight_kg=75&daily_deficit_kcal=500
```

## Limitations

You need a medically supervised plan, the target implies more than 1 kg/week loss, or the person is a child; metabolic adaptation makes long projections approximate. The 7,700 kcal/kg (3,500 kcal/lb) rule is a linear approximation; real loss slows as body mass and BMR fall (see Hall et al. 2011 for dynamic models). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is 500 kcal/day safe?**

For most adults a 500 kcal deficit (≈0.45 kg/week) is the commonly recommended upper-moderate rate; do not go below about 1,200 kcal/day (women) or 1,500 kcal/day (men) without supervision.

**Why is my real loss slower than predicted?**

Energy expenditure drops as you lose weight and adherence is rarely perfect. Expect the linear estimate to be optimistic by 20–30% over several months.

## Related

- [TDEE Calculator](https://tttkmbb.com/health/tdee.md) — Find maintenance calories to set the deficit from.


---

# Macro Calculator

> Splits a daily calorie target into grams of protein, carbohydrate and fat using a preset ratio (balanced, low-carb, high-protein, keto) or custom percentages.

- Calculator id: `macros` · Category: Health (`health`) · Tool name: `calculate_macros`
- Canonical page: https://tttkmbb.com/health/macros · This document: https://tttkmbb.com/health/macros.md · JSON definition: https://tttkmbb.com/health/macros.json

## Purpose

Splits a daily calorie target into grams of protein, carbohydrate and fat using a preset ratio (balanced, low-carb, high-protein, keto) or custom percentages.

**Use when:** You have a calorie target (from tdee) and want gram targets for each macronutrient.

**Do not use when:** Medical diets (renal, diabetic, PKU) are involved; those need individualised prescriptions.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `calories_per_day` | number | kcal/day | required | Daily calorie target. (min 500, max 10000) |
| `preset` | enum: balanced \| low_carb \| high_protein \| keto \| custom |  | optional, default "balanced" | Macronutrient ratio preset. Choose custom to supply your own percentages. |
| `protein_percent` | number | % | optional | Only for preset=custom. (min 0, max 100) |
| `carbs_percent` | number | % | optional | Only for preset=custom. (min 0, max 100) |
| `fat_percent` | number | % | optional | Only for preset=custom. (min 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `protein_g` | number | g/day | Protein grams (4 kcal/g). |
| `carbs_g` | number | g/day | Carbohydrate grams (4 kcal/g). |
| `fat_g` | number | g/day | Fat grams (9 kcal/g). |
| `ratio` | string |  | Protein/carbs/fat percentages applied. |

## Formula

`grams = calories × percent / (4 kcal/g for protein and carbohydrate, 9 kcal/g for fat)`

## Data Sources

- USDA Dietary Guidelines for Americans 2020–2025 – Acceptable Macronutrient Distribution Ranges — https://www.dietaryguidelines.gov/ (standard, retrieved 2026-09-23)
- Atwater general factors (FAO Food energy – methods of analysis and conversion factors) — https://www.fao.org/4/y5022e/y5022e00.htm (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/macros?calories_per_day=…`
- `POST https://tttkmbb.com/api/v1/calculate/macros` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/macros · OpenAPI operationId `calculate_macros` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "macros", "inputs": {…}}`

## Example

- 2000 kcal balanced: inputs `{"calories_per_day":2000,"preset":"balanced"}` → `{"protein_g":150,"carbs_g":200,"fat_g":67,"ratio":"30/40/30"}`
- 2200 kcal custom 35/35/30: inputs `{"calories_per_day":2200,"preset":"custom","protein_percent":35,"carbs_percent":35,"fat_percent":30}` → `{"protein_g":193,"carbs_g":193,"fat_g":73}`

```
GET https://tttkmbb.com/api/v1/calculate/macros?calories_per_day=2000&preset=balanced
```

## Limitations

Medical diets (renal, diabetic, PKU) are involved; those need individualised prescriptions. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which preset should I use?**

Balanced suits most people; high-protein helps preserve muscle in a deficit; keto requires carbs below ~50 g/day and is not suitable for everyone.

**Do the percentages have to sum to 100?**

Yes for custom ratios; the calculator returns an error otherwise.

## Related

- [TDEE Calculator](https://tttkmbb.com/health/tdee.md) — Get the calorie target first.
- [Protein Intake Calculator](https://tttkmbb.com/health/protein-intake.md) — Check protein against body-weight based recommendations.


---

# Heart Rate Zone Calculator

> Estimates maximum heart rate from age (Tanaka or Fox formula) and computes the five training zones, using the Karvonen heart-rate-reserve method when resting heart rate is supplied.

- Calculator id: `heart-rate-zones` · Category: Health (`health`) · Tool name: `calculate_heart_rate_zones`
- Canonical page: https://tttkmbb.com/health/heart-rate-zones · This document: https://tttkmbb.com/health/heart-rate-zones.md · JSON definition: https://tttkmbb.com/health/heart-rate-zones.json

## Purpose

Estimates maximum heart rate from age (Tanaka or Fox formula) and computes the five training zones, using the Karvonen heart-rate-reserve method when resting heart rate is supplied.

**Use when:** You need training heart-rate ranges (zones 1–5) for an adult from age, optionally refined by resting heart rate.

**Do not use when:** The person takes heart-rate-limiting medication (e.g. beta blockers) or has a measured maximum heart rate from a test (use that instead of an age formula).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `age_years` | number | years | required | Age in years. (min 5, max 120) |
| `resting_heart_rate` | number | bpm | optional | Optional resting heart rate; when given, zones use the Karvonen (heart-rate reserve) method. (min 25, max 150) |
| `max_hr_formula` | enum: tanaka \| fox |  | optional, default "tanaka" | Formula for maximum heart rate. Tanaka (2001) is more accurate across ages than the classic 220 − age. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `max_heart_rate` | number | bpm | Estimated maximum heart rate. |
| `method` | string |  | 'karvonen' when resting HR provided, otherwise 'percent_of_max'. |
| `zones` | list |  | Five zones with intensity range, lower and upper bpm and purpose. |

## Formula

`max_hr = 208 − 0.7·age (Tanaka) or 220 − age (Fox). Percent-of-max: zone = max_hr × %. Karvonen: target = (max_hr − resting) × % + resting. Zones: 50–60, 60–70, 70–80, 80–90, 90–100%.`

## Data Sources

- Tanaka H, Monahan KD, Seals DR (2001) Age-predicted maximal heart rate revisited, J Am Coll Cardiol 37:153-156 — https://pubmed.ncbi.nlm.nih.gov/11153730/ (peer_reviewed, retrieved 2026-09-23)
- Karvonen MJ, Kentala E, Mustala O (1957) The effects of training on heart rate, Ann Med Exp Biol Fenn 35:307-315 — https://pubmed.ncbi.nlm.nih.gov/13470504/ (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/heart-rate-zones?age_years=…`
- `POST https://tttkmbb.com/api/v1/calculate/heart-rate-zones` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/heart-rate-zones · OpenAPI operationId `calculate_heart_rate_zones` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "heart-rate-zones", "inputs": {…}}`

## Example

- Age 30, Tanaka, no resting HR: inputs `{"age_years":30}` → `{"max_heart_rate":187,"method":"percent_of_max"}`
- Age 40, resting 60, Fox: inputs `{"age_years":40,"resting_heart_rate":60,"max_hr_formula":"fox"}` → `{"max_heart_rate":180,"method":"karvonen"}`

```
GET https://tttkmbb.com/api/v1/calculate/heart-rate-zones?age_years=30
```

## Limitations

The person takes heart-rate-limiting medication (e.g. beta blockers) or has a measured maximum heart rate from a test (use that instead of an age formula). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why use Karvonen?**

It scales zones by heart-rate reserve (max − resting), so fitter people with low resting rates get more realistic targets than a plain percentage of max.

**How accurate are age formulas?**

Individual maximum heart rate varies by about ±10–12 bpm around any age formula. A supervised maximal test gives the real value.

## Related

- [Running Pace Calculator](https://tttkmbb.com/fitness/running-pace.md) — Pair heart-rate zones with pace targets.


---

# Pregnancy Due Date Calculator

> Estimates the due date, conception date and current gestational age from the first day of the last menstrual period, adjusting for cycle length (Naegele's rule).

- Calculator id: `pregnancy-due-date` · Category: Health (`health`) · Tool name: `calculate_pregnancy_due_date`
- Canonical page: https://tttkmbb.com/health/pregnancy-due-date · This document: https://tttkmbb.com/health/pregnancy-due-date.md · JSON definition: https://tttkmbb.com/health/pregnancy-due-date.json

## Purpose

Estimates the due date, conception date and current gestational age from the first day of the last menstrual period, adjusting for cycle length (Naegele's rule).

**Use when:** You know the first day of the last period and want the estimated due date, trimester dates or gestational age on a given date.

**Do not use when:** Cycles are very irregular, the LMP is unknown, or an ultrasound dating is available (ultrasound dating in the first trimester is more accurate and takes precedence).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `last_period_date` | date |  | required | First day of the last menstrual period (ISO date YYYY-MM-DD). |
| `cycle_length_days` | integer | days | optional, default 28 | Average menstrual cycle length; the due date shifts by (cycle − 28) days. (min 20, max 45) |
| `as_of_date` | date |  | optional | Optional date on which to report gestational age (weeks + days). Omit to skip. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `due_date` | date |  | LMP + 280 days + (cycle − 28). |
| `conception_date_estimate` | date |  | Approximately LMP + 14 days + (cycle − 28). |
| `second_trimester_start` | date |  | Week 14 (day 91 of pregnancy). |
| `third_trimester_start` | date |  | Week 28 (day 189). |
| `gestational_age` | string |  | Weeks and days as of as_of_date (only when as_of_date is given). |
| `gestational_days` | integer | days | Days since LMP as of as_of_date (only when given). |

## Formula

`due_date = LMP + 280 days + (cycle_length − 28); conception ≈ LMP + 14 + (cycle_length − 28); gestational_age = as_of_date − LMP`

## Data Sources

- ACOG Committee Opinion 700 (2017) Methods for Estimating the Due Date — https://www.acog.org/clinical/clinical-guidance/committee-opinion/articles/2017/05/methods-for-estimating-the-due-date (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pregnancy-due-date?last_period_date=…`
- `POST https://tttkmbb.com/api/v1/calculate/pregnancy-due-date` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pregnancy-due-date · OpenAPI operationId `calculate_pregnancy_due_date` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pregnancy-due-date", "inputs": {…}}`

## Example

- LMP 2026-01-01, 28-day cycle, as of 2026-04-15: inputs `{"last_period_date":"2026-01-01","cycle_length_days":28,"as_of_date":"2026-04-15"}` → `{"due_date":"2026-10-08","conception_date_estimate":"2026-01-15","second_trimester_start":"2026-04-02","third_trimester_start":"2026-07-09","gestational_age":"14 weeks 6 days","gestational_days":104}`
- LMP 2026-03-10, 32-day cycle: inputs `{"last_period_date":"2026-03-10","cycle_length_days":32}` → `{"due_date":"2026-12-19"}`

```
GET https://tttkmbb.com/api/v1/calculate/pregnancy-due-date?last_period_date=2026-01-01&cycle_length_days=28&as_of_date=2026-04-15
```

## Limitations

Cycles are very irregular, the LMP is unknown, or an ultrasound dating is available (ultrasound dating in the first trimester is more accurate and takes precedence). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How accurate is the due date?**

Only about 4% of babies arrive on the estimated date; most are born within two weeks either side. First-trimester ultrasound refines the estimate.

**How are trimesters defined?**

Following ACOG: first trimester through 13 weeks 6 days, second from 14 weeks 0 days, third from 28 weeks 0 days.

## Related

- [Ovulation Calculator](https://tttkmbb.com/health/ovulation.md) — Estimate fertile window and ovulation for a cycle.
- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — General date arithmetic.


---

# Ovulation Calculator

> Estimates the ovulation date, the six-day fertile window and the next period start from the first day of the last period and the average cycle length.

- Calculator id: `ovulation` · Category: Health (`health`) · Tool name: `calculate_ovulation_date`
- Canonical page: https://tttkmbb.com/health/ovulation · This document: https://tttkmbb.com/health/ovulation.md · JSON definition: https://tttkmbb.com/health/ovulation.json

## Purpose

Estimates the ovulation date, the six-day fertile window and the next period start from the first day of the last period and the average cycle length.

**Use when:** You want to estimate the most fertile days of a regular menstrual cycle.

**Do not use when:** Cycles vary by more than a few days, hormonal contraception is used, or you need contraception (calendar estimates are not reliable for preventing pregnancy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `last_period_date` | date |  | required | First day of the most recent period (YYYY-MM-DD). |
| `cycle_length_days` | integer | days | optional, default 28 | Average number of days from one period start to the next. (min 20, max 45) |
| `luteal_phase_days` | integer | days | optional, default 14 | Days from ovulation to the next period; 14 is the population average. (min 10, max 18) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ovulation_date` | date |  | Next period start minus the luteal phase. |
| `fertile_window_start` | date |  | Five days before ovulation (sperm survival). |
| `fertile_window_end` | date |  | Ovulation day. |
| `next_period_date` | date |  | LMP + cycle length. |
| `pregnancy_test_date` | date |  | Day of the expected next period. |

## Formula

`next_period = LMP + cycle_length; ovulation = next_period − luteal_phase; fertile_window = ovulation − 5 … ovulation`

## Data Sources

- Wilcox AJ, Weinberg CR, Baird DD (1995) Timing of sexual intercourse in relation to ovulation, N Engl J Med 333:1517-1521 — https://pubmed.ncbi.nlm.nih.gov/7477165/ (peer_reviewed, retrieved 2026-09-23)
- NHS – Trying to get pregnant: when am I most fertile? — https://www.nhs.uk/pregnancy/trying-for-a-baby/trying-to-get-pregnant/ (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ovulation?last_period_date=…`
- `POST https://tttkmbb.com/api/v1/calculate/ovulation` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ovulation · OpenAPI operationId `calculate_ovulation_date` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ovulation", "inputs": {…}}`

## Example

- LMP 2026-09-01, 28-day cycle: inputs `{"last_period_date":"2026-09-01","cycle_length_days":28}` → `{"ovulation_date":"2026-09-15","fertile_window_start":"2026-09-10","fertile_window_end":"2026-09-15","next_period_date":"2026-09-29"}`

```
GET https://tttkmbb.com/api/v1/calculate/ovulation?last_period_date=2026-09-01&cycle_length_days=28
```

## Limitations

Cycles vary by more than a few days, hormonal contraception is used, or you need contraception (calendar estimates are not reliable for preventing pregnancy). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How reliable is the estimate?**

Ovulation timing varies even in regular cycles; ovulation predictor kits or basal body temperature tracking are more precise than calendar methods.

## Related

- [Pregnancy Due Date Calculator](https://tttkmbb.com/health/pregnancy-due-date.md) — Once pregnant, estimate the due date from the same LMP.


---

# Waist-to-Height Ratio Calculator

> Divides waist circumference by height and classifies the ratio using the 'keep your waist to less than half your height' guidance (NICE 2022).

- Calculator id: `waist-to-height-ratio` · Category: Health (`health`) · Tool name: `calculate_waist_to_height_ratio`
- Canonical page: https://tttkmbb.com/health/waist-to-height-ratio · This document: https://tttkmbb.com/health/waist-to-height-ratio.md · JSON definition: https://tttkmbb.com/health/waist-to-height-ratio.json

## Purpose

Divides waist circumference by height and classifies the ratio using the 'keep your waist to less than half your height' guidance (NICE 2022).

**Use when:** You want a simple central-adiposity screen that predicts cardiometabolic risk better than BMI alone.

**Do not use when:** The person is under 18 or pregnant.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `waist_cm` | number | cm | required | Waist measured midway between the lowest rib and the top of the hip bone. (min 30, max 300) |
| `height_cm` | number | cm | required | Height in centimetres. (min 50, max 300) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ratio` | number |  | waist / height (same units). |
| `category` | string |  | Risk band: below 0.4 low/very slim, 0.4–0.49 healthy, 0.5–0.59 increased risk, 0.6 and above high risk. |
| `max_healthy_waist_cm` | number | cm | Waist circumference at which the ratio would reach 0.5. |

## Formula

`ratio = waist_cm / height_cm`

## Data Sources

- NICE guideline NG246 (2025) Overweight and obesity management – waist-to-height ratio — https://www.nice.org.uk/guidance/ng246 (standard, retrieved 2026-09-23)
- Ashwell M, Gibson S (2016) Waist-to-height ratio as an indicator of early health risk, BMJ Open 6:e010159 — https://bmjopen.bmj.com/content/6/3/e010159 (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/waist-to-height-ratio?waist_cm=…&height_cm=…`
- `POST https://tttkmbb.com/api/v1/calculate/waist-to-height-ratio` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/waist-to-height-ratio · OpenAPI operationId `calculate_waist_to_height_ratio` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "waist-to-height-ratio", "inputs": {…}}`

## Example

- Waist 85 cm, height 175 cm: inputs `{"waist_cm":85,"height_cm":175}` → `{"ratio":0.486,"category":"Healthy","max_healthy_waist_cm":87.5}`
- Waist 100 cm, height 170 cm: inputs `{"waist_cm":100,"height_cm":170}` → `{"ratio":0.588,"category":"Increased risk"}`

```
GET https://tttkmbb.com/api/v1/calculate/waist-to-height-ratio?waist_cm=85&height_cm=175
```

## Limitations

The person is under 18 or pregnant. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is 0.5 the threshold?**

Meta-analyses show cardiometabolic risk rises clearly once the waist exceeds half the height, across sexes and ethnic groups, which is why NICE adopted it.

## Related

- [BMI Calculator](https://tttkmbb.com/health/bmi.md) — Combine with BMI for a fuller screening picture.
- [Body Fat Calculator](https://tttkmbb.com/health/body-fat.md) — Estimate body-fat percentage from circumferences.


---

# Lean Body Mass Calculator

> Estimates lean body mass (fat-free mass) from weight, height and sex with the Boer (1984), James (1976) and Hume (1966) formulas.

- Calculator id: `lean-body-mass` · Category: Health (`health`) · Tool name: `calculate_lean_body_mass`
- Canonical page: https://tttkmbb.com/health/lean-body-mass · This document: https://tttkmbb.com/health/lean-body-mass.md · JSON definition: https://tttkmbb.com/health/lean-body-mass.json

## Purpose

Estimates lean body mass (fat-free mass) from weight, height and sex with the Boer (1984), James (1976) and Hume (1966) formulas.

**Use when:** You need fat-free mass for drug dosing, nutrition planning or as a body-composition reference without a scan.

**Do not use when:** You have measured body-fat percentage (lean mass = weight × (1 − body fat) is then more accurate) or the person is a child.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sex` | enum: male \| female |  | required | Biological sex used to select the formula coefficients. |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `height_cm` | number | cm | required | Height in centimetres. (min 50, max 300) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `boer_kg` | number | kg | Boer (1984) formula, commonly used for anaesthetic dosing. |
| `james_kg` | number | kg | James (1976) formula. |
| `hume_kg` | number | kg | Hume (1966) formula. |
| `boer_body_fat_percent` | number | % | 100 × (1 − boer_kg / weight_kg). |

## Formula

`Boer: male 0.407·W + 0.267·H − 19.2, female 0.252·W + 0.473·H − 48.3. James: male 1.1·W − 128·(W/H)², female 1.07·W − 148·(W/H)². Hume: male 0.32810·W + 0.33929·H − 29.5336, female 0.29569·W + 0.41813·H − 43.2933. W in kg, H in cm.`

## Data Sources

- Boer P (1984) Estimated lean body mass as an index for normalization of body fluid volumes in humans, Am J Physiol 247:F632-636 — https://pubmed.ncbi.nlm.nih.gov/6496691/ (peer_reviewed, retrieved 2026-09-23)
- Hume R (1966) Prediction of lean body mass from height and weight, J Clin Pathol 19:389-391 — https://pubmed.ncbi.nlm.nih.gov/5929341/ (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/lean-body-mass?sex=…&weight_kg=…&height_cm=…`
- `POST https://tttkmbb.com/api/v1/calculate/lean-body-mass` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/lean-body-mass · OpenAPI operationId `calculate_lean_body_mass` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "lean-body-mass", "inputs": {…}}`

## Example

- Male, 70 kg, 175 cm: inputs `{"sex":"male","weight_kg":70,"height_cm":175}` → `{"boer_kg":56,"james_kg":56.5,"hume_kg":52.8,"boer_body_fat_percent":20}`
- Female, 60 kg, 165 cm: inputs `{"sex":"female","weight_kg":60,"height_cm":165}` → `{"boer_kg":44.9,"james_kg":44.6,"hume_kg":43.4}`

```
GET https://tttkmbb.com/api/v1/calculate/lean-body-mass?sex=male&weight_kg=70&height_cm=175
```

## Limitations

You have measured body-fat percentage (lean mass = weight × (1 − body fat) is then more accurate) or the person is a child. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which formula should I use?**

Boer is the most common in clinical dosing; James overestimates in obesity; Hume is older. Differences of 2–4 kg are typical.

## Related

- [Body Fat Calculator](https://tttkmbb.com/health/body-fat.md) — Measure-based body fat and lean mass.


---

# Protein Intake Calculator

> Recommends a daily protein range in grams from body weight and goal (sedentary RDA 0.8 g/kg up to 1.6–2.2 g/kg for muscle gain or fat loss), based on the ISSN position stand.

- Calculator id: `protein-intake` · Category: Health (`health`) · Tool name: `calculate_protein_intake`
- Canonical page: https://tttkmbb.com/health/protein-intake · This document: https://tttkmbb.com/health/protein-intake.md · JSON definition: https://tttkmbb.com/health/protein-intake.json

## Purpose

Recommends a daily protein range in grams from body weight and goal (sedentary RDA 0.8 g/kg up to 1.6–2.2 g/kg for muscle gain or fat loss), based on the ISSN position stand.

**Use when:** You want a protein target in grams per day for an adult given their activity or goal.

**Do not use when:** Kidney disease or other medical conditions limit protein; consult a clinician.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `goal` | enum: sedentary \| active \| endurance \| muscle_gain \| fat_loss \| older_adult |  | optional, default "active" | Determines the g/kg range applied. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `protein_min_g` | number | g/day | Lower end of the range. |
| `protein_max_g` | number | g/day | Upper end of the range. |
| `protein_recommended_g` | number | g/day | Midpoint of the range. |
| `g_per_kg_range` | string |  | Grams per kilogram applied. |

## Formula

`protein_g = weight_kg × g_per_kg (range depends on goal)`

## Data Sources

- Jäger R et al. (2017) ISSN Position Stand: protein and exercise, J Int Soc Sports Nutr 14:20 — https://jissn.biomedcentral.com/articles/10.1186/s12970-017-0177-8 (peer_reviewed, retrieved 2026-09-23)
- National Academies – Dietary Reference Intakes for protein (RDA 0.8 g/kg) — https://nap.nationalacademies.org/catalog/10490 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/protein-intake?weight_kg=…`
- `POST https://tttkmbb.com/api/v1/calculate/protein-intake` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/protein-intake · OpenAPI operationId `calculate_protein_intake` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "protein-intake", "inputs": {…}}`

## Example

- 70 kg sedentary: inputs `{"weight_kg":70,"goal":"sedentary"}` → `{"protein_min_g":56,"protein_max_g":56,"protein_recommended_g":56,"g_per_kg_range":"0.8–0.8"}`
- 80 kg muscle gain: inputs `{"weight_kg":80,"goal":"muscle_gain"}` → `{"protein_min_g":128,"protein_max_g":176,"protein_recommended_g":152}`

```
GET https://tttkmbb.com/api/v1/calculate/protein-intake?weight_kg=70&goal=sedentary
```

## Limitations

Kidney disease or other medical conditions limit protein; consult a clinician. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Can I eat too much protein?**

Healthy adults tolerate intakes up to about 2 g/kg long term; higher intakes are not harmful for healthy kidneys but bring no extra benefit.

**Should I use total or lean body weight?**

For people with obesity, using target or lean body weight avoids unrealistically high targets.

## Related

- [Macro Calculator](https://tttkmbb.com/health/macros.md) — Fit the protein target into a full macro split.
- [Lean Body Mass Calculator](https://tttkmbb.com/health/lean-body-mass.md) — Use lean mass instead of total weight for very heavy individuals.


---

# Blood Pressure Category Calculator

> Classifies a systolic/diastolic blood pressure reading into the ACC/AHA 2017 categories (normal, elevated, stage 1, stage 2, hypertensive crisis) and reports mean arterial and pulse pressure.

- Calculator id: `blood-pressure` · Category: Health (`health`) · Tool name: `classify_blood_pressure`
- Canonical page: https://tttkmbb.com/health/blood-pressure · This document: https://tttkmbb.com/health/blood-pressure.md · JSON definition: https://tttkmbb.com/health/blood-pressure.json

## Purpose

Classifies a systolic/diastolic blood pressure reading into the ACC/AHA 2017 categories (normal, elevated, stage 1, stage 2, hypertensive crisis) and reports mean arterial and pulse pressure.

**Use when:** You have a resting blood-pressure reading and want the standard adult category plus MAP and pulse pressure.

**Do not use when:** Diagnosing hypertension (requires repeated readings over time) or for children and pregnant women, who use different thresholds.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `systolic_mmhg` | number | mmHg | required | Upper reading. (min 50, max 300) |
| `diastolic_mmhg` | number | mmHg | required | Lower reading. (min 20, max 200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `category` | string |  | ACC/AHA 2017 blood pressure category. |
| `mean_arterial_pressure_mmhg` | number | mmHg | MAP ≈ diastolic + (systolic − diastolic) / 3. |
| `pulse_pressure_mmhg` | number | mmHg | Systolic − diastolic. |

## Formula

`Normal <120 and <80; Elevated 120–129 and <80; Stage 1: 130–139 or 80–89; Stage 2: ≥140 or ≥90; Crisis: >180 and/or >120. MAP = DBP + (SBP − DBP)/3.`

## Data Sources

- Whelton PK et al. (2018) 2017 ACC/AHA Guideline for High Blood Pressure in Adults, Hypertension 71:e13-e115 — https://www.ahajournals.org/doi/10.1161/HYP.0000000000000065 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/blood-pressure?systolic_mmhg=…&diastolic_mmhg=…`
- `POST https://tttkmbb.com/api/v1/calculate/blood-pressure` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/blood-pressure · OpenAPI operationId `classify_blood_pressure` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "blood-pressure", "inputs": {…}}`

## Example

- 118/76: inputs `{"systolic_mmhg":118,"diastolic_mmhg":76}` → `{"category":"Normal","mean_arterial_pressure_mmhg":90,"pulse_pressure_mmhg":42}`
- 135/85: inputs `{"systolic_mmhg":135,"diastolic_mmhg":85}` → `{"category":"Hypertension stage 1"}`
- 185/95: inputs `{"systolic_mmhg":185,"diastolic_mmhg":95}` → `{"category":"Hypertensive crisis (seek care immediately)"}`

```
GET https://tttkmbb.com/api/v1/calculate/blood-pressure?systolic_mmhg=118&diastolic_mmhg=76
```

## Limitations

Diagnosing hypertension (requires repeated readings over time) or for children and pregnant women, who use different thresholds. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do European guidelines differ?**

Yes. ESC/ESH define hypertension from 140/90 mmHg and use 'high-normal' for 130–139/85–89; this calculator uses the US ACC/AHA 2017 scheme.

## Related

- [Heart Rate Zone Calculator](https://tttkmbb.com/health/heart-rate-zones.md) — Related cardiovascular training metric.


---

# Body Surface Area Calculator

> Computes body surface area in square metres from height and weight using the Mosteller and Du Bois formulas, as used for chemotherapy and other weight-independent dosing.

- Calculator id: `body-surface-area` · Category: Health (`health`) · Tool name: `calculate_body_surface_area`
- Canonical page: https://tttkmbb.com/health/body-surface-area · This document: https://tttkmbb.com/health/body-surface-area.md · JSON definition: https://tttkmbb.com/health/body-surface-area.json

## Purpose

Computes body surface area in square metres from height and weight using the Mosteller and Du Bois formulas, as used for chemotherapy and other weight-independent dosing.

**Use when:** You need BSA for drug dosing, cardiac index or physiological normalisation.

**Do not use when:** You need body composition or BMI; BSA does not indicate fatness.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `height_cm` | number | cm | required | Height in centimetres. (min 30, max 300) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `bsa_mosteller_m2` | number | m² | √(height_cm × weight_kg / 3600). |
| `bsa_dubois_m2` | number | m² | 0.007184 × weight^0.425 × height^0.725. |
| `bsa_haycock_m2` | number | m² | 0.024265 × weight^0.5378 × height^0.3964 (often used in paediatrics). |

## Formula

`Mosteller: BSA = √(H·W / 3600). Du Bois: BSA = 0.007184 · W^0.425 · H^0.725. Haycock: BSA = 0.024265 · W^0.5378 · H^0.3964. H in cm, W in kg.`

## Data Sources

- Mosteller RD (1987) Simplified calculation of body-surface area, N Engl J Med 317:1098 — https://pubmed.ncbi.nlm.nih.gov/3657876/ (peer_reviewed, retrieved 2026-09-23)
- Du Bois D, Du Bois EF (1916) A formula to estimate the approximate surface area if height and weight be known, Arch Intern Med 17:863-871 — https://pubmed.ncbi.nlm.nih.gov/2520314/ (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/body-surface-area?weight_kg=…&height_cm=…`
- `POST https://tttkmbb.com/api/v1/calculate/body-surface-area` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/body-surface-area · OpenAPI operationId `calculate_body_surface_area` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "body-surface-area", "inputs": {…}}`

## Example

- 70 kg, 175 cm: inputs `{"weight_kg":70,"height_cm":175}` → `{"bsa_mosteller_m2":1.845,"bsa_dubois_m2":1.847,"bsa_haycock_m2":1.85}`

```
GET https://tttkmbb.com/api/v1/calculate/body-surface-area?weight_kg=70&height_cm=175
```

## Limitations

You need body composition or BMI; BSA does not indicate fatness. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which formula do hospitals use?**

Mosteller is the most common because it is simple and within 1–2% of Du Bois for adults; Haycock is favoured for infants and children.

## Related

- [BMI Calculator](https://tttkmbb.com/health/bmi.md) — A different height–weight index used for weight classification.


---

# Running Pace Calculator

> Computes running pace in min/km and min/mile and speed in km/h and mph from a distance and elapsed time, and projects the finish time for 5 km, 10 km, half marathon and marathon at that constant pace.

- Calculator id: `running-pace` · Category: Sports & Fitness (`fitness`) · Tool name: `calculate_running_pace`
- Canonical page: https://tttkmbb.com/fitness/running-pace · This document: https://tttkmbb.com/fitness/running-pace.md · JSON definition: https://tttkmbb.com/fitness/running-pace.json

## Purpose

Computes running pace in min/km and min/mile and speed in km/h and mph from a distance and elapsed time, and projects the finish time for 5 km, 10 km, half marathon and marathon at that constant pace.

**Use when:** You know a distance and the time it took (or a target time) and need the pace, the equivalent speed, or the time that pace gives over standard race distances.

**Do not use when:** You want a realistic prediction of a longer race from a shorter one (pace slows with distance; use race-time-predictor), or you only need to convert between pace and speed units (use pace-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `distance` | number |  | required | Distance covered, in the unit given by distance_unit. (> 0, max 5000) |
| `distance_unit` | enum: km \| mi |  | optional, default "km" | Unit of the distance input. |
| `time` | string |  | required | Elapsed time as h:mm:ss (1:45:00), mm:ss (50:00) or plain minutes (50). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pace_min_per_km` | string | min:sec/km | Minutes and seconds per kilometre. |
| `pace_min_per_mile` | string | min:sec/mi | Minutes and seconds per mile. |
| `pace_seconds_per_km` | number | s/km | Same pace as a plain number of seconds per kilometre. |
| `speed_kmh` | number | km/h | Average speed in kilometres per hour. |
| `speed_mph` | number | mph | Average speed in miles per hour. |
| `distance_km` | number | km | Input distance converted to kilometres. |
| `time_5k` | string | h:mm:ss | Time to run 5 km at exactly this pace. |
| `time_10k` | string | h:mm:ss | Time to run 10 km at exactly this pace. |
| `time_half_marathon` | string | h:mm:ss | Time for 21.0975 km at exactly this pace. |
| `time_marathon` | string | h:mm:ss | Time for 42.195 km at exactly this pace. |

## Formula

`pace_s_per_km = time_seconds / distance_km; pace_s_per_mile = pace_s_per_km × 1.609344; speed_kmh = 3600 / pace_s_per_km; speed_mph = speed_kmh / 1.609344; time(D) = pace_s_per_km × D for D = 5, 10, 21.0975, 42.195 km`

Splits assume a perfectly even pace; they are not race predictions. Distances follow World Athletics definitions (half marathon 21.0975 km, marathon 42.195 km).

## Data Sources

- World Athletics – Book of Rules (Technical Rules: road race distances 5 km, 10 km, half marathon 21.0975 km, marathon 42.195 km) — https://worldathletics.org/about-iaaf/documents/book-of-rules (standard, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI (Appendix B: 1 mile = 1609.344 m, 1 yard = 0.9144 m) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/running-pace?distance=…&time=…`
- `POST https://tttkmbb.com/api/v1/calculate/running-pace` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/running-pace · OpenAPI operationId `calculate_running_pace` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_running_pace` (dedicated) or `run_calculator` with `{"calculator_id": "running-pace", "inputs": {…}}`

## Example

- 10 km in 50:00: inputs `{"distance":10,"distance_unit":"km","time":"50:00"}` → `{"pace_min_per_km":"5:00","pace_min_per_mile":"8:03","pace_seconds_per_km":300,"speed_kmh":12,"speed_mph":7.46,"time_5k":"0:25:00","time_half_marathon":"1:45:29","time_marathon":"3:30:59"}`
- 5 miles in 45:00: inputs `{"distance":5,"distance_unit":"mi","time":"45:00"}` → `{"pace_min_per_mile":"9:00","pace_min_per_km":"5:36","speed_mph":6.67,"speed_kmh":10.73,"time_10k":"0:55:55"}`

```
GET https://tttkmbb.com/api/v1/calculate/running-pace?distance=10&distance_unit=km&time=50%3A00
```

## Limitations

You want a realistic prediction of a longer race from a shorter one (pace slows with distance; use race-time-predictor), or you only need to convert between pace and speed units (use pace-converter). Splits assume a perfectly even pace; they are not race predictions. Distances follow World Athletics definitions (half marathon 21.0975 km, marathon 42.195 km). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I enter the time?**

As h:mm:ss (1:45:00), mm:ss (50:00) or a plain number of minutes (50 or 50.5).

**Why is my marathon split faster than what I could actually run?**

The splits hold the pace constant. Real performance slows with distance; race-time-predictor applies Riegel's fatigue exponent to model that.

## Related

- [Race Time Predictor](https://tttkmbb.com/fitness/race-time-predictor.md) — Predict realistic finish times for other distances instead of constant-pace splits.
- [Pace Converter](https://tttkmbb.com/fitness/pace-converter.md) — Convert between min/km, min/mile, km/h and mph directly.
- [Heart Rate Zone Calculator](https://tttkmbb.com/health/heart-rate-zones.md) — Pair pace targets with heart-rate training zones.


---

# Race Time Predictor

> Predicts finish times for 5 km, 10 km, half marathon and marathon from one known race result using Riegel's endurance formula T2 = T1 × (D2/D1)^1.06, with the corresponding paces.

- Calculator id: `race-time-predictor` · Category: Sports & Fitness (`fitness`) · Tool name: `predict_race_time`
- Canonical page: https://tttkmbb.com/fitness/race-time-predictor · This document: https://tttkmbb.com/fitness/race-time-predictor.md · JSON definition: https://tttkmbb.com/fitness/race-time-predictor.json

## Purpose

Predicts finish times for 5 km, 10 km, half marathon and marathon from one known race result using Riegel's endurance formula T2 = T1 × (D2/D1)^1.06, with the corresponding paces.

**Use when:** You have a recent race time (or time trial) and want equivalent-effort predictions for other standard distances, e.g. to set a marathon goal from a half-marathon result.

**Do not use when:** You only need the pace or constant-pace splits of a run (use running-pace), the known effort was a trail or very hilly race, or it was shorter than about 1.5 km or longer than a marathon.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `distance` | number |  | required | Distance of the race you already ran, in distance_unit. (> 0, max 500) |
| `distance_unit` | enum: km \| mi |  | optional, default "km" | Unit of the distance input. |
| `time` | string |  | required | Finish time of the known race as h:mm:ss, mm:ss or minutes. |
| `exponent` | number |  | optional, default 1.06 | Riegel's exponent; 1.06 fits elite and well-trained runners, 1.07–1.10 is often more realistic for recreational marathoners. (min 1, max 1.3) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `predicted_5k` | string | h:mm:ss | Predicted 5 km time. |
| `predicted_10k` | string | h:mm:ss | Predicted 10 km time. |
| `predicted_half_marathon` | string | h:mm:ss | Predicted time for 21.0975 km. |
| `predicted_marathon` | string | h:mm:ss | Predicted time for 42.195 km. |
| `predictions` | list |  | Per race: distance_km, time (h:mm:ss), pace_min_per_km and pace_min_per_mile. |

## Formula

`T2 = T1 × (D2 / D1)^exponent, exponent = 1.06 (Riegel 1981); pace = T2 / D2`

Riegel's power law was fitted to world-record performances from about 3.5 minutes to 4 hours and assumes comparable training for the target distance. Predictions from short races to the marathon are usually optimistic for non-elite runners.

## Data Sources

- Riegel PS (1981) Athletic records and human endurance, American Scientist 69:285-290 — https://pubmed.ncbi.nlm.nih.gov/7235349/ (peer_reviewed, retrieved 2026-09-23)
- World Athletics – Book of Rules (Technical Rules: road race distances 5 km, 10 km, half marathon 21.0975 km, marathon 42.195 km) — https://worldathletics.org/about-iaaf/documents/book-of-rules (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/race-time-predictor?distance=…&time=…`
- `POST https://tttkmbb.com/api/v1/calculate/race-time-predictor` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/race-time-predictor · OpenAPI operationId `predict_race_time` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "race-time-predictor", "inputs": {…}}`

## Example

- 10 km in 50:00: inputs `{"distance":10,"distance_unit":"km","time":"50:00"}` → `{"predicted_5k":"0:23:59","predicted_10k":"0:50:00","predicted_half_marathon":"1:50:19","predicted_marathon":"3:50:01"}`
- Half marathon in 1:45:00: inputs `{"distance":21.0975,"distance_unit":"km","time":"1:45:00"}` → `{"predicted_5k":"0:22:50","predicted_10k":"0:47:35","predicted_marathon":"3:38:55"}`

```
GET https://tttkmbb.com/api/v1/calculate/race-time-predictor?distance=10&distance_unit=km&time=50%3A00
```

## Limitations

You only need the pace or constant-pace splits of a run (use running-pace), the known effort was a trail or very hilly race, or it was shorter than about 1.5 km or longer than a marathon. Riegel's power law was fitted to world-record performances from about 3.5 minutes to 4 hours and assumes comparable training for the target distance. Predictions from short races to the marathon are usually optimistic for non-elite runners. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why 1.06?**

Riegel found that record times scale with distance to the power 1.06 for running (the 'fatigue factor'): doubling the distance takes about 2.085 times as long, i.e. pace slows by roughly 4 % per doubling.

**How accurate is the prediction?**

Typically within a few percent between neighbouring distances (10 km ↔ half marathon). Marathon predictions from a 5 km are often 5–10 % too fast unless mileage is high; raising the exponent to 1.07–1.10 compensates.

## Related

- [Running Pace Calculator](https://tttkmbb.com/fitness/running-pace.md) — Constant-pace splits and speed for a given distance and time.
- [VO2 Max Calculator](https://tttkmbb.com/fitness/vo2-max.md) — Estimate aerobic capacity from a 12-minute run.


---

# Calories Burned Calculator

> Estimates the calories burned during an activity from body weight, duration and the activity's MET value from the 2011 Compendium of Physical Activities, using the ACSM metabolic equation kcal/min = MET × 3.5 × kg / 200.

- Calculator id: `calories-burned` · Category: Sports & Fitness (`fitness`) · Tool name: `estimate_calories_burned`
- Canonical page: https://tttkmbb.com/fitness/calories-burned · This document: https://tttkmbb.com/fitness/calories-burned.md · JSON definition: https://tttkmbb.com/fitness/calories-burned.json

## Purpose

Estimates the calories burned during an activity from body weight, duration and the activity's MET value from the 2011 Compendium of Physical Activities, using the ACSM metabolic equation kcal/min = MET × 3.5 × kg / 200.

**Use when:** You need an estimate of energy expenditure for a workout, sport or chore of known duration for a person of known weight.

**Do not use when:** You need total daily calorie needs (use tdee) or resting expenditure (use bmr); MET values are population averages and ignore fitness level, terrain and intensity within a category.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight_kg` | number | kg | required | Body weight in kilograms. (> 0, max 700) |
| `duration_minutes` | number | min | required | Duration of the activity in minutes. (> 0, max 1440) |
| `activity` | enum: walking_3_5_mph \| running_6_mph \| running_8_mph \| cycling_moderate \| swimming_laps_moderate \| weight_training \| yoga \| hiking \| jump_rope \| rowing_moderate \| elliptical \| basketball \| soccer \| tennis \| dancing \| housework |  | required | Activity and intensity; each maps to a MET value from the 2011 Compendium of Physical Activities. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `calories_kcal` | number | kcal | Gross energy expenditure for the session (includes resting metabolism during that time). |
| `kcal_per_minute` | number | kcal/min | Energy expenditure per minute. |
| `kcal_per_hour` | number | kcal/h | Energy expenditure per hour of the activity. |
| `met` | number | MET | Metabolic equivalent of the activity (1 MET = 3.5 ml O2/kg/min, resting). |
| `activity_label` | string |  | Activity description used, with its MET value. |

## Formula

`kcal_per_minute = MET × 3.5 × weight_kg / 200; calories_kcal = kcal_per_minute × duration_minutes`

3.5 ml O2/kg/min is the resting oxygen uptake of 1 MET and 1 litre of O2 corresponds to about 5 kcal, giving kcal/min = MET × 3.5 × kg / 200. Net calories above rest are roughly (MET − 1) / MET of the gross value.

## Data Sources

- Ainsworth BE et al. (2011) 2011 Compendium of Physical Activities: a second update of codes and MET values, Med Sci Sports Exerc 43:1575-1581 — https://pubmed.ncbi.nlm.nih.gov/21681120/ (peer_reviewed, retrieved 2026-09-23)
- Compendium of Physical Activities – online MET tables (2011 and 2024 editions) — https://pacompendium.com/ (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/calories-burned?weight_kg=…&duration_minutes=…&activity=…`
- `POST https://tttkmbb.com/api/v1/calculate/calories-burned` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/calories-burned · OpenAPI operationId `estimate_calories_burned` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "calories-burned", "inputs": {…}}`

## Example

- 70 kg, running 6 mph, 30 min: inputs `{"weight_kg":70,"duration_minutes":30,"activity":"running_6_mph"}` → `{"calories_kcal":360,"kcal_per_minute":12.01,"kcal_per_hour":720,"met":9.8}`
- 65 kg, walking 3.5 mph, 60 min: inputs `{"weight_kg":65,"duration_minutes":60,"activity":"walking_3_5_mph"}` → `{"calories_kcal":293,"kcal_per_minute":4.89,"met":4.3}`

```
GET https://tttkmbb.com/api/v1/calculate/calories-burned?weight_kg=70&duration_minutes=30&activity=running_6_mph
```

## Limitations

You need total daily calorie needs (use tdee) or resting expenditure (use bmr); MET values are population averages and ignore fitness level, terrain and intensity within a category. 3.5 ml O2/kg/min is the resting oxygen uptake of 1 MET and 1 litre of O2 corresponds to about 5 kcal, giving kcal/min = MET × 3.5 × kg / 200. Net calories above rest are roughly (MET − 1) / MET of the gross value. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Are these gross or net calories?**

Gross: they include the calories you would have burned resting during the same time (about 1 MET). Subtract weight_kg × duration_minutes / 60 for the net exercise cost.

**Why does the same run burn a different number on my watch?**

Devices add heart rate, speed and personal data; MET tables are averages for a standard 70 kg adult, so ±20 % differences are normal.

## Related

- [TDEE Calculator](https://tttkmbb.com/health/tdee.md) — Daily calorie needs including all activity.
- [BMR Calculator](https://tttkmbb.com/health/bmr.md) — Resting energy expenditure that the gross figure includes.
- [Steps to Distance Calculator](https://tttkmbb.com/fitness/steps-to-distance.md) — Turn a step count into a walking distance first.


---

# One-Rep Max Calculator

> Estimates the one-repetition maximum from a weight lifted for 2–12 repetitions using the Epley, Brzycki and Lombardi equations, reports their average, and lists training loads at 95 % to 70 % of that 1RM.

- Calculator id: `one-rep-max` · Category: Sports & Fitness (`fitness`) · Tool name: `estimate_one_rep_max`
- Canonical page: https://tttkmbb.com/fitness/one-rep-max · This document: https://tttkmbb.com/fitness/one-rep-max.md · JSON definition: https://tttkmbb.com/fitness/one-rep-max.json

## Purpose

Estimates the one-repetition maximum from a weight lifted for 2–12 repetitions using the Epley, Brzycki and Lombardi equations, reports their average, and lists training loads at 95 % to 70 % of that 1RM.

**Use when:** You want to estimate maximal strength or program training percentages without attempting a true single-rep maximum.

**Do not use when:** The set was more than 12 repetitions (prediction error grows quickly) or was not taken close to failure; use a heavier, lower-rep set instead.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight_lifted` | number | kg or lb | required | Load lifted for the set, in any unit; outputs use the same unit. (> 0, max 2000) |
| `reps` | integer | reps | required | Repetitions completed with that load, ideally to (near) failure. (min 2, max 12) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `one_rep_max` | number |  | Mean of the Epley, Brzycki and Lombardi estimates, in the unit of weight_lifted. |
| `epley` | number |  | 1RM = w × (1 + reps / 30). |
| `brzycki` | number |  | 1RM = w × 36 / (37 − reps). |
| `lombardi` | number |  | 1RM = w × reps^0.10. |
| `percentages` | list |  | Load at 95, 90, 85, 80, 75 and 70 % of the averaged 1RM. |

## Formula

`Epley: 1RM = w × (1 + reps/30); Brzycki: 1RM = w × 36 / (37 − reps); Lombardi: 1RM = w × reps^0.10; one_rep_max = (Epley + Brzycki + Lombardi) / 3; load_p = one_rep_max × p / 100`

The equations agree within about 2 % for 2–6 reps and Epley and Brzycki coincide at 10 reps; beyond that Brzycki rises fastest and Lombardi stays lowest, so estimates diverge. Percentages use the averaged estimate.

## Data Sources

- Reynolds JM, Gordon TJ, Robergs RA (2006) Prediction of one repetition maximum strength from multiple repetition maximum testing and anthropometry, J Strength Cond Res 20:584-592 — https://pubmed.ncbi.nlm.nih.gov/16937972/ (peer_reviewed, retrieved 2026-09-23)
- Wikipedia – One-repetition maximum (formula collection with original citations: Epley 1985, Brzycki 1993, Lombardi 1989) — https://en.wikipedia.org/wiki/One-repetition_maximum (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/one-rep-max?weight_lifted=…&reps=…`
- `POST https://tttkmbb.com/api/v1/calculate/one-rep-max` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/one-rep-max · OpenAPI operationId `estimate_one_rep_max` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "one-rep-max", "inputs": {…}}`

## Example

- 100 kg × 5 reps: inputs `{"weight_lifted":100,"reps":5}` → `{"epley":116.7,"brzycki":112.5,"lombardi":117.5,"one_rep_max":115.5,"percentages":[{"percent":95,"load":109.8},{"percent":90,"load":104},{"percent":85,"load":98.2},{"percent":80,"load":92.4},{"percent":75,"load":86.7},{"percent":70,"load":80.9}]}`
- 60 kg × 10 reps: inputs `{"weight_lifted":60,"reps":10}` → `{"epley":80,"brzycki":80,"lombardi":75.5,"one_rep_max":78.5}`

```
GET https://tttkmbb.com/api/v1/calculate/one-rep-max?weight_lifted=100&reps=5
```

## Limitations

The set was more than 12 repetitions (prediction error grows quickly) or was not taken close to failure; use a heavier, lower-rep set instead. The equations agree within about 2 % for 2–6 reps and Epley and Brzycki coincide at 10 reps; beyond that Brzycki rises fastest and Lombardi stays lowest, so estimates diverge. Percentages use the averaged estimate. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which formula is best?**

For 2–6 reps they agree closely; Brzycki is widely used in the USA for bench press, Epley for squat and deadlift. Averaging reduces the influence of any one equation's bias.

**Can I use pounds?**

Yes. The equations are unit-free: enter pounds and every output is in pounds.

## Related

- [Protein Intake Calculator](https://tttkmbb.com/health/protein-intake.md) — Protein targets for strength and muscle gain.
- [Calories Burned Calculator](https://tttkmbb.com/fitness/calories-burned.md) — Energy cost of a weight-training session.


---

# VO2 Max Calculator

> Estimates maximal oxygen uptake (VO2max, ml/kg/min) from the distance covered in the Cooper 12-minute run test, and/or from the ratio of maximum to resting heart rate (Uth et al. 2004).

- Calculator id: `vo2-max` · Category: Sports & Fitness (`fitness`) · Tool name: `estimate_vo2_max`
- Canonical page: https://tttkmbb.com/fitness/vo2-max · This document: https://tttkmbb.com/fitness/vo2-max.md · JSON definition: https://tttkmbb.com/fitness/vo2-max.json

## Purpose

Estimates maximal oxygen uptake (VO2max, ml/kg/min) from the distance covered in the Cooper 12-minute run test, and/or from the ratio of maximum to resting heart rate (Uth et al. 2004).

**Use when:** You have a 12-minute run distance or resting and maximum heart rates and want a field estimate of aerobic fitness.

**Do not use when:** A laboratory or wearable-measured VO2max is available, or the person cannot run continuously for 12 minutes; the heart-rate method also requires a true (measured) maximum heart rate.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `distance_m` | number | m | optional | Distance covered in 12 minutes of running (Cooper test). Omit if using heart rates only. (min 600, max 6000) |
| `resting_heart_rate` | number | bpm | optional | Resting heart rate, measured on waking. Needed together with max_heart_rate for the heart-rate ratio method. (min 25, max 150) |
| `max_heart_rate` | number | bpm | optional | Measured maximum heart rate (an age formula such as 220 − age adds error). (min 80, max 250) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `vo2max_ml_kg_min` | number | ml/kg/min | Primary estimate: Cooper test when distance_m is given, otherwise the heart-rate ratio method. |
| `method` | string |  | Which estimate is reported as primary. |
| `vo2max_cooper_ml_kg_min` | number | ml/kg/min | (distance_m − 504.9) / 44.73; only when distance_m is given. |
| `vo2max_heart_rate_ratio_ml_kg_min` | number | ml/kg/min | 15.3 × max_heart_rate / resting_heart_rate; only when both heart rates are given. |

## Formula

`Cooper: VO2max = (distance_m − 504.9) / 44.73; heart-rate ratio: VO2max = 15.3 × max_heart_rate / resting_heart_rate (ml/kg/min)`

Cooper (1968) correlated 12-minute run distance with treadmill VO2max in US Air Force personnel (r = 0.90). The heart-rate ratio method (Uth 2004) was derived in trained men; its standard error is about 4.5 ml/kg/min.

## Data Sources

- Cooper KH (1968) A means of assessing maximal oxygen intake: correlation between field and treadmill testing, JAMA 203:201-204 — https://pubmed.ncbi.nlm.nih.gov/5694044/ (peer_reviewed, retrieved 2026-09-23)
- Uth N et al. (2004) Estimation of VO2max from the ratio between HRmax and HRrest – the Heart Rate Ratio Method, Eur J Appl Physiol 91:111-115 — https://pubmed.ncbi.nlm.nih.gov/14624296/ (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/vo2-max?`
- `POST https://tttkmbb.com/api/v1/calculate/vo2-max` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/vo2-max · OpenAPI operationId `estimate_vo2_max` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "vo2-max", "inputs": {…}}`

## Example

- Cooper test 2800 m: inputs `{"distance_m":2800}` → `{"vo2max_ml_kg_min":51.3,"vo2max_cooper_ml_kg_min":51.3,"method":"Cooper 12-minute run test"}`
- Resting 60 bpm, max 180 bpm: inputs `{"resting_heart_rate":60,"max_heart_rate":180}` → `{"vo2max_ml_kg_min":45.9,"vo2max_heart_rate_ratio_ml_kg_min":45.9,"method":"Heart-rate ratio (Uth 2004)"}`

```
GET https://tttkmbb.com/api/v1/calculate/vo2-max?distance_m=2800
```

## Limitations

A laboratory or wearable-measured VO2max is available, or the person cannot run continuously for 12 minutes; the heart-rate method also requires a true (measured) maximum heart rate. Cooper (1968) correlated 12-minute run distance with treadmill VO2max in US Air Force personnel (r = 0.90). The heart-rate ratio method (Uth 2004) was derived in trained men; its standard error is about 4.5 ml/kg/min. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is a good VO2 max?**

Population norms depend strongly on age and sex: roughly 35–45 ml/kg/min for healthy adults in their 30s, above 55 for well-trained endurance athletes and 70–85 for elites.

**Can I use 220 − age for the maximum heart rate?**

You can, but the individual error of age formulas (±10–12 bpm) propagates directly into the estimate; a measured maximum from an all-out effort is better.

## Related

- [Heart Rate Zone Calculator](https://tttkmbb.com/health/heart-rate-zones.md) — Training zones from the same maximum and resting heart rates.
- [Race Time Predictor](https://tttkmbb.com/fitness/race-time-predictor.md) — Predict race times from a known performance.


---

# Steps to Distance Calculator

> Converts a pedometer step count into distance using a measured stride length, or a walking stride estimated from height (stride ≈ 0.414 × height).

- Calculator id: `steps-to-distance` · Category: Sports & Fitness (`fitness`) · Tool name: `convert_steps_to_distance`
- Canonical page: https://tttkmbb.com/fitness/steps-to-distance · This document: https://tttkmbb.com/fitness/steps-to-distance.md · JSON definition: https://tttkmbb.com/fitness/steps-to-distance.json

## Purpose

Converts a pedometer step count into distance using a measured stride length, or a walking stride estimated from height (stride ≈ 0.414 × height).

**Use when:** You have a daily step count and want to know the distance walked in kilometres and miles, or the number of steps in a kilometre or mile.

**Do not use when:** The steps were mostly running (running strides are considerably longer; enter a measured stride_length_m instead) or you need calories (use calories-burned with the walking activity).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `steps` | integer | steps | required | Number of steps taken. (min 0, max 10000000) |
| `height_cm` | number | cm | optional | Height, used to estimate a walking stride of 0.414 × height when stride_length_m is not given. (min 50, max 300) |
| `stride_length_m` | number | m | optional | Measured length of one step in metres (heel to heel). Overrides the height estimate. (> 0, max 3) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `distance_km` | number | km | Distance walked in kilometres. |
| `distance_mi` | number | mi | Distance walked in miles. |
| `distance_m` | number | m | Distance walked in metres. |
| `stride_length_m` | number | m | Step length applied (measured or 0.414 × height). |
| `steps_per_km` | number | steps/km | 1000 / stride_length_m. |
| `steps_per_mile` | number | steps/mi | 1609.344 / stride_length_m. |

## Formula

`stride_length_m = 0.414 × height_cm / 100 (unless measured); distance_m = steps × stride_length_m; distance_km = distance_m / 1000; distance_mi = distance_km / 1.609344`

Step length at normal walking speed is about 41–43 % of height, which gives roughly 2,000–2,500 steps per mile for adults; Hoeger et al. (2008) measured similar counts and showed step length increases with speed. Measure 10 steps and divide for a personal value.

## Data Sources

- Hoeger WWK et al. (2008) One-mile step count at walking and running speeds, ACSM's Health & Fitness Journal 12(1):14-19 — https://journals.lww.com/acsm-healthfitness/abstract/2008/01000/one_mile_step_count_at_walking_and_running_speeds.7.aspx (peer_reviewed, retrieved 2026-09-23)
- Tudor-Locke C et al. (2011) How many steps/day are enough? For adults, Int J Behav Nutr Phys Act 8:79 — https://ijbnpa.biomedcentral.com/articles/10.1186/1479-5868-8-79 (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/steps-to-distance?steps=…`
- `POST https://tttkmbb.com/api/v1/calculate/steps-to-distance` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/steps-to-distance · OpenAPI operationId `convert_steps_to_distance` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "steps-to-distance", "inputs": {…}}`

## Example

- 10,000 steps, 175 cm tall: inputs `{"steps":10000,"height_cm":175}` → `{"stride_length_m":0.725,"distance_km":7.245,"distance_mi":4.502,"distance_m":7245,"steps_per_km":1380}`
- 8,000 steps, measured stride 0.80 m: inputs `{"steps":8000,"stride_length_m":0.8}` → `{"distance_km":6.4,"distance_mi":3.977,"steps_per_mile":2012}`

```
GET https://tttkmbb.com/api/v1/calculate/steps-to-distance?steps=10000&height_cm=175
```

## Limitations

The steps were mostly running (running strides are considerably longer; enter a measured stride_length_m instead) or you need calories (use calories-burned with the walking activity). Step length at normal walking speed is about 41–43 % of height, which gives roughly 2,000–2,500 steps per mile for adults; Hoeger et al. (2008) measured similar counts and showed step length increases with speed. Measure 10 steps and divide for a personal value. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is 'stride' one step or two?**

Here stride_length_m is the length of one step (heel of one foot to heel of the other). Some pedometers define a stride as two steps; halve such a value before entering it.

**How far is 10,000 steps?**

About 7–8 km (4.5–5 miles) for most adults walking, depending on height and pace.

## Related

- [Calories Burned Calculator](https://tttkmbb.com/fitness/calories-burned.md) — Estimate the calories of the walk from its duration.
- [Running Pace Calculator](https://tttkmbb.com/fitness/running-pace.md) — Pace and speed once distance and time are known.


---

# Swim Pace Calculator

> Computes swimming pace per 100 metres and per 100 yards, speed in m/s and km/h, and the number of 25 m and 50 m pool lengths from a swum distance and time.

- Calculator id: `swim-pace` · Category: Sports & Fitness (`fitness`) · Tool name: `calculate_swim_pace`
- Canonical page: https://tttkmbb.com/fitness/swim-pace · This document: https://tttkmbb.com/fitness/swim-pace.md · JSON definition: https://tttkmbb.com/fitness/swim-pace.json

## Purpose

Computes swimming pace per 100 metres and per 100 yards, speed in m/s and km/h, and the number of 25 m and 50 m pool lengths from a swum distance and time.

**Use when:** You swam (or plan to swim) a given distance in a given time and need the pace per 100 m or 100 yd, e.g. to set interval targets.

**Do not use when:** The distance is in yards (convert first: 1 yd = 0.9144 m) or you need running/cycling pace (use running-pace or pace-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `distance_m` | number | m | required | Distance swum in metres. (> 0, max 100000) |
| `time` | string |  | required | Elapsed time as h:mm:ss, mm:ss (30:00) or plain minutes. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pace_per_100m` | string | min:sec/100 m | Time per 100 metres. |
| `pace_per_100yd` | string | min:sec/100 yd | Time per 100 yards (91.44 m). |
| `pace_seconds_per_100m` | number | s/100 m | Same pace as seconds per 100 m. |
| `speed_m_per_s` | number | m/s | Average speed in metres per second. |
| `speed_kmh` | number | km/h | Average speed in kilometres per hour. |
| `lengths_25m_pool` | number | lengths | distance_m / 25. |
| `lengths_50m_pool` | number | lengths | distance_m / 50. |

## Formula

`pace_100m = time_seconds × 100 / distance_m; pace_100yd = pace_100m × 0.9144; speed_m_per_s = distance_m / time_seconds; speed_kmh = speed_m_per_s × 3.6`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the SI (Appendix B: 1 mile = 1609.344 m, 1 yard = 0.9144 m) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- World Aquatics – Facilities Rules (25 m and 50 m competition pools) — https://www.worldaquatics.com/rules (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/swim-pace?distance_m=…&time=…`
- `POST https://tttkmbb.com/api/v1/calculate/swim-pace` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/swim-pace · OpenAPI operationId `calculate_swim_pace` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "swim-pace", "inputs": {…}}`

## Example

- 1500 m in 30:00: inputs `{"distance_m":1500,"time":"30:00"}` → `{"pace_per_100m":"2:00","pace_per_100yd":"1:50","pace_seconds_per_100m":120,"speed_m_per_s":0.833,"speed_kmh":3,"lengths_25m_pool":60}`
- 400 m in 6:40: inputs `{"distance_m":400,"time":"6:40"}` → `{"pace_per_100m":"1:40","pace_per_100yd":"1:31","speed_m_per_s":1,"speed_kmh":3.6,"lengths_50m_pool":8}`

```
GET https://tttkmbb.com/api/v1/calculate/swim-pace?distance_m=1500&time=30%3A00
```

## Limitations

The distance is in yards (convert first: 1 yd = 0.9144 m) or you need running/cycling pace (use running-pace or pace-converter). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the pace per 100 yards faster than per 100 metres?**

100 yards is 91.44 m, about 8.6 % shorter, so the same speed gives a proportionally shorter time. Short-course-yards (SCY) times are not directly comparable with metres.

**What is a typical pace?**

Recreational lap swimmers commonly hold 2:00–2:30 per 100 m; competitive distance swimmers are near 1:05–1:15 per 100 m.

## Related

- [Pace Converter](https://tttkmbb.com/fitness/pace-converter.md) — Convert running paces and speeds between units.
- [Calories Burned Calculator](https://tttkmbb.com/fitness/calories-burned.md) — Energy cost of the swim from its duration.


---

# Pace Converter

> Converts a running pace or speed given in any one of min/km, min/mile, km/h or mph into all four units, plus seconds per km/mile and metres per second.

- Calculator id: `pace-converter` · Category: Sports & Fitness (`fitness`) · Tool name: `convert_running_pace`
- Canonical page: https://tttkmbb.com/fitness/pace-converter · This document: https://tttkmbb.com/fitness/pace-converter.md · JSON definition: https://tttkmbb.com/fitness/pace-converter.json

## Purpose

Converts a running pace or speed given in any one of min/km, min/mile, km/h or mph into all four units, plus seconds per km/mile and metres per second.

**Use when:** You need to translate a treadmill speed into a pace, a min/mile pace into min/km, or any other pace/speed unit conversion.

**Do not use when:** You have a distance and time rather than a pace (use running-pace) or a swim time (use swim-pace).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `pace_min_per_km` | string |  | optional | Pace as mm:ss per kilometre (e.g. 5:00) or decimal minutes (5.5). Give exactly one of the four inputs; if several are given, this one takes precedence. |
| `pace_min_per_mile` | string |  | optional | Pace as mm:ss per mile (e.g. 8:03) or decimal minutes. |
| `speed_kmh` | number | km/h | optional | Speed in kilometres per hour (e.g. treadmill display). (> 0, max 100) |
| `speed_mph` | number | mph | optional | Speed in miles per hour. (> 0, max 60) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pace_min_per_km` | string | min:sec/km | Minutes and seconds per kilometre. |
| `pace_min_per_mile` | string | min:sec/mi | Minutes and seconds per mile. |
| `speed_kmh` | number | km/h | Kilometres per hour. |
| `speed_mph` | number | mph | Miles per hour. |
| `pace_seconds_per_km` | number | s/km | Pace as seconds per kilometre. |
| `pace_seconds_per_mile` | number | s/mi | Pace as seconds per mile. |
| `speed_m_per_s` | number | m/s | Metres per second. |
| `source_input` | string |  | Which input was used as the source value. |

## Formula

`pace_s_per_km = 3600 / speed_kmh; pace_s_per_mile = pace_s_per_km × 1.609344; speed_mph = speed_kmh / 1.609344; speed_m_per_s = speed_kmh / 3.6 (1 mile = 1609.344 m)`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the SI (Appendix B: 1 mile = 1609.344 m, 1 yard = 0.9144 m) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pace-converter?`
- `POST https://tttkmbb.com/api/v1/calculate/pace-converter` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pace-converter · OpenAPI operationId `convert_running_pace` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pace-converter", "inputs": {…}}`

## Example

- 5:00 min/km: inputs `{"pace_min_per_km":"5:00"}` → `{"pace_min_per_mile":"8:03","speed_kmh":12,"speed_mph":7.46,"pace_seconds_per_km":300,"pace_seconds_per_mile":482.8,"speed_m_per_s":3.333,"source_input":"pace_min_per_km"}`
- 6 mph treadmill: inputs `{"speed_mph":6}` → `{"speed_kmh":9.66,"pace_min_per_mile":"10:00","pace_min_per_km":"6:13","pace_seconds_per_km":372.8}`

```
GET https://tttkmbb.com/api/v1/calculate/pace-converter?pace_min_per_km=5%3A00
```

## Limitations

You have a distance and time rather than a pace (use running-pace) or a swim time (use swim-pace). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if I give more than one input?**

The first available in the order pace_min_per_km, pace_min_per_mile, speed_kmh, speed_mph is used and the rest are ignored; a note says which one.

**How do I enter a pace like 7 minutes 30 seconds?**

As 7:30 or as decimal minutes 7.5; both give the same result.

## Related

- [Running Pace Calculator](https://tttkmbb.com/fitness/running-pace.md) — Pace from a distance and time, with race splits.
- [Swim Pace Calculator](https://tttkmbb.com/fitness/swim-pace.md) — Pace per 100 m for swimming.
- [Speed Converter](https://tttkmbb.com/conversion/speed.md) — General speed unit conversions.


---

# Percentage Calculator

> Solves the three basic percentage questions (a percentage of a number, what percentage one number is of another, and the whole behind a known part and percentage). Always returns the part, the whole and the percent.

- Calculator id: `percentage` · Category: Math (`math`) · Tool name: `calculate_percentage`
- Canonical page: https://tttkmbb.com/math/percentage · This document: https://tttkmbb.com/math/percentage.md · JSON definition: https://tttkmbb.com/math/percentage.json

## Purpose

Solves the three basic percentage questions (a percentage of a number, what percentage one number is of another, and the whole behind a known part and percentage). Always returns the part, the whole and the percent.

**Use when:** You need a percentage of a value, the percentage one value represents of another, or the base value that a part and its percentage imply.

**Do not use when:** You need the percentage change between two values (use percentage-change), a price after a percentage discount (use discount) or a tax amount (use sales-tax).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | enum: percent_of \| is_what_percent \| percent_of_what |  | optional, default "percent_of" | Which percentage question to solve; x and y take the meaning shown in the label of the chosen mode. |
| `x` | number |  | required | First number: the percent (percent_of) or the part (is_what_percent, percent_of_what). Percents are plain numbers, 15 means 15%. |
| `y` | number |  | required | Second number: the whole (percent_of, is_what_percent) or the percent (percent_of_what). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | The unknown quantity: the part (percent_of), the percent in % (is_what_percent) or the whole (percent_of_what). |
| `sentence` | string |  | The solved statement, e.g. '15% of 240 is 36.' |
| `part` | number |  | The part: percent × whole / 100. |
| `whole` | number |  | The base value that corresponds to 100%. |
| `percent` | number | % | The percentage: part / whole × 100. |

## Formula

`percent_of: result = x / 100 × y. is_what_percent: result = x / y × 100. percent_of_what: result = x / (y / 100). In every mode part = percent × whole / 100.`

## Data Sources

- Wikipedia – Percentage — https://en.wikipedia.org/wiki/Percentage (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Percent — https://mathworld.wolfram.com/Percent.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/percentage?x=…&y=…`
- `POST https://tttkmbb.com/api/v1/calculate/percentage` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/percentage · OpenAPI operationId `calculate_percentage` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_percentage` (dedicated) or `run_calculator` with `{"calculator_id": "percentage", "inputs": {…}}`

## Example

- What is 15% of 240?: inputs `{"mode":"percent_of","x":15,"y":240}` → `{"result":36,"part":36,"whole":240,"percent":15,"sentence":"15% of 240 is 36."}`
- 30 is what percent of 120?: inputs `{"mode":"is_what_percent","x":30,"y":120}` → `{"result":25,"part":30,"whole":120,"percent":25,"sentence":"30 is 25% of 120."}`

```
GET https://tttkmbb.com/api/v1/calculate/percentage?mode=percent_of&x=15&y=240
```

## Limitations

You need the percentage change between two values (use percentage-change), a price after a percentage discount (use discount) or a tax amount (use sales-tax). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do I enter 15 or 0.15 for 15%?**

Enter 15. Percentages are plain percent numbers everywhere on this site; the calculator divides by 100 internally.

**How do I find the whole from a part?**

Use mode percent_of_what: '36 is 15% of what?' gives x = 36, y = 15 and returns 240.

**What is the difference between percent and percentage points?**

Going from 10% to 15% is a rise of 5 percentage points but a 50% relative increase. This calculator handles plain percent arithmetic; use percentage-change for relative changes.

## Related

- [Percentage Change Calculator](https://tttkmbb.com/math/percentage-change.md) — Percentage increase or decrease between two values.
- [Discount Calculator](https://tttkmbb.com/finance/discount.md) — Price after a percentage discount.
- [Fraction Simplifier](https://tttkmbb.com/math/fraction-simplifier.md) — Express the same part/whole relationship as a reduced fraction.


---

# Percentage Change Calculator

> Computes the relative change from an old value to a new value as a percentage, the signed absolute change, the new/old ratio and the symmetric percent difference.

- Calculator id: `percentage-change` · Category: Math (`math`) · Tool name: `calculate_percentage_change`
- Canonical page: https://tttkmbb.com/math/percentage-change · This document: https://tttkmbb.com/math/percentage-change.md · JSON definition: https://tttkmbb.com/math/percentage-change.json

## Purpose

Computes the relative change from an old value to a new value as a percentage, the signed absolute change, the new/old ratio and the symmetric percent difference.

**Use when:** You have a starting and an ending value and need the percentage increase or decrease, or a symmetric percent difference between two comparable values.

**Do not use when:** You need a percentage of a number (use percentage), an annualised growth rate over several years (use cagr) or an investment return (use roi).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `old_value` | number |  | required | Starting (reference) value. Must not be 0. |
| `new_value` | number |  | required | Ending value. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `change_percent` | number | % | (new − old) / \|old\| × 100; negative for a decrease. |
| `absolute_change` | number |  | new_value − old_value (signed). |
| `direction` | string |  | 'increase', 'decrease' or 'no change'. |
| `ratio` | number |  | new_value / old_value (1.3 means a 30% increase). |
| `percent_difference` | number | % | \|new − old\| / ((\|new\| + \|old\|) / 2) × 100; the same whichever value is called 'old'. |

## Formula

`change_percent = (new_value − old_value) / |old_value| × 100; percent_difference = |new_value − old_value| / ((|new_value| + |old_value|) / 2) × 100`

Dividing by |old_value| keeps the sign of the change meaningful when the old value is negative (−10 → −5 is a 50% increase).

## Data Sources

- Wikipedia – Relative change — https://en.wikipedia.org/wiki/Relative_change (reference, retrieved 2026-09-23)
- Wikipedia – Percentage — https://en.wikipedia.org/wiki/Percentage (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/percentage-change?old_value=…&new_value=…`
- `POST https://tttkmbb.com/api/v1/calculate/percentage-change` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/percentage-change · OpenAPI operationId `calculate_percentage_change` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_percentage_change` (dedicated) or `run_calculator` with `{"calculator_id": "percentage-change", "inputs": {…}}`

## Example

- 50 → 65: inputs `{"old_value":50,"new_value":65}` → `{"change_percent":30,"absolute_change":15,"direction":"increase","ratio":1.3,"percent_difference":26.09}`
- 80 → 60: inputs `{"old_value":80,"new_value":60}` → `{"change_percent":-25,"absolute_change":-20,"direction":"decrease","ratio":0.75,"percent_difference":28.57}`

```
GET https://tttkmbb.com/api/v1/calculate/percentage-change?old_value=50&new_value=65
```

## Limitations

You need a percentage of a number (use percentage), an annualised growth rate over several years (use cagr) or an investment return (use roi). Dividing by |old_value| keeps the sign of the change meaningful when the old value is negative (−10 → −5 is a 50% increase). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is a 25% decrease not undone by a 25% increase?**

Percent changes are relative to the starting value: 80 → 60 is −25%, but 60 → 80 is +33.33%. The symmetric percent_difference (28.57% here) is the same in both directions.

**What if the old value is 0?**

The percentage change is undefined (division by zero) and the calculator returns an error; report the absolute change instead.

## Related

- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — Plain percent-of and what-percent questions.
- [CAGR Calculator](https://tttkmbb.com/finance/cagr.md) — Average yearly growth rate over a period.
- [ROI Calculator](https://tttkmbb.com/finance/roi.md) — Return on an investment as a percentage of cost.


---

# Quadratic Equation Solver

> Solves ax² + bx + c = 0 with the quadratic formula, reporting the discriminant, both roots (real, or complex conjugates written as strings), the vertex of the parabola and the sum and product of the roots.

- Calculator id: `quadratic-equation` · Category: Math (`math`) · Tool name: `solve_quadratic_equation`
- Canonical page: https://tttkmbb.com/math/quadratic-equation · This document: https://tttkmbb.com/math/quadratic-equation.md · JSON definition: https://tttkmbb.com/math/quadratic-equation.json

## Purpose

Solves ax² + bx + c = 0 with the quadratic formula, reporting the discriminant, both roots (real, or complex conjugates written as strings), the vertex of the parabola and the sum and product of the roots.

**Use when:** You need the solutions of a second-degree polynomial equation, or the vertex and discriminant of a parabola y = ax² + bx + c.

**Do not use when:** The coefficient a is 0 (the equation is linear: x = −c / b), or you need roots of x^n = c for other powers (use nth-root).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `a` | number |  | required | Coefficient of x². Must not be 0. |
| `b` | number |  | required | Coefficient of x. |
| `c` | number |  | required | Constant term. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `discriminant` | number |  | Δ = b² − 4ac; positive → two real roots, zero → one repeated root, negative → complex roots. |
| `nature` | string |  | Plain-language classification of the roots from the sign of the discriminant. |
| `root1` | number |  | (−b + √Δ) / (2a). Only when the roots are real. |
| `root2` | number |  | (−b − √Δ) / (2a). Only when the roots are real. |
| `roots` | string |  | Both roots as text; complex roots are written like '-1+2i, -1-2i'. |
| `vertex_x` | number |  | x-coordinate of the parabola's vertex, −b / (2a) (also the axis of symmetry). |
| `vertex_y` | number |  | y-coordinate of the vertex, c − b² / (4a) (the minimum for a > 0, maximum for a < 0). |
| `sum_of_roots` | number |  | −b / a (Vieta's formula). |
| `product_of_roots` | number |  | c / a (Vieta's formula). |

## Formula

`Δ = b² − 4ac; x = (−b ± √Δ) / (2a); for Δ < 0: x = −b/(2a) ± i·√(−Δ)/(2|a|); vertex = (−b/(2a), c − b²/(4a))`

## Data Sources

- Wikipedia – Quadratic formula — https://en.wikipedia.org/wiki/Quadratic_formula (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Quadratic Equation — https://mathworld.wolfram.com/QuadraticEquation.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/quadratic-equation?a=…&b=…&c=…`
- `POST https://tttkmbb.com/api/v1/calculate/quadratic-equation` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/quadratic-equation · OpenAPI operationId `solve_quadratic_equation` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `solve_quadratic_equation` (dedicated) or `run_calculator` with `{"calculator_id": "quadratic-equation", "inputs": {…}}`

## Example

- x² − 5x + 6 = 0: inputs `{"a":1,"b":-5,"c":6}` → `{"discriminant":1,"nature":"Two distinct real roots","root1":3,"root2":2,"roots":"3, 2","vertex_x":2.5,"vertex_y":-0.25,"sum_of_roots":5,"product_of_roots":6}`
- x² + 2x + 5 = 0: inputs `{"a":1,"b":2,"c":5}` → `{"discriminant":-16,"nature":"Two complex conjugate roots (no real roots)","roots":"-1+2i, -1-2i","vertex_x":-1,"vertex_y":4}`

```
GET https://tttkmbb.com/api/v1/calculate/quadratic-equation?a=1&b=-5&c=6
```

## Limitations

The coefficient a is 0 (the equation is linear: x = −c / b), or you need roots of x^n = c for other powers (use nth-root). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What does a negative discriminant mean?**

The parabola never crosses the x-axis, so there are no real solutions. The two complex conjugate roots are still reported as strings such as '-1+2i, -1-2i'.

**Which root is root1?**

root1 uses the + sign in the quadratic formula and root2 the − sign, so for a > 0 root1 is the larger root.

## Related

- [Nth Root Calculator](https://tttkmbb.com/math/nth-root.md) — Solve x^n = c for a single power.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Evaluate powers appearing in polynomial terms.
- [Slope Calculator](https://tttkmbb.com/math/slope.md) — Linear equations from two points.


---

# GCD and LCM Calculator

> Computes the greatest common divisor (highest common factor) and least common multiple of two or more integers with the Euclidean algorithm.

- Calculator id: `gcd-lcm` · Category: Math (`math`) · Tool name: `calculate_gcd_lcm`
- Canonical page: https://tttkmbb.com/math/gcd-lcm · This document: https://tttkmbb.com/math/gcd-lcm.md · JSON definition: https://tttkmbb.com/math/gcd-lcm.json

## Purpose

Computes the greatest common divisor (highest common factor) and least common multiple of two or more integers with the Euclidean algorithm.

**Use when:** You need the GCD/HCF or LCM of a list of integers, e.g. to reduce fractions, find a common denominator or check whether numbers are coprime.

**Do not use when:** You need the prime factors themselves (use prime-factorization) or want to reduce a single fraction (use fraction-simplifier).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `numbers` | number_list |  | required | Two or more integers, comma-separated (e.g. 12, 18, 24). Negative values are treated by their absolute value. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `gcd` | integer |  | Greatest common divisor of all the numbers. |
| `lcm` | integer |  | Least common multiple of all the numbers. |
| `coprime` | boolean |  | true when the GCD is 1 (the numbers share no common factor). |

## Formula

`gcd(a, b) by the Euclidean algorithm (gcd(a, b) = gcd(b, a mod b)); lcm(a, b) = |a × b| / gcd(a, b); both are folded over the list: gcd(a, b, c) = gcd(gcd(a, b), c)`

## Data Sources

- Wikipedia – Greatest common divisor — https://en.wikipedia.org/wiki/Greatest_common_divisor (reference, retrieved 2026-09-23)
- Wikipedia – Least common multiple — https://en.wikipedia.org/wiki/Least_common_multiple (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Greatest Common Divisor — https://mathworld.wolfram.com/GreatestCommonDivisor.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/gcd-lcm?numbers=…`
- `POST https://tttkmbb.com/api/v1/calculate/gcd-lcm` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/gcd-lcm · OpenAPI operationId `calculate_gcd_lcm` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "gcd-lcm", "inputs": {…}}`

## Example

- 12 and 18: inputs `{"numbers":[12,18]}` → `{"gcd":6,"lcm":36,"coprime":false}`
- 4, 6 and 8: inputs `{"numbers":[4,6,8]}` → `{"gcd":2,"lcm":24,"coprime":false}`

```
GET https://tttkmbb.com/api/v1/calculate/gcd-lcm?numbers=12%2C18
```

## Limitations

You need the prime factors themselves (use prime-factorization) or want to reduce a single fraction (use fraction-simplifier). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is HCF the same as GCD?**

Yes. Highest common factor (HCF), greatest common factor (GCF) and greatest common divisor (GCD) are the same quantity.

**How large can the numbers be?**

Any integers whose LCM stays below 2^53 (about 9 × 10^15); larger results cannot be represented exactly and return an error.

## Related

- [Fraction Simplifier](https://tttkmbb.com/math/fraction-simplifier.md) — Reduce a fraction by its GCD.
- [Prime Factorization Calculator](https://tttkmbb.com/math/prime-factorization.md) — See the prime factors behind the GCD and LCM.
- [Ratio Calculator](https://tttkmbb.com/math/ratio.md) — Simplify a ratio by dividing by the GCD.


---

# Prime Factorization Calculator

> Decomposes an integer into its prime factors by trial division, tests primality, and derives the number and sum of its divisors from the exponents.

- Calculator id: `prime-factorization` · Category: Math (`math`) · Tool name: `calculate_prime_factorization`
- Canonical page: https://tttkmbb.com/math/prime-factorization · This document: https://tttkmbb.com/math/prime-factorization.md · JSON definition: https://tttkmbb.com/math/prime-factorization.json

## Purpose

Decomposes an integer into its prime factors by trial division, tests primality, and derives the number and sum of its divisors from the exponents.

**Use when:** You need the prime factors of an integer up to 10^12, want to know whether it is prime, or need its divisor count.

**Do not use when:** You need the GCD or LCM of several numbers (use gcd-lcm) or factorials and binomial coefficients (use factorial, combinations-permutations).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `n` | integer |  | required | Integer to factor, from 2 to 1,000,000,000,000. (min 2, max 1000000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `is_prime` | boolean |  | true when n has no divisors other than 1 and itself. |
| `factors` | number_list |  | Prime factors in ascending order with repetition, e.g. [2, 2, 2, 3, 3, 5]. |
| `factorization` | string |  | Prime-power form, e.g. '2^3 × 3^2 × 5'. |
| `distinct_primes` | number_list |  | Each prime factor once. |
| `divisor_count` | integer |  | τ(n) = Π (kᵢ + 1) over the exponents kᵢ of the factorization. |
| `sum_of_divisors` | integer |  | σ(n) = Π (1 + pᵢ + pᵢ² + … + pᵢ^kᵢ), including 1 and n. |

## Formula

`n = p₁^k₁ × p₂^k₂ × … (trial division by 2, then odd numbers up to √n); τ(n) = Π (kᵢ + 1); σ(n) = Π (pᵢ^(kᵢ+1) − 1) / (pᵢ − 1)`

## Data Sources

- Wikipedia – Integer factorization — https://en.wikipedia.org/wiki/Integer_factorization (reference, retrieved 2026-09-23)
- Wikipedia – Divisor function — https://en.wikipedia.org/wiki/Divisor_function (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Prime Factorization — https://mathworld.wolfram.com/PrimeFactorization.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/prime-factorization?n=…`
- `POST https://tttkmbb.com/api/v1/calculate/prime-factorization` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/prime-factorization · OpenAPI operationId `calculate_prime_factorization` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "prime-factorization", "inputs": {…}}`

## Example

- 360: inputs `{"n":360}` → `{"is_prime":false,"factors":[2,2,2,3,3,5],"factorization":"2^3 × 3^2 × 5","distinct_primes":[2,3,5],"divisor_count":24,"sum_of_divisors":1170}`
- 97: inputs `{"n":97}` → `{"is_prime":true,"factors":[97],"factorization":"97","divisor_count":2,"sum_of_divisors":98}`

```
GET https://tttkmbb.com/api/v1/calculate/prime-factorization?n=360
```

## Limitations

You need the GCD or LCM of several numbers (use gcd-lcm) or factorials and binomial coefficients (use factorial, combinations-permutations). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is 1 not accepted?**

1 is neither prime nor composite and has an empty factorization, so the input must be at least 2.

**How fast is this for large numbers?**

Trial division needs at most about 500,000 divisions for n near 10^12, which takes a few milliseconds; larger inputs are rejected.

## Related

- [GCD and LCM Calculator](https://tttkmbb.com/math/gcd-lcm.md) — Common factors and multiples of several integers.
- [Modulo Calculator](https://tttkmbb.com/math/modulo.md) — Remainders used in divisibility tests.
- [Factorial Calculator](https://tttkmbb.com/math/factorial.md) — Products of consecutive integers.


---

# Factorial Calculator

> Computes n! = 1 × 2 × … × n for integers from 0 to 170, together with the number of decimal digits, the number of trailing zeros and a scientific-notation form.

- Calculator id: `factorial` · Category: Math (`math`) · Tool name: `calculate_factorial`
- Canonical page: https://tttkmbb.com/math/factorial · This document: https://tttkmbb.com/math/factorial.md · JSON definition: https://tttkmbb.com/math/factorial.json

## Purpose

Computes n! = 1 × 2 × … × n for integers from 0 to 170, together with the number of decimal digits, the number of trailing zeros and a scientific-notation form.

**Use when:** You need the factorial of an integer, e.g. for counting arrangements or as a building block of permutations and combinations.

**Do not use when:** n exceeds 170 (the result overflows double precision; use Stirling's approximation or log-gamma) or you need C(n, k) / P(n, k) directly (use combinations-permutations).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `n` | integer |  | required | Non-negative integer up to 170. (min 0, max 170) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `factorial` | number |  | The factorial. Exact up to 22!; above that correct to about 16 significant digits. |
| `digits` | integer |  | Decimal digits of n!: ⌊log10(n!)⌋ + 1. |
| `trailing_zeros` | integer |  | Zeros at the end of n! (Legendre's formula: ⌊n/5⌋ + ⌊n/25⌋ + …). |
| `scientific_notation` | string |  | n! with 5 significant digits, e.g. '2.4329 × 10^18'. |

## Formula

`n! = n × (n − 1) × … × 2 × 1, with 0! = 1; digits = ⌊Σ log10(i)⌋ + 1; trailing_zeros = Σ ⌊n / 5^k⌋`

## Data Sources

- Wikipedia – Factorial — https://en.wikipedia.org/wiki/Factorial (reference, retrieved 2026-09-23)
- NIST Digital Library of Mathematical Functions §5.2 – Gamma function: definitions (n! = Γ(n + 1)) — https://dlmf.nist.gov/5.2 (standard, retrieved 2026-09-23)
- Wolfram MathWorld – Factorial — https://mathworld.wolfram.com/Factorial.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/factorial?n=…`
- `POST https://tttkmbb.com/api/v1/calculate/factorial` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/factorial · OpenAPI operationId `calculate_factorial` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "factorial", "inputs": {…}}`

## Example

- 5!: inputs `{"n":5}` → `{"factorial":120,"digits":3,"trailing_zeros":1,"scientific_notation":"1.2 × 10^2"}`
- 20!: inputs `{"n":20}` → `{"factorial":2432902008176640000,"digits":19,"trailing_zeros":4,"scientific_notation":"2.4329 × 10^18"}`

```
GET https://tttkmbb.com/api/v1/calculate/factorial?n=5
```

## Limitations

n exceeds 170 (the result overflows double precision; use Stirling's approximation or log-gamma) or you need C(n, k) / P(n, k) directly (use combinations-permutations). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is 0! equal to 1?**

By definition (the empty product), which keeps the recurrence n! = n × (n − 1)! and the counting formulas consistent.

**Is the result exact?**

Up to 22! every digit is exact. From 23! on the value has more than 53 significant bits, so only the first ~16 significant digits are reliable; the digit and trailing-zero counts stay exact.

## Related

- [Combinations and Permutations Calculator](https://tttkmbb.com/math/combinations-permutations.md) — Counts of selections and arrangements built from factorials.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Powers, the other fast-growing product.


---

# Combinations and Permutations Calculator

> Counts the ways to choose k items from n: combinations C(n, k) when order does not matter and permutations P(n, k) when it does, with or without repetition.

- Calculator id: `combinations-permutations` · Category: Math (`math`) · Tool name: `calculate_combinations_permutations`
- Canonical page: https://tttkmbb.com/math/combinations-permutations · This document: https://tttkmbb.com/math/combinations-permutations.md · JSON definition: https://tttkmbb.com/math/combinations-permutations.json

## Purpose

Counts the ways to choose k items from n: combinations C(n, k) when order does not matter and permutations P(n, k) when it does, with or without repetition.

**Use when:** You need nCr (binomial coefficient), nPr, or the number of multisets or sequences of length k drawn from n items.

**Do not use when:** You need the probability of a specific outcome (use probability-of-events or binomial-distribution) or a plain factorial (use factorial).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `n` | integer |  | required | Size of the set. (min 0, max 100000) |
| `k` | integer |  | required | Number of items selected or arranged. (min 0, max 1000) |
| `with_repetition` | boolean |  | optional, default false | true when an item may be chosen more than once (multisets / sequences with replacement). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `combinations` | number |  | C(n, k) = n! / (k!(n − k)!), or C(n + k − 1, k) with repetition. |
| `permutations` | number |  | P(n, k) = n! / (n − k)!, or n^k with repetition. |
| `expression` | string |  | The formulas with the numbers filled in. |

## Formula

`Without repetition: C(n,k) = n! / (k! (n−k)!), P(n,k) = n! / (n−k)!. With repetition: C = (n+k−1)! / (k! (n−1)!), P = n^k`

Computed with the multiplicative formula (no intermediate factorials) so that n can be large; results above 2^53 are correct to about 15 significant digits.

## Data Sources

- Wikipedia – Combination — https://en.wikipedia.org/wiki/Combination (reference, retrieved 2026-09-23)
- Wikipedia – Permutation — https://en.wikipedia.org/wiki/Permutation (reference, retrieved 2026-09-23)
- NIST Digital Library of Mathematical Functions §26.3 – Lattice paths: binomial coefficients — https://dlmf.nist.gov/26.3 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/combinations-permutations?n=…&k=…`
- `POST https://tttkmbb.com/api/v1/calculate/combinations-permutations` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/combinations-permutations · OpenAPI operationId `calculate_combinations_permutations` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "combinations-permutations", "inputs": {…}}`

## Example

- Choose 3 of 10: inputs `{"n":10,"k":3,"with_repetition":false}` → `{"combinations":120,"permutations":720,"expression":"C(10,3) = 120; P(10,3) = 720"}`
- Choose 2 of 5 with repetition: inputs `{"n":5,"k":2,"with_repetition":true}` → `{"combinations":15,"permutations":25}`

```
GET https://tttkmbb.com/api/v1/calculate/combinations-permutations?n=10&k=3&with_repetition=false
```

## Limitations

You need the probability of a specific outcome (use probability-of-events or binomial-distribution) or a plain factorial (use factorial). Computed with the multiplicative formula (no intermediate factorials) so that n can be large; results above 2^53 are correct to about 15 significant digits. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Combination or permutation?**

Use combinations when only which items are chosen matters (lottery numbers, committees) and permutations when their order matters (rankings, passwords).

**What happens when k > n without repetition?**

There are no such selections, so both counts are 0.

## Related

- [Factorial Calculator](https://tttkmbb.com/math/factorial.md) — The factorials behind these formulas.
- [Binomial Distribution Calculator](https://tttkmbb.com/statistics/binomial-distribution.md) — Probabilities of k successes in n trials use C(n, k).
- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Turn counts of outcomes into probabilities.


---

# Exponent Calculator

> Raises a base to any real exponent (base^exponent), including negative and fractional exponents, and reports the reciprocal and a scientific-notation form.

- Calculator id: `exponent` · Category: Math (`math`) · Tool name: `calculate_exponent`
- Canonical page: https://tttkmbb.com/math/exponent · This document: https://tttkmbb.com/math/exponent.md · JSON definition: https://tttkmbb.com/math/exponent.json

## Purpose

Raises a base to any real exponent (base^exponent), including negative and fractional exponents, and reports the reciprocal and a scientific-notation form.

**Use when:** You need a power such as 2^10, 1.05^30 or 8^(1/3), or a quick check of how large a power gets.

**Do not use when:** You need the exponent that produces a given result (use logarithm) or the n-th root with sign handling for negatives (use nth-root).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base` | number |  | required | The number being multiplied by itself. (min -1000000000, max 1000000000) |
| `exponent` | number |  | required | The power; may be negative or fractional. A negative base requires an integer exponent. (min -1000, max 1000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | base raised to the exponent. |
| `scientific_notation` | string |  | The result with 6 significant digits, e.g. '1.024 × 10^3'. |
| `reciprocal` | number |  | 1 / result = base^(−exponent) (omitted when the result is 0). |
| `expression` | string |  | The evaluated power as text. |

## Formula

`result = base^exponent; for a fractional exponent p/q: base^(p/q) = (base^(1/q))^p; base^(−n) = 1 / base^n`

## Data Sources

- Wikipedia – Exponentiation — https://en.wikipedia.org/wiki/Exponentiation (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Power — https://mathworld.wolfram.com/Power.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/exponent?base=…&exponent=…`
- `POST https://tttkmbb.com/api/v1/calculate/exponent` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/exponent · OpenAPI operationId `calculate_exponent` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "exponent", "inputs": {…}}`

## Example

- 2^10: inputs `{"base":2,"exponent":10}` → `{"result":1024,"scientific_notation":"1.024 × 10^3","reciprocal":0.0009765625,"expression":"2^10 = 1024"}`
- 4^1.5: inputs `{"base":4,"exponent":1.5}` → `{"result":8,"reciprocal":0.125}`

```
GET https://tttkmbb.com/api/v1/calculate/exponent?base=2&exponent=10
```

## Limitations

You need the exponent that produces a given result (use logarithm) or the n-th root with sign handling for negatives (use nth-root). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is a negative base with a fractional exponent rejected?**

(−8)^(1/3) has no unique real value in general (the principal value is complex). Use nth-root, which returns the real root −2 for odd roots.

**What is 0^0?**

The calculator returns 1, the convention used in combinatorics and by most programming languages; some contexts treat it as undefined.

## Related

- [Nth Root Calculator](https://tttkmbb.com/math/nth-root.md) — Inverse operation: the root of a number.
- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — Find the exponent from the result.
- [Scientific Notation Converter](https://tttkmbb.com/math/scientific-notation.md) — Express very large or small powers compactly.


---

# Nth Root Calculator

> Computes the principal n-th root of a number (value^(1/n)), returning the real negative root for odd n and the second, negative root for even n.

- Calculator id: `nth-root` · Category: Math (`math`) · Tool name: `calculate_nth_root`
- Canonical page: https://tttkmbb.com/math/nth-root · This document: https://tttkmbb.com/math/nth-root.md · JSON definition: https://tttkmbb.com/math/nth-root.json

## Purpose

Computes the principal n-th root of a number (value^(1/n)), returning the real negative root for odd n and the second, negative root for even n.

**Use when:** You need √x, ∛x or any integer-degree root, including odd roots of negative numbers.

**Do not use when:** You need a fractional power such as x^(2/3) (use exponent) or the solutions of a quadratic (use quadratic-equation).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | The number under the root sign. Negative values are allowed only for odd n. (min -1e+300, max 1e+300) |
| `n` | integer |  | required | 2 for square root, 3 for cube root, etc. (min 1, max 1000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `root` | number |  | The real n-th root with the same sign as value. |
| `negative_root` | number |  | −root: the second real root, present only for even n and positive value. |
| `verification` | number |  | The root raised back to the n-th power (should equal value). |
| `expression` | string |  | The root as text, e.g. '16^(1/4) = 2'. |

## Formula

`root = |value|^(1/n) × sign(value); for even n and value > 0 the roots are ±root`

Roots that are exact integers are snapped to the integer when |value|^(1/n) is within 10^-9 of it and the integer power reproduces value exactly.

## Data Sources

- Wikipedia – Nth root — https://en.wikipedia.org/wiki/Nth_root (reference, retrieved 2026-09-23)
- Wolfram MathWorld – nth Root — https://mathworld.wolfram.com/nthRoot.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/nth-root?value=…&n=…`
- `POST https://tttkmbb.com/api/v1/calculate/nth-root` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/nth-root · OpenAPI operationId `calculate_nth_root` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "nth-root", "inputs": {…}}`

## Example

- Fourth root of 16: inputs `{"value":16,"n":4}` → `{"root":2,"negative_root":-2,"verification":16,"expression":"16^(1/4) = 2"}`
- Fifth root of −32: inputs `{"value":-32,"n":5}` → `{"root":-2,"verification":-32}`

```
GET https://tttkmbb.com/api/v1/calculate/nth-root?value=16&n=4
```

## Limitations

You need a fractional power such as x^(2/3) (use exponent) or the solutions of a quadratic (use quadratic-equation). Roots that are exact integers are snapped to the integer when |value|^(1/n) is within 10^-9 of it and the integer power reproduces value exactly. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why does the square root of a negative number fail?**

Even roots of negative numbers are imaginary (√−4 = 2i); only odd roots of negatives are real, e.g. ∛−27 = −3.

**Why are there two answers for an even root?**

Both 2 and −2 satisfy x⁴ = 16. The principal root is the positive one; negative_root gives the other.

## Related

- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Inverse operation and fractional exponents.
- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — Roots via logarithms: log(root) = log(value) / n.
- [Quadratic Equation Solver](https://tttkmbb.com/math/quadratic-equation.md) — Roots of second-degree equations.


---

# Logarithm Calculator

> Computes the logarithm of a positive number to any base using the change-of-base formula, and always reports the natural, common (base 10) and binary (base 2) logarithms.

- Calculator id: `logarithm` · Category: Math (`math`) · Tool name: `calculate_logarithm`
- Canonical page: https://tttkmbb.com/math/logarithm · This document: https://tttkmbb.com/math/logarithm.md · JSON definition: https://tttkmbb.com/math/logarithm.json

## Purpose

Computes the logarithm of a positive number to any base using the change-of-base formula, and always reports the natural, common (base 10) and binary (base 2) logarithms.

**Use when:** You need log_b(x) for an arbitrary base, or ln, log10 and log2 of a number at once.

**Do not use when:** You need to raise a base to a power (use exponent) or a root (use nth-root); for pH-style −log10 of a concentration use ph.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Positive number whose logarithm is taken. (> 0) |
| `base` | number |  | optional, default 10 | Logarithm base; positive and not 1. Use 2.718281828459045 for the natural logarithm, or read the ln output. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `log` | number |  | Logarithm of value to the given base. |
| `ln` | number |  | Natural logarithm (base e). |
| `log10` | number |  | Common logarithm (base 10). |
| `log2` | number |  | Binary logarithm (base 2). |
| `expression` | string |  | The evaluated logarithm as text. |

## Formula

`log_b(x) = ln(x) / ln(b) (change of base); ln = log_e, log10 = log_10, log2 = log_2`

## Data Sources

- Wikipedia – Logarithm — https://en.wikipedia.org/wiki/Logarithm (reference, retrieved 2026-09-23)
- NIST Digital Library of Mathematical Functions §4.2 – Elementary functions: definitions of the logarithm — https://dlmf.nist.gov/4.2 (standard, retrieved 2026-09-23)
- Wolfram MathWorld – Logarithm — https://mathworld.wolfram.com/Logarithm.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/logarithm?value=…`
- `POST https://tttkmbb.com/api/v1/calculate/logarithm` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/logarithm · OpenAPI operationId `calculate_logarithm` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "logarithm", "inputs": {…}}`

## Example

- log10 of 1000: inputs `{"value":1000,"base":10}` → `{"log":3,"ln":6.907755,"log10":3,"log2":9.965784,"expression":"log_10(1000) = 3"}`
- log2 of 8: inputs `{"value":8,"base":2}` → `{"log":3,"ln":2.079442,"log10":0.90309,"log2":3}`

```
GET https://tttkmbb.com/api/v1/calculate/logarithm?value=1000&base=10
```

## Limitations

You need to raise a base to a power (use exponent) or a root (use nth-root); for pH-style −log10 of a concentration use ph. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why can't the value be 0 or negative?**

Real logarithms are only defined for positive numbers: log(0) tends to −∞ and logarithms of negatives are complex.

**Which base does 'log' mean?**

In science and calculators 'log' usually means base 10, in mathematics often base e, and in computing base 2. All three are reported so no convention is assumed.

## Related

- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Inverse operation: b^y = x.
- [Nth Root Calculator](https://tttkmbb.com/math/nth-root.md) — Roots as fractional exponents.
- [pH Calculator](https://tttkmbb.com/chemistry/ph.md) — pH is −log10 of hydrogen-ion concentration.


---

# Fraction Simplifier

> Reduces a fraction to lowest terms by dividing by the GCD and converts it to a mixed number, a decimal and a percentage.

- Calculator id: `fraction-simplifier` · Category: Math (`math`) · Tool name: `calculate_simplified_fraction`
- Canonical page: https://tttkmbb.com/math/fraction-simplifier · This document: https://tttkmbb.com/math/fraction-simplifier.md · JSON definition: https://tttkmbb.com/math/fraction-simplifier.json

## Purpose

Reduces a fraction to lowest terms by dividing by the GCD and converts it to a mixed number, a decimal and a percentage.

**Use when:** You have a numerator and denominator and want the reduced fraction, its mixed-number form, decimal value or percent.

**Do not use when:** You need to add or multiply fractions (reduce each result with this tool afterwards) or to simplify a ratio of non-integers (use ratio).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `numerator` | integer |  | required | Top number of the fraction (may be negative). (min -1000000000000000, max 1000000000000000) |
| `denominator` | integer |  | required | Bottom number of the fraction; must not be 0. (min -1000000000000000, max 1000000000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `simplified` | string |  | Lowest-terms fraction with the sign in the numerator, e.g. '3/4' (a whole number when the denominator reduces to 1). |
| `simplified_numerator` | integer |  | Numerator after reduction. |
| `simplified_denominator` | integer |  | Denominator after reduction (always positive). |
| `mixed_number` | string |  | Whole part plus proper fraction, e.g. '2 1/2'. |
| `decimal` | number |  | numerator / denominator. |
| `percent` | number | % | numerator / denominator × 100. |
| `gcd` | integer |  | Greatest common divisor the fraction was divided by. |

## Formula

`simplified = (numerator / g) / (denominator / g) with g = gcd(|numerator|, |denominator|); decimal = numerator / denominator; percent = decimal × 100`

## Data Sources

- Wikipedia – Irreducible fraction — https://en.wikipedia.org/wiki/Irreducible_fraction (reference, retrieved 2026-09-23)
- Wikipedia – Fraction — https://en.wikipedia.org/wiki/Fraction (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Fraction — https://mathworld.wolfram.com/Fraction.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/fraction-simplifier?numerator=…&denominator=…`
- `POST https://tttkmbb.com/api/v1/calculate/fraction-simplifier` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/fraction-simplifier · OpenAPI operationId `calculate_simplified_fraction` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "fraction-simplifier", "inputs": {…}}`

## Example

- 6/8: inputs `{"numerator":6,"denominator":8}` → `{"simplified":"3/4","simplified_numerator":3,"simplified_denominator":4,"mixed_number":"3/4","decimal":0.75,"percent":75,"gcd":2}`
- 10/4: inputs `{"numerator":10,"denominator":4}` → `{"simplified":"5/2","mixed_number":"2 1/2","decimal":2.5,"percent":250,"gcd":2}`

```
GET https://tttkmbb.com/api/v1/calculate/fraction-simplifier?numerator=6&denominator=8
```

## Limitations

You need to add or multiply fractions (reduce each result with this tool afterwards) or to simplify a ratio of non-integers (use ratio). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How is a negative fraction written?**

The sign is moved to the numerator: 6/−8 becomes −3/4, and the mixed form of −5/4 is '-1 1/4'.

**Can I enter decimals?**

No, both parts must be integers. Convert a decimal such as 0.75 to 75/100 first (or use ratio for non-integer pairs).

## Related

- [GCD and LCM Calculator](https://tttkmbb.com/math/gcd-lcm.md) — The GCD used to reduce the fraction.
- [Ratio Calculator](https://tttkmbb.com/math/ratio.md) — Simplify a ratio (also works with decimals).
- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — Percent arithmetic on the resulting value.


---

# Ratio Calculator

> Simplifies a ratio a:b to lowest terms (decimals are scaled to integers first), expresses it as a decimal, as n:1 and as percentage shares, and optionally scales it to a new value of a.

- Calculator id: `ratio` · Category: Math (`math`) · Tool name: `calculate_ratio`
- Canonical page: https://tttkmbb.com/math/ratio · This document: https://tttkmbb.com/math/ratio.md · JSON definition: https://tttkmbb.com/math/ratio.json

## Purpose

Simplifies a ratio a:b to lowest terms (decimals are scaled to integers first), expresses it as a decimal, as n:1 and as percentage shares, and optionally scales it to a new value of a.

**Use when:** You need to reduce a ratio, compare two quantities, or find the matching second value when the first is scaled (e.g. mixing or recipe ratios).

**Do not use when:** You are solving a/b = c/x with three known values (use proportion) or reducing a fraction with sign handling (use fraction-simplifier).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `a` | number |  | required | First term of the ratio a:b. Decimals are allowed (rounded to 6 decimal places before simplifying). (min 0.000001, max 1000000000) |
| `b` | number |  | required | Second term of the ratio a:b. (min 0.000001, max 1000000000) |
| `new_a` | number |  | optional | Optional new first quantity; returns the second quantity that keeps the same ratio. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `simplified` | string |  | a:b in lowest integer terms, e.g. '3:2'. |
| `decimal` | number |  | The ratio as a single number. |
| `ratio_to_one` | string |  | The ratio written as n:1. |
| `one_to_ratio` | string |  | The ratio written as 1:n. |
| `share_a_percent` | number | % | a / (a + b) × 100. |
| `share_b_percent` | number | % | b / (a + b) × 100. |
| `new_b` | number |  | new_a × b / a; only when new_a is given. |

## Formula

`simplified = (A / g):(B / g) with A, B = a, b scaled to integers and g = gcd(A, B); decimal = a / b; new_b = new_a × b / a`

## Data Sources

- Wikipedia – Ratio — https://en.wikipedia.org/wiki/Ratio (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Ratio — https://mathworld.wolfram.com/Ratio.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ratio?a=…&b=…`
- `POST https://tttkmbb.com/api/v1/calculate/ratio` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ratio · OpenAPI operationId `calculate_ratio` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ratio", "inputs": {…}}`

## Example

- 6:4, scale a to 9: inputs `{"a":6,"b":4,"new_a":9}` → `{"simplified":"3:2","decimal":1.5,"ratio_to_one":"1.5:1","one_to_ratio":"1:0.666667","share_a_percent":60,"share_b_percent":40,"new_b":6}`
- 2.5:1.5: inputs `{"a":2.5,"b":1.5}` → `{"simplified":"5:3","decimal":1.6667,"share_a_percent":62.5}`

```
GET https://tttkmbb.com/api/v1/calculate/ratio?a=6&b=4&new_a=9
```

## Limitations

You are solving a/b = c/x with three known values (use proportion) or reducing a fraction with sign handling (use fraction-simplifier). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How are decimal ratios simplified?**

Both terms are multiplied by the same power of 10 until they are integers (2.5:1.5 → 25:15) and then divided by their GCD (5:3).

**What does 'share' mean?**

The fraction of the total each term represents: in 3:2 the first part is 3 of 5, i.e. 60%.

## Related

- [Proportion Calculator](https://tttkmbb.com/math/proportion.md) — Solve a/b = c/x for the missing value.
- [Fraction Simplifier](https://tttkmbb.com/math/fraction-simplifier.md) — The same reduction as a fraction.
- [Aspect Ratio Calculator](https://tttkmbb.com/everyday/aspect-ratio.md) — Ratios of image and screen dimensions.


---

# Proportion Calculator

> Solves the proportion a / b = c / x for the unknown fourth term by cross-multiplication (x = b × c / a) and reports the common scale factor.

- Calculator id: `proportion` · Category: Math (`math`) · Tool name: `solve_proportion`
- Canonical page: https://tttkmbb.com/math/proportion · This document: https://tttkmbb.com/math/proportion.md · JSON definition: https://tttkmbb.com/math/proportion.json

## Purpose

Solves the proportion a / b = c / x for the unknown fourth term by cross-multiplication (x = b × c / a) and reports the common scale factor.

**Use when:** Three terms of a proportion are known and you need the fourth, e.g. converting a recipe, map scale or unit rate.

**Do not use when:** You only want to simplify a ratio (use ratio) or the unknown is a percentage (use percentage).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `a` | number |  | required | First term (numerator of the known ratio). Must not be 0. |
| `b` | number |  | required | Second term (denominator of the known ratio). Must not be 0. |
| `c` | number |  | required | Third term: the numerator paired with the unknown x. Must not be 0. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `x` | number |  | The unknown fourth term, b × c / a. |
| `scale_factor` | number |  | c / a = x / b: the multiplier from the first pair to the second. |
| `ratio` | number |  | The common value of both fractions, a / b = c / x. |
| `equation` | string |  | The proportion with x filled in, e.g. '2/3 = 4/6'. |

## Formula

`a / b = c / x  ⇒  a × x = b × c  ⇒  x = b × c / a; scale_factor = c / a`

## Data Sources

- Wikipedia – Cross-multiplication — https://en.wikipedia.org/wiki/Cross-multiplication (reference, retrieved 2026-09-23)
- Wikipedia – Proportionality (mathematics) — https://en.wikipedia.org/wiki/Proportionality_(mathematics) (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/proportion?a=…&b=…&c=…`
- `POST https://tttkmbb.com/api/v1/calculate/proportion` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/proportion · OpenAPI operationId `solve_proportion` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "proportion", "inputs": {…}}`

## Example

- 2/3 = 4/x: inputs `{"a":2,"b":3,"c":4}` → `{"x":6,"scale_factor":2,"ratio":0.666667,"equation":"2/3 = 4/6"}`
- 5/8 = 12.5/x: inputs `{"a":5,"b":8,"c":12.5}` → `{"x":20,"scale_factor":2.5,"ratio":0.625}`

```
GET https://tttkmbb.com/api/v1/calculate/proportion?a=2&b=3&c=4
```

## Limitations

You only want to simplify a ratio (use ratio) or the unknown is a percentage (use percentage). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if the unknown is in a different position?**

Rearrange so the unknown is last: a/b = c/x is equivalent to b/a = x/c, c/a = x/b and so on; all give x = b × c / a.

**Does this handle inverse proportion?**

No. For inverse proportion (a × b = c × x) compute x = a × b / c directly.

## Related

- [Ratio Calculator](https://tttkmbb.com/math/ratio.md) — Simplify or scale the ratio a:b.
- [Recipe Scaler](https://tttkmbb.com/food/recipe-scaler.md) — Proportional scaling of recipe quantities.
- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — Proportions with 100 as the base.


---

# Slope Calculator

> Computes the slope of the line through two points (rise over run), its y- and x-intercepts, the slope-intercept equation y = mx + b, the angle of inclination and the distance between the points.

- Calculator id: `slope` · Category: Math (`math`) · Tool name: `calculate_slope`
- Canonical page: https://tttkmbb.com/math/slope · This document: https://tttkmbb.com/math/slope.md · JSON definition: https://tttkmbb.com/math/slope.json

## Purpose

Computes the slope of the line through two points (rise over run), its y- and x-intercepts, the slope-intercept equation y = mx + b, the angle of inclination and the distance between the points.

**Use when:** You have two points and need the gradient or the equation of the line through them.

**Do not use when:** You need a best-fit line through many points (use linear-regression) or only the distance between two points (use distance-2d).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `x1` | number |  | required | x-coordinate of the first point. |
| `y1` | number |  | required | y-coordinate of the first point. |
| `x2` | number |  | required | x-coordinate of the second point. |
| `y2` | number |  | required | y-coordinate of the second point. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `slope` | number |  | (y₂ − y₁) / (x₂ − x₁); omitted for a vertical line. |
| `slope_type` | string |  | 'positive (rising)', 'negative (falling)', 'zero (horizontal line)' or 'undefined (vertical line)'. |
| `y_intercept` | number |  | Value of y where the line crosses the y-axis: y₁ − m·x₁. |
| `x_intercept` | number |  | Value of x where the line crosses the x-axis: −b / m (omitted for a horizontal line). |
| `equation` | string |  | Slope-intercept form y = mx + b (or x = c for a vertical line). |
| `angle_degrees` | number | ° | atan(m) in degrees, between −90° and 90°. |
| `delta_x` | number |  | x₂ − x₁. |
| `delta_y` | number |  | y₂ − y₁. |
| `distance` | number |  | √(Δx² + Δy²). |

## Formula

`m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − m·x₁; x_intercept = −b / m; angle = atan(m) × 180/π; distance = √(Δx² + Δy²)`

## Data Sources

- Wikipedia – Slope — https://en.wikipedia.org/wiki/Slope (reference, retrieved 2026-09-23)
- Wikipedia – Linear equation — https://en.wikipedia.org/wiki/Linear_equation (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Slope — https://mathworld.wolfram.com/Slope.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/slope?x1=…&y1=…&x2=…&y2=…`
- `POST https://tttkmbb.com/api/v1/calculate/slope` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/slope · OpenAPI operationId `calculate_slope` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "slope", "inputs": {…}}`

## Example

- (1, 2) and (3, 6): inputs `{"x1":1,"y1":2,"x2":3,"y2":6}` → `{"slope":2,"slope_type":"positive (rising)","y_intercept":0,"x_intercept":0,"equation":"y = 2x","angle_degrees":63.4349,"delta_x":2,"delta_y":4,"distance":4.472136}`
- (0, 3) and (4, 1): inputs `{"x1":0,"y1":3,"x2":4,"y2":1}` → `{"slope":-0.5,"slope_type":"negative (falling)","y_intercept":3,"x_intercept":6,"equation":"y = -0.5x + 3","angle_degrees":-26.5651}`

```
GET https://tttkmbb.com/api/v1/calculate/slope?x1=1&y1=2&x2=3&y2=6
```

## Limitations

You need a best-fit line through many points (use linear-regression) or only the distance between two points (use distance-2d). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What happens for a vertical line?**

Δx = 0, so the slope is undefined and no y-intercept exists. The calculator returns the equation x = constant, an angle of 90° and no slope value.

**Is slope the same as gradient or grade?**

Slope and gradient are the same ratio. A road grade is the slope expressed in percent (slope × 100).

## Related

- [Distance Between Two Points Calculator](https://tttkmbb.com/math/distance-2d.md) — Distance and midpoint of the same two points.
- [Linear Regression Calculator](https://tttkmbb.com/statistics/linear-regression.md) — Best-fit line through many points.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert the inclination angle between degrees, radians and grades.


---

# Distance Between Two Points Calculator

> Computes the straight-line (Euclidean) distance between two points in the plane, their midpoint, the coordinate differences and the Manhattan distance.

- Calculator id: `distance-2d` · Category: Math (`math`) · Tool name: `calculate_distance_2d`
- Canonical page: https://tttkmbb.com/math/distance-2d · This document: https://tttkmbb.com/math/distance-2d.md · JSON definition: https://tttkmbb.com/math/distance-2d.json

## Purpose

Computes the straight-line (Euclidean) distance between two points in the plane, their midpoint, the coordinate differences and the Manhattan distance.

**Use when:** You have two (x, y) coordinates and need the distance between them or the point halfway between them.

**Do not use when:** You need the slope or equation of the line through the points (use slope) or the third side of a right triangle from two sides (use pythagorean).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `x1` | number |  | required | x-coordinate of the first point. |
| `y1` | number |  | required | y-coordinate of the first point. |
| `x2` | number |  | required | x-coordinate of the second point. |
| `y2` | number |  | required | y-coordinate of the second point. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `distance` | number |  | √((x₂ − x₁)² + (y₂ − y₁)²). |
| `midpoint_x` | number |  | (x₁ + x₂) / 2. |
| `midpoint_y` | number |  | (y₁ + y₂) / 2. |
| `midpoint` | string |  | The midpoint as a coordinate pair, e.g. '(2, 4)'. |
| `delta_x` | number |  | x₂ − x₁. |
| `delta_y` | number |  | y₂ − y₁. |
| `manhattan_distance` | number |  | \|Δx\| + \|Δy\|: the grid (taxicab) distance. |

## Formula

`distance = √((x₂ − x₁)² + (y₂ − y₁)²); midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2); manhattan = |x₂ − x₁| + |y₂ − y₁|`

## Data Sources

- Wikipedia – Euclidean distance — https://en.wikipedia.org/wiki/Euclidean_distance (reference, retrieved 2026-09-23)
- Wikipedia – Midpoint — https://en.wikipedia.org/wiki/Midpoint (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Distance — https://mathworld.wolfram.com/Distance.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/distance-2d?x1=…&y1=…&x2=…&y2=…`
- `POST https://tttkmbb.com/api/v1/calculate/distance-2d` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/distance-2d · OpenAPI operationId `calculate_distance_2d` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "distance-2d", "inputs": {…}}`

## Example

- (0, 0) to (3, 4): inputs `{"x1":0,"y1":0,"x2":3,"y2":4}` → `{"distance":5,"midpoint_x":1.5,"midpoint_y":2,"midpoint":"(1.5, 2)","delta_x":3,"delta_y":4,"manhattan_distance":7}`
- (1, 2) to (4, 6): inputs `{"x1":1,"y1":2,"x2":4,"y2":6}` → `{"distance":5,"midpoint_x":2.5,"midpoint_y":4,"midpoint":"(2.5, 4)","manhattan_distance":7}`

```
GET https://tttkmbb.com/api/v1/calculate/distance-2d?x1=0&y1=0&x2=3&y2=4
```

## Limitations

You need the slope or equation of the line through the points (use slope) or the third side of a right triangle from two sides (use pythagorean). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does the order of the points matter?**

Not for the distance or midpoint. Δx and Δy are signed (second minus first), so they flip sign if the points are swapped.

**Can I use this for GPS coordinates?**

Only for very short distances. Latitude/longitude lie on a sphere; use the haversine formula for geographic distances.

## Related

- [Slope Calculator](https://tttkmbb.com/math/slope.md) — Slope and equation of the line through the points.
- [Pythagorean Theorem Calculator](https://tttkmbb.com/math/pythagorean.md) — The distance formula is the Pythagorean theorem applied to Δx and Δy.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Full right-triangle solver.


---

# Pythagorean Theorem Calculator

> Finds the missing side of a right triangle from any two of the legs a, b and hypotenuse c using a² + b² = c², and reports the area, perimeter and acute angles.

- Calculator id: `pythagorean` · Category: Math (`math`) · Tool name: `solve_pythagorean_theorem`
- Canonical page: https://tttkmbb.com/math/pythagorean · This document: https://tttkmbb.com/math/pythagorean.md · JSON definition: https://tttkmbb.com/math/pythagorean.json

## Purpose

Finds the missing side of a right triangle from any two of the legs a, b and hypotenuse c using a² + b² = c², and reports the area, perimeter and acute angles.

**Use when:** You know two sides of a right triangle and need the third, or want to check whether three lengths form a right triangle.

**Do not use when:** The triangle is not right-angled (use triangle-solver) or you need the distance between coordinates (use distance-2d).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `a` | number |  | optional | First leg (a side adjacent to the right angle). Give any two of a, b, c. (> 0) |
| `b` | number |  | optional | Second leg. (> 0) |
| `c` | number |  | optional | Hypotenuse (the longest side, opposite the right angle). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `side_a` | number |  | Length of leg a. |
| `side_b` | number |  | Length of leg b. |
| `hypotenuse_c` | number |  | Length of the hypotenuse. |
| `solved_for` | string |  | Which side was computed ('a', 'b' or 'c'), or a note that all three were given and consistent. |
| `area` | number |  | a × b / 2. |
| `perimeter` | number |  | a + b + c. |
| `angle_a_degrees` | number | ° | atan(a / b) in degrees. |
| `angle_b_degrees` | number | ° | atan(b / a) in degrees; the two acute angles sum to 90°. |

## Formula

`c = √(a² + b²); a = √(c² − b²); b = √(c² − a²); area = a·b/2; angle_a = atan(a/b), angle_b = atan(b/a)`

## Data Sources

- Wikipedia – Pythagorean theorem — https://en.wikipedia.org/wiki/Pythagorean_theorem (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Pythagorean Theorem — https://mathworld.wolfram.com/PythagoreanTheorem.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pythagorean?`
- `POST https://tttkmbb.com/api/v1/calculate/pythagorean` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pythagorean · OpenAPI operationId `solve_pythagorean_theorem` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pythagorean", "inputs": {…}}`

## Example

- a = 3, b = 4: inputs `{"a":3,"b":4}` → `{"side_a":3,"side_b":4,"hypotenuse_c":5,"solved_for":"c","area":6,"perimeter":12,"angle_a_degrees":36.8699,"angle_b_degrees":53.1301}`
- a = 5, c = 13: inputs `{"a":5,"c":13}` → `{"side_b":12,"solved_for":"b","area":30,"perimeter":30,"angle_a_degrees":22.6199}`

```
GET https://tttkmbb.com/api/v1/calculate/pythagorean?a=3&b=4
```

## Limitations

The triangle is not right-angled (use triangle-solver) or you need the distance between coordinates (use distance-2d). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if I enter all three sides?**

They are checked against a² + b² = c². Consistent values are returned unchanged; otherwise an error reports the hypotenuse the two legs imply.

**Why must the hypotenuse be the longest side?**

Since c² = a² + b², c is always longer than either leg. A leg equal to or longer than c gives a negative square and no real triangle.

## Related

- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Solve a right triangle from sides and angles.
- [Distance Between Two Points Calculator](https://tttkmbb.com/math/distance-2d.md) — Distance between points uses the same theorem.
- [Triangle Solver](https://tttkmbb.com/geometry/triangle-solver.md) — General triangles (law of sines and cosines).


---

# Rounding Calculator

> Rounds a number to a given number of decimal places (negative for tens, hundreds, …) or significant figures using round-half-away-from-zero, and also reports the ceiling, floor and truncated values at the same precision.

- Calculator id: `rounding` · Category: Math (`math`) · Tool name: `calculate_rounded_value`
- Canonical page: https://tttkmbb.com/math/rounding · This document: https://tttkmbb.com/math/rounding.md · JSON definition: https://tttkmbb.com/math/rounding.json

## Purpose

Rounds a number to a given number of decimal places (negative for tens, hundreds, …) or significant figures using round-half-away-from-zero, and also reports the ceiling, floor and truncated values at the same precision.

**Use when:** You need a number rounded to a fixed number of decimals or significant figures, or its ceiling/floor at that precision, with the exact decimal behaviour (2.675 → 2.68).

**Do not use when:** You want a number written in scientific or engineering notation (use scientific-notation).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | The number to round. (min -1000000000000, max 1000000000000) |
| `precision` | integer |  | optional, default 2 | Decimal places when mode is decimals (negative rounds to tens, hundreds, …), or the number of significant figures (1–12) when mode is significant_figures. (min -9, max 12) |
| `mode` | enum: decimals \| significant_figures |  | optional, default "decimals" | Whether precision counts decimal places or significant figures. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `rounded` | number |  | Value rounded half away from zero at the requested precision. |
| `rounded_text` | string |  | The rounded value written with the requested number of decimals, e.g. '2.68' or '12300'. |
| `ceiling` | number |  | Smallest value at that precision that is ≥ value. |
| `floor` | number |  | Largest value at that precision that is ≤ value. |
| `truncated` | number |  | Value with the extra digits dropped (rounded toward zero). |
| `decimal_places_used` | integer |  | The decimal-place count actually used (derived from the magnitude in significant-figure mode). |

## Formula

`rounded = round_half_away(value × 10^p) / 10^p, where p = precision (decimals) or p = precision − 1 − ⌊log10|value|⌋ (significant figures); ceiling, floor and truncated use ⌈·⌉, ⌊·⌋ and trunc(·) instead`

The decimal shift uses the exact decimal digits of the input, so ties such as 2.675 are recognised as ties and rounded away from zero (2.68) instead of following binary floating-point noise (2.67).

## Data Sources

- Wikipedia – Rounding — https://en.wikipedia.org/wiki/Rounding (reference, retrieved 2026-09-23)
- Wikipedia – Significant figures — https://en.wikipedia.org/wiki/Significant_figures (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Significant Digits — https://mathworld.wolfram.com/SignificantDigits.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/rounding?value=…`
- `POST https://tttkmbb.com/api/v1/calculate/rounding` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/rounding · OpenAPI operationId `calculate_rounded_value` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "rounding", "inputs": {…}}`

## Example

- 2.675 to 2 decimals: inputs `{"value":2.675,"precision":2,"mode":"decimals"}` → `{"rounded":2.68,"rounded_text":"2.68","ceiling":2.68,"floor":2.67,"truncated":2.67,"decimal_places_used":2}`
- 12345.678 to 3 significant figures: inputs `{"value":12345.678,"precision":3,"mode":"significant_figures"}` → `{"rounded":12300,"rounded_text":"12300","ceiling":12400,"floor":12300,"truncated":12300,"decimal_places_used":-2}`

```
GET https://tttkmbb.com/api/v1/calculate/rounding?value=2.675&precision=2&mode=decimals
```

## Limitations

You want a number written in scientific or engineering notation (use scientific-notation). The decimal shift uses the exact decimal digits of the input, so ties such as 2.675 are recognised as ties and rounded away from zero (2.68) instead of following binary floating-point noise (2.67). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which tie-breaking rule is used?**

Round half away from zero: 2.5 → 3, −2.5 → −3, 2.675 → 2.68. Spreadsheets use the same rule; Python's round() and IEEE 754 default to round-half-to-even, which gives 2 for 2.5.

**How do I round to the nearest hundred?**

Use mode decimals with precision −2: 12345.678 → 12300.

## Related

- [Scientific Notation Converter](https://tttkmbb.com/math/scientific-notation.md) — Write the rounded number in scientific or engineering form.
- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — Percent results that usually need rounding.


---

# Arithmetic Sequence Calculator

> Computes the n-th term and the sum of the first n terms of an arithmetic progression from the first term and the common difference, and lists the first terms.

- Calculator id: `arithmetic-sequence` · Category: Math (`math`) · Tool name: `calculate_arithmetic_sequence`
- Canonical page: https://tttkmbb.com/math/arithmetic-sequence · This document: https://tttkmbb.com/math/arithmetic-sequence.md · JSON definition: https://tttkmbb.com/math/arithmetic-sequence.json

## Purpose

Computes the n-th term and the sum of the first n terms of an arithmetic progression from the first term and the common difference, and lists the first terms.

**Use when:** Terms increase or decrease by a constant amount (e.g. 2, 5, 8, …) and you need a specific term or the total of the first n terms.

**Do not use when:** Terms are multiplied by a constant ratio (use geometric-sequence) or you need interest that compounds (use compound-interest).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `first_term` | number |  | required | The first term of the sequence. |
| `common_difference` | number |  | required | Amount added to each term to get the next (negative for a decreasing sequence). |
| `n` | integer |  | required | Index of the term to compute and the number of terms to sum. (min 1, max 1000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `nth_term` | number |  | a₁ + (n − 1) × d. |
| `sum` | number |  | n × (a₁ + aₙ) / 2. |
| `first_terms` | number_list |  | The first min(n, 10) terms of the sequence. |
| `explicit_formula` | string |  | The formula for the general term with the given values. |

## Formula

`aₙ = a₁ + (n − 1)·d; Sₙ = n·(a₁ + aₙ)/2 = n·(2a₁ + (n − 1)·d)/2`

## Data Sources

- Wikipedia – Arithmetic progression — https://en.wikipedia.org/wiki/Arithmetic_progression (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Arithmetic Series — https://mathworld.wolfram.com/ArithmeticSeries.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/arithmetic-sequence?first_term=…&common_difference=…&n=…`
- `POST https://tttkmbb.com/api/v1/calculate/arithmetic-sequence` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/arithmetic-sequence · OpenAPI operationId `calculate_arithmetic_sequence` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "arithmetic-sequence", "inputs": {…}}`

## Example

- 2, 5, 8, … (10 terms): inputs `{"first_term":2,"common_difference":3,"n":10}` → `{"nth_term":29,"sum":155,"first_terms":[2,5,8,11,14,17,20,23,26,29],"explicit_formula":"a_n = 2 + (n − 1) × 3"}`
- 5, 3, 1, … (6 terms): inputs `{"first_term":5,"common_difference":-2,"n":6}` → `{"nth_term":-5,"sum":0,"first_terms":[5,3,1,-1,-3,-5]}`

```
GET https://tttkmbb.com/api/v1/calculate/arithmetic-sequence?first_term=2&common_difference=3&n=10
```

## Limitations

Terms are multiplied by a constant ratio (use geometric-sequence) or you need interest that compounds (use compound-interest). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I find d from two terms?**

d = (a_m − a_k) / (m − k). For a₁ = 2 and a₄ = 11, d = (11 − 2) / 3 = 3.

**Can the sum be zero or negative?**

Yes. With a negative common difference the terms eventually become negative and the partial sums can decrease, as in 5, 3, 1, −1, −3, −5 whose sum is 0.

## Related

- [Geometric Sequence Calculator](https://tttkmbb.com/math/geometric-sequence.md) — Sequences with a constant ratio instead of a constant difference.
- [Simple Interest Calculator](https://tttkmbb.com/finance/simple-interest.md) — Simple interest grows linearly like an arithmetic sequence.


---

# Geometric Sequence Calculator

> Computes the n-th term and the sum of the first n terms of a geometric progression from the first term and common ratio, plus the sum to infinity when |r| < 1.

- Calculator id: `geometric-sequence` · Category: Math (`math`) · Tool name: `calculate_geometric_sequence`
- Canonical page: https://tttkmbb.com/math/geometric-sequence · This document: https://tttkmbb.com/math/geometric-sequence.md · JSON definition: https://tttkmbb.com/math/geometric-sequence.json

## Purpose

Computes the n-th term and the sum of the first n terms of a geometric progression from the first term and common ratio, plus the sum to infinity when |r| < 1.

**Use when:** Each term is the previous one multiplied by a constant ratio (e.g. 3, 6, 12, …) and you need a term, a partial sum or the limit of the series.

**Do not use when:** Terms change by a constant difference (use arithmetic-sequence) or you need a money value with periodic deposits (use future-value / compound-interest).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `first_term` | number |  | required | The first term of the sequence. |
| `common_ratio` | number |  | required | Factor between consecutive terms (may be negative or fractional). |
| `n` | integer |  | required | Index of the term to compute and the number of terms to sum. (min 1, max 100000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `nth_term` | number |  | a₁ × r^(n − 1). |
| `sum` | number |  | a₁ × (1 − rⁿ) / (1 − r), or n × a₁ when r = 1. |
| `infinite_sum` | number |  | a₁ / (1 − r); only when \|r\| < 1 (the series converges). |
| `converges` | boolean |  | true when \|r\| < 1, so the infinite sum exists. |
| `first_terms` | number_list |  | The first min(n, 10) terms of the sequence. |
| `explicit_formula` | string |  | The formula for the general term with the given values. |

## Formula

`aₙ = a₁·r^(n−1); Sₙ = a₁·(1 − rⁿ)/(1 − r) for r ≠ 1 (Sₙ = n·a₁ for r = 1); S∞ = a₁/(1 − r) for |r| < 1`

## Data Sources

- Wikipedia – Geometric progression — https://en.wikipedia.org/wiki/Geometric_progression (reference, retrieved 2026-09-23)
- Wikipedia – Geometric series — https://en.wikipedia.org/wiki/Geometric_series (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Geometric Series — https://mathworld.wolfram.com/GeometricSeries.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/geometric-sequence?first_term=…&common_ratio=…&n=…`
- `POST https://tttkmbb.com/api/v1/calculate/geometric-sequence` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/geometric-sequence · OpenAPI operationId `calculate_geometric_sequence` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "geometric-sequence", "inputs": {…}}`

## Example

- 3, 6, 12, … (5 terms): inputs `{"first_term":3,"common_ratio":2,"n":5}` → `{"nth_term":48,"sum":93,"converges":false,"first_terms":[3,6,12,24,48],"explicit_formula":"a_n = 3 × 2^(n − 1)"}`
- 1, 1/2, 1/4, … (4 terms): inputs `{"first_term":1,"common_ratio":0.5,"n":4}` → `{"nth_term":0.125,"sum":1.875,"infinite_sum":2,"converges":true}`

```
GET https://tttkmbb.com/api/v1/calculate/geometric-sequence?first_term=3&common_ratio=2&n=5
```

## Limitations

Terms change by a constant difference (use arithmetic-sequence) or you need a money value with periodic deposits (use future-value / compound-interest). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**When does the infinite sum exist?**

Only when |r| < 1; then the terms shrink toward zero and the partial sums approach a₁ / (1 − r). For |r| ≥ 1 the series diverges and infinite_sum is omitted.

**What if the ratio is negative?**

Terms alternate in sign. The formulas still apply, and the series converges when |r| < 1 (e.g. r = −0.5 gives S∞ = a₁ / 1.5).

## Related

- [Arithmetic Sequence Calculator](https://tttkmbb.com/math/arithmetic-sequence.md) — Sequences with a constant difference.
- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Compound growth is a geometric sequence in the balance.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — The power rⁿ used in the formulas.


---

# Modulo Calculator

> Divides one number by another and reports the remainder under the three common sign conventions (truncated as in C/JavaScript, floored as in Python, and the non-negative Euclidean modulo) together with the integer quotient.

- Calculator id: `modulo` · Category: Math (`math`) · Tool name: `calculate_modulo`
- Canonical page: https://tttkmbb.com/math/modulo · This document: https://tttkmbb.com/math/modulo.md · JSON definition: https://tttkmbb.com/math/modulo.json

## Purpose

Divides one number by another and reports the remainder under the three common sign conventions (truncated as in C/JavaScript, floored as in Python, and the non-negative Euclidean modulo) together with the integer quotient.

**Use when:** You need a mod b, the remainder of a division, or want to know how different programming languages treat negative operands.

**Do not use when:** You need the prime factors or divisors of a number (use prime-factorization) or a change of number base (use base-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `dividend` | number |  | required | The number being divided. Integers are exact; decimals are allowed. (min -1000000000000000, max 1000000000000000) |
| `divisor` | number |  | required | The number to divide by; must not be 0. (min -1000000000000000, max 1000000000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `remainder` | number |  | a − b × trunc(a / b): the % operator of C, Java and JavaScript. |
| `quotient` | number |  | trunc(a / b), rounded toward zero. |
| `floored_modulo` | number |  | a − b × ⌊a / b⌋: the % operator of Python and the mod of spreadsheets. |
| `modulo` | number |  | The mathematical residue in [0, \|b\|): a − \|b\| × ⌊a / \|b\|⌋. |
| `is_divisible` | boolean |  | true when the remainder is 0. |
| `expression` | string |  | a = b × quotient + remainder with the truncated convention. |

## Formula

`truncated: r = a − b·trunc(a/b); floored: r = a − b·⌊a/b⌋; Euclidean: r = a − |b|·⌊a/|b|⌋ (0 ≤ r < |b|)`

## Data Sources

- Wikipedia – Modulo — https://en.wikipedia.org/wiki/Modulo (reference, retrieved 2026-09-23)
- Wikipedia – Euclidean division — https://en.wikipedia.org/wiki/Euclidean_division (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Mod — https://mathworld.wolfram.com/Mod.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/modulo?dividend=…&divisor=…`
- `POST https://tttkmbb.com/api/v1/calculate/modulo` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/modulo · OpenAPI operationId `calculate_modulo` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "modulo", "inputs": {…}}`

## Example

- 17 mod 5: inputs `{"dividend":17,"divisor":5}` → `{"remainder":2,"quotient":3,"floored_modulo":2,"modulo":2,"is_divisible":false,"expression":"17 = 5 × 3 + 2"}`
- −7 mod 3: inputs `{"dividend":-7,"divisor":3}` → `{"remainder":-1,"quotient":-2,"floored_modulo":2,"modulo":2,"is_divisible":false}`

```
GET https://tttkmbb.com/api/v1/calculate/modulo?dividend=17&divisor=5
```

## Limitations

You need the prime factors or divisors of a number (use prime-factorization) or a change of number base (use base-converter). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why does −7 mod 3 give both −1 and 2?**

Languages disagree on the sign: C, Java and JavaScript return −1 (remainder takes the sign of the dividend), Python and Excel return 2 (sign of the divisor). The Euclidean modulo is always non-negative.

**Does it work with decimals?**

Yes, e.g. 7.5 mod 2 = 1.5. Because inputs are binary floating-point numbers, results like 0.3 mod 0.1 may show tiny rounding artefacts.

## Related

- [GCD and LCM Calculator](https://tttkmbb.com/math/gcd-lcm.md) — The Euclidean algorithm is built from repeated modulo.
- [Number Base Converter](https://tttkmbb.com/math/base-converter.md) — Base conversion uses repeated division with remainder.
- [Day of the Week Calculator](https://tttkmbb.com/everyday/day-of-week.md) — Calendar arithmetic is modulo 7.


---

# Number Base Converter

> Converts an integer written in one base (2–36) to another, using exact arbitrary-precision arithmetic, and always shows the binary, octal, decimal and hexadecimal forms.

- Calculator id: `base-converter` · Category: Math (`math`) · Tool name: `convert_number_base`
- Canonical page: https://tttkmbb.com/math/base-converter · This document: https://tttkmbb.com/math/base-converter.md · JSON definition: https://tttkmbb.com/math/base-converter.json

## Purpose

Converts an integer written in one base (2–36) to another, using exact arbitrary-precision arithmetic, and always shows the binary, octal, decimal and hexadecimal forms.

**Use when:** You need to convert between binary, octal, decimal, hexadecimal or any positional base up to 36, including large integers.

**Do not use when:** The value has a fractional part, you need Roman numerals (use roman-numeral) or byte/bit unit conversions (use data-storage).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | string |  | required | Integer written in the source base, e.g. 'ff' or '1010'. Letters a–z stand for digits 10–35 (case-insensitive); an optional leading '-' and the prefixes 0x, 0o, 0b are accepted. |
| `from_base` | integer |  | optional, default 10 | Base of the input value. (min 2, max 36) |
| `to_base` | integer |  | optional, default 2 | Base of the result. (min 2, max 36) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | string |  | The number written in to_base (digits above 9 as uppercase letters). |
| `decimal` | string |  | Exact base-10 representation (a string so that very large values are not rounded). |
| `decimal_value` | number |  | Base-10 value as a number; omitted when it exceeds 2^53. |
| `binary` | string |  | Base-2 representation. |
| `octal` | string |  | Base-8 representation. |
| `hexadecimal` | string |  | Base-16 representation. |

## Formula

`value = Σ dᵢ × from_base^i (digits read right to left); the result digits are the remainders of repeated division by to_base`

## Data Sources

- Wikipedia – Radix — https://en.wikipedia.org/wiki/Radix (reference, retrieved 2026-09-23)
- Wikipedia – Positional notation — https://en.wikipedia.org/wiki/Positional_notation (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Base — https://mathworld.wolfram.com/Base.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/base-converter?value=…`
- `POST https://tttkmbb.com/api/v1/calculate/base-converter` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/base-converter · OpenAPI operationId `convert_number_base` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "base-converter", "inputs": {…}}`

## Example

- ff (hex) to decimal: inputs `{"value":"ff","from_base":16,"to_base":10}` → `{"result":"255","decimal":"255","decimal_value":255,"binary":"11111111","octal":"377","hexadecimal":"FF"}`
- 1010 (binary) to hex: inputs `{"value":"1010","from_base":2,"to_base":16}` → `{"result":"A","decimal":"10","decimal_value":10,"binary":"1010","octal":"12"}`

```
GET https://tttkmbb.com/api/v1/calculate/base-converter?value=ff&from_base=16&to_base=10
```

## Limitations

The value has a fractional part, you need Roman numerals (use roman-numeral) or byte/bit unit conversions (use data-storage). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Are negative numbers supported?**

Yes, with a leading minus sign (sign-magnitude form). Two's-complement bit patterns are not interpreted.

**What about fractions like 0.1 in binary?**

Not supported; only integers are converted. Multiply by a power of the base first if you need fixed-point digits.

## Related

- [Modulo Calculator](https://tttkmbb.com/math/modulo.md) — Remainders used by the conversion algorithm.
- [Data Storage Converter](https://tttkmbb.com/conversion/data-storage.md) — Convert between bits, bytes and larger units.
- [Roman Numeral Converter](https://tttkmbb.com/everyday/roman-numeral.md) — A non-positional numeral system.


---

# Scientific Notation Converter

> Writes a number in normalised scientific notation m × 10^e with 1 ≤ |m| < 10, in E-notation, and in engineering notation (exponent a multiple of 3).

- Calculator id: `scientific-notation` · Category: Math (`math`) · Tool name: `convert_to_scientific_notation`
- Canonical page: https://tttkmbb.com/math/scientific-notation · This document: https://tttkmbb.com/math/scientific-notation.md · JSON definition: https://tttkmbb.com/math/scientific-notation.json

## Purpose

Writes a number in normalised scientific notation m × 10^e with 1 ≤ |m| < 10, in E-notation, and in engineering notation (exponent a multiple of 3).

**Use when:** You need a very large or very small number in scientific or engineering form, or its order of magnitude.

**Do not use when:** You want to round a number to a given precision (use rounding) or compute a power (use exponent).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Any number, e.g. 123400 or 0.000123. (min -1e+300, max 1e+300) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `mantissa` | number |  | Significand with 1 ≤ \|m\| < 10 (0 for zero). |
| `exponent` | integer |  | Power of 10 such that value = m × 10^e; also the order of magnitude. |
| `scientific_notation` | string |  | e.g. '1.234 × 10^5'. |
| `e_notation` | string |  | Calculator/programming form, e.g. '1.234e5'. |
| `engineering_notation` | string |  | Exponent a multiple of 3 and mantissa between 1 and 999.999…, e.g. '123.4 × 10^3'. |
| `engineering_mantissa` | number |  | Mantissa of the engineering form. |
| `engineering_exponent` | integer |  | Exponent of the engineering form (…, −6, −3, 0, 3, 6, …). |

## Formula

`e = ⌊log10|value|⌋, m = value / 10^e; engineering: e₃ = 3·⌊e/3⌋, m₃ = value / 10^e₃`

The digits come from the shortest decimal representation that round-trips the input, so 0.000123 is reported as 1.23 × 10^-4 without floating-point noise.

## Data Sources

- Wikipedia – Scientific notation — https://en.wikipedia.org/wiki/Scientific_notation (reference, retrieved 2026-09-23)
- Wikipedia – Engineering notation — https://en.wikipedia.org/wiki/Engineering_notation (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Scientific Notation — https://mathworld.wolfram.com/ScientificNotation.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/scientific-notation?value=…`
- `POST https://tttkmbb.com/api/v1/calculate/scientific-notation` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/scientific-notation · OpenAPI operationId `convert_to_scientific_notation` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "scientific-notation", "inputs": {…}}`

## Example

- 123400: inputs `{"value":123400}` → `{"mantissa":1.234,"exponent":5,"scientific_notation":"1.234 × 10^5","e_notation":"1.234e5","engineering_notation":"123.4 × 10^3","engineering_mantissa":123.4,"engineering_exponent":3}`
- 0.000123: inputs `{"value":0.000123}` → `{"mantissa":1.23,"exponent":-4,"scientific_notation":"1.23 × 10^-4","e_notation":"1.23e-4","engineering_notation":"123 × 10^-6","engineering_mantissa":123,"engineering_exponent":-6}`

```
GET https://tttkmbb.com/api/v1/calculate/scientific-notation?value=123400
```

## Limitations

You want to round a number to a given precision (use rounding) or compute a power (use exponent). The digits come from the shortest decimal representation that round-trips the input, so 0.000123 is reported as 1.23 × 10^-4 without floating-point noise. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the difference between scientific and engineering notation?**

Scientific notation keeps one digit before the decimal point; engineering notation uses exponents that are multiples of 3 so the number maps onto SI prefixes (10^3 = kilo, 10^-6 = micro).

**How many digits are kept?**

All significant digits of the input (up to 12 in the text forms); to shorten the mantissa, round the value first with the rounding calculator.

## Related

- [Rounding Calculator](https://tttkmbb.com/math/rounding.md) — Round to a number of significant figures before formatting.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Evaluate powers of 10 and other bases.
- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — log10 gives the exponent directly.


---

# Circle Calculator

> Computes the area, circumference, diameter and radius of a circle from either its radius or its diameter. Lengths are unit-agnostic: the area is in the square of the input unit.

- Calculator id: `circle` · Category: Geometry (`geometry`) · Tool name: `calculate_circle_properties`
- Canonical page: https://tttkmbb.com/geometry/circle · This document: https://tttkmbb.com/geometry/circle.md · JSON definition: https://tttkmbb.com/geometry/circle.json

## Purpose

Computes the area, circumference, diameter and radius of a circle from either its radius or its diameter. Lengths are unit-agnostic: the area is in the square of the input unit.

**Use when:** You know a circle's radius or diameter and need its area, circumference or the other dimension.

**Do not use when:** The shape is an ellipse (use ellipse), a solid ball (use sphere) or a disc with thickness (use cylinder).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `radius` | number | units | optional | Radius of the circle. Give either radius or diameter. (> 0) |
| `diameter` | number | units | optional | Diameter of the circle (2 × radius). Used when radius is not given. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `radius` | number | units | Radius r (as given, or diameter / 2). |
| `diameter` | number | units | 2·r. |
| `circumference` | number | units | 2·π·r. |
| `area` | number | units² | π·r², in the square of the input unit. |

## Formula

`r = radius (or diameter / 2); diameter = 2·r; circumference = 2·π·r; area = π·r²`

## Data Sources

- Wikipedia – Circle — https://en.wikipedia.org/wiki/Circle (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Circle — https://mathworld.wolfram.com/Circle.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/circle?`
- `POST https://tttkmbb.com/api/v1/calculate/circle` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/circle · OpenAPI operationId `calculate_circle_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_circle_properties` (dedicated) or `run_calculator` with `{"calculator_id": "circle", "inputs": {…}}`

## Example

- Radius 3: inputs `{"radius":3}` → `{"radius":3,"diameter":6,"circumference":18.8496,"area":28.2743}`
- Diameter 10: inputs `{"diameter":10}` → `{"radius":5,"circumference":31.4159,"area":78.5398}`

```
GET https://tttkmbb.com/api/v1/calculate/circle?radius=3
```

## Limitations

The shape is an ellipse (use ellipse), a solid ball (use sphere) or a disc with thickness (use cylinder). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What units are the results in?**

The same unit as the input for lengths and its square for the area: a radius in cm gives a circumference in cm and an area in cm².

**What if I give both radius and diameter?**

They must agree (diameter = 2 × radius); otherwise the calculator returns an INVALID_PARAMETER error rather than guessing which one is right.

**How do I get the radius from the area?**

r = √(area / π). Enter that radius here to get the remaining properties.

## Related

- [Sphere Calculator](https://tttkmbb.com/geometry/sphere.md) — Volume and surface area of a ball with the same radius.
- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Volume of a circular disc or tube with this cross-section.
- [Ellipse Calculator](https://tttkmbb.com/geometry/ellipse.md) — Area and perimeter when the two axes differ.


---

# Triangle Area Calculator

> Computes the area of any triangle from base and height, from three sides (Heron's formula) or from two sides and their included angle in degrees, and reports which method was used.

- Calculator id: `triangle-area` · Category: Geometry (`geometry`) · Tool name: `calculate_triangle_area`
- Canonical page: https://tttkmbb.com/geometry/triangle-area · This document: https://tttkmbb.com/geometry/triangle-area.md · JSON definition: https://tttkmbb.com/geometry/triangle-area.json

## Purpose

Computes the area of any triangle from base and height, from three sides (Heron's formula) or from two sides and their included angle in degrees, and reports which method was used.

**Use when:** You need the area of a triangle and know either its base and height, all three sides, or two sides and the angle between them.

**Do not use when:** You need the missing sides or angles as well (use triangle-solver), or the triangle is right-angled and you want all its parts (use right-triangle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base` | number | units | optional | Length of one side chosen as the base (method 1, with height). (> 0) |
| `height` | number | units | optional | Perpendicular distance from the base to the opposite vertex (method 1). (> 0) |
| `side_a` | number | units | optional | First side (methods 2 and 3). (> 0) |
| `side_b` | number | units | optional | Second side (methods 2 and 3). (> 0) |
| `side_c` | number | units | optional | Third side (method 2, Heron's formula). (> 0) |
| `included_angle_deg` | number | degrees | optional | Angle between side_a and side_b in degrees (method 3). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | Triangle area in the square of the input unit. |
| `perimeter` | number | units | Sum of the three sides (only for the three-side and two-sides-plus-angle methods). |
| `method` | string |  | Which of the three formulas was applied. |

## Formula

`Method 1: area = base × height / 2. Method 2 (Heron): s = (side_a + side_b + side_c) / 2, area = √(s·(s − side_a)·(s − side_b)·(s − side_c)). Method 3: area = ½ · side_a · side_b · sin(included_angle_deg).`

Inputs are checked in that order: base and height first, then three sides, then two sides with the included angle. Three sides must satisfy the triangle inequality.

## Data Sources

- Wikipedia – Heron's formula — https://en.wikipedia.org/wiki/Heron%27s_formula (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Triangle Area — https://mathworld.wolfram.com/TriangleArea.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/triangle-area?`
- `POST https://tttkmbb.com/api/v1/calculate/triangle-area` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/triangle-area · OpenAPI operationId `calculate_triangle_area` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "triangle-area", "inputs": {…}}`

## Example

- Base 10, height 4: inputs `{"base":10,"height":4}` → `{"area":20,"method":"Base × height / 2"}`
- Sides 7, 8, 9 (Heron): inputs `{"side_a":7,"side_b":8,"side_c":9}` → `{"area":26.8328,"perimeter":24,"method":"Heron's formula (three sides)"}`
- Sides 5 and 7 with 60° between them: inputs `{"side_a":5,"side_b":7,"included_angle_deg":60}` → `{"area":15.1554,"perimeter":18.245,"method":"Two sides and included angle (½·a·b·sin C)"}`

```
GET https://tttkmbb.com/api/v1/calculate/triangle-area?base=10&height=4
```

## Limitations

You need the missing sides or angles as well (use triangle-solver), or the triangle is right-angled and you want all its parts (use right-triangle). Inputs are checked in that order: base and height first, then three sides, then two sides with the included angle. Three sides must satisfy the triangle inequality. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which height do I use?**

The perpendicular distance from the chosen base to the opposite vertex, not the length of another side. For an obtuse triangle the foot of the height can lie outside the base.

**Is the angle in degrees or radians?**

Degrees. Convert radians with degrees = radians × 180 / π before entering them.

**Why does Heron's formula return an error?**

The three sides must satisfy the triangle inequality (each side shorter than the sum of the other two); otherwise no triangle exists.

## Related

- [Triangle Solver](https://tttkmbb.com/geometry/triangle-solver.md) — Get all sides and angles, not just the area.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Right triangles from any two sides.
- [Regular Polygon Calculator](https://tttkmbb.com/geometry/regular-polygon.md) — Area of an equilateral triangle as a 3-sided regular polygon.


---

# Right Triangle Calculator

> Solves a right triangle from any two of its sides (two legs, or one leg and the hypotenuse) using the Pythagorean theorem, and returns all sides, the two acute angles in degrees, area, perimeter and the altitude to the hypotenuse.

- Calculator id: `right-triangle` · Category: Geometry (`geometry`) · Tool name: `solve_right_triangle`
- Canonical page: https://tttkmbb.com/geometry/right-triangle · This document: https://tttkmbb.com/geometry/right-triangle.md · JSON definition: https://tttkmbb.com/geometry/right-triangle.json

## Purpose

Solves a right triangle from any two of its sides (two legs, or one leg and the hypotenuse) using the Pythagorean theorem, and returns all sides, the two acute angles in degrees, area, perimeter and the altitude to the hypotenuse.

**Use when:** You know two sides of a right-angled triangle and need the third side, the angles or the area.

**Do not use when:** The triangle has no right angle (use triangle-solver) or you only need the hypotenuse length (pythagorean gives just that).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `leg_a` | number | units | optional | First leg (side adjacent to the right angle). (> 0) |
| `leg_b` | number | units | optional | Second leg (side adjacent to the right angle). (> 0) |
| `hypotenuse` | number | units | optional | Side opposite the right angle; must be longer than either leg. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `leg_a` | number | units | First leg. |
| `leg_b` | number | units | Second leg. |
| `hypotenuse` | number | units | √(leg_a² + leg_b²). |
| `angle_a_deg` | number | degrees | Acute angle opposite leg_a = atan(leg_a / leg_b). |
| `angle_b_deg` | number | degrees | Acute angle opposite leg_b = 90 − angle_a_deg. |
| `area` | number | units² | leg_a × leg_b / 2. |
| `perimeter` | number | units | leg_a + leg_b + hypotenuse. |
| `altitude_to_hypotenuse` | number | units | Height from the right angle onto the hypotenuse = leg_a × leg_b / hypotenuse. |

## Formula

`hypotenuse² = leg_a² + leg_b²; angle_a_deg = atan(leg_a / leg_b); angle_b_deg = 90 − angle_a_deg; area = leg_a × leg_b / 2; altitude = leg_a × leg_b / hypotenuse`

## Data Sources

- Wikipedia – Right triangle — https://en.wikipedia.org/wiki/Right_triangle (reference, retrieved 2026-09-23)
- Wikipedia – Pythagorean theorem — https://en.wikipedia.org/wiki/Pythagorean_theorem (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Right Triangle — https://mathworld.wolfram.com/RightTriangle.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/right-triangle?`
- `POST https://tttkmbb.com/api/v1/calculate/right-triangle` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/right-triangle · OpenAPI operationId `solve_right_triangle` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "right-triangle", "inputs": {…}}`

## Example

- Legs 3 and 4: inputs `{"leg_a":3,"leg_b":4}` → `{"hypotenuse":5,"angle_a_deg":36.8699,"angle_b_deg":53.1301,"area":6,"perimeter":12,"altitude_to_hypotenuse":2.4}`
- Leg 5, hypotenuse 13: inputs `{"leg_a":5,"hypotenuse":13}` → `{"leg_b":12,"angle_a_deg":22.6199,"angle_b_deg":67.3801,"area":30,"perimeter":30}`

```
GET https://tttkmbb.com/api/v1/calculate/right-triangle?leg_a=3&leg_b=4
```

## Limitations

The triangle has no right angle (use triangle-solver) or you only need the hypotenuse length (pythagorean gives just that). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which angle is angle_a_deg?**

The angle opposite leg_a (at the vertex where leg_b meets the hypotenuse). The two acute angles always add up to 90°.

**What if I enter all three sides?**

They must satisfy leg_a² + leg_b² = hypotenuse² (to 0.01 %); otherwise an INVALID_PARAMETER error is returned. Give just two sides to avoid this.

## Related

- [Triangle Solver](https://tttkmbb.com/geometry/triangle-solver.md) — Solve triangles that are not right-angled.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Area only, by any of three methods.
- [Pythagorean Theorem Calculator](https://tttkmbb.com/math/pythagorean.md) — Just the hypotenuse or a leg from the Pythagorean theorem.


---

# Triangle Solver

> Solves a triangle from three sides (SSS) or from two sides and their included angle in degrees (SAS) with the law of cosines, returning all sides, all angles, perimeter, area, inradius, circumradius and the classification by sides and by angles.

- Calculator id: `triangle-solver` · Category: Geometry (`geometry`) · Tool name: `solve_triangle`
- Canonical page: https://tttkmbb.com/geometry/triangle-solver · This document: https://tttkmbb.com/geometry/triangle-solver.md · JSON definition: https://tttkmbb.com/geometry/triangle-solver.json

## Purpose

Solves a triangle from three sides (SSS) or from two sides and their included angle in degrees (SAS) with the law of cosines, returning all sides, all angles, perimeter, area, inradius, circumradius and the classification by sides and by angles.

**Use when:** You know three sides, or two sides and the angle between them, and need the remaining sides and angles, the area or the triangle type.

**Do not use when:** You know two angles and a side (ASA/AAS) or a non-included angle (SSA), which this calculator does not accept; for right triangles from two sides use right-triangle.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `side_a` | number | units | required | First side. (> 0) |
| `side_b` | number | units | required | Second side. (> 0) |
| `side_c` | number | units | optional | Third side, opposite the angle between a and b (SSS). Omit for SAS. (> 0) |
| `angle_c_deg` | number | degrees | optional | Included angle between side_a and side_b in degrees (SAS). Omit when side_c is given. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `side_a` | number | units | Side opposite angle A. |
| `side_b` | number | units | Side opposite angle B. |
| `side_c` | number | units | Side opposite angle C (computed for SAS). |
| `angle_a_deg` | number | degrees | Angle opposite side_a. |
| `angle_b_deg` | number | degrees | Angle opposite side_b. |
| `angle_c_deg` | number | degrees | Angle opposite side_c. |
| `perimeter` | number | units | side_a + side_b + side_c. |
| `area` | number | units² | ½ · side_a · side_b · sin C. |
| `inradius` | number | units | Radius of the inscribed circle = area / semiperimeter. |
| `circumradius` | number | units | Radius of the circumscribed circle = a·b·c / (4 · area). |
| `side_type` | string |  | equilateral, isosceles or scalene. |
| `angle_type` | string |  | acute, right or obtuse. |
| `method` | string |  | SSS or SAS. |

## Formula

`SAS: side_c = √(a² + b² − 2·a·b·cos C). Angles by the law of cosines: cos A = (b² + c² − a²) / (2·b·c), cos B = (a² + c² − b²) / (2·a·c), C = 180° − A − B. area = ½·a·b·sin C; inradius = area / s with s = perimeter / 2; circumradius = a·b·c / (4·area).`

Sides must satisfy the triangle inequality. A triangle is classified as right when its largest angle is within 1e-6° of 90°, so rounded side lengths such as 1, 1, 1.4142 classify as acute.

## Data Sources

- Wikipedia – Law of cosines — https://en.wikipedia.org/wiki/Law_of_cosines (reference, retrieved 2026-09-23)
- Wikipedia – Solution of triangles — https://en.wikipedia.org/wiki/Solution_of_triangles (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Law of Cosines — https://mathworld.wolfram.com/LawofCosines.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/triangle-solver?side_a=…&side_b=…`
- `POST https://tttkmbb.com/api/v1/calculate/triangle-solver` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/triangle-solver · OpenAPI operationId `solve_triangle` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "triangle-solver", "inputs": {…}}`

## Example

- Sides 3, 4, 5 (SSS): inputs `{"side_a":3,"side_b":4,"side_c":5}` → `{"angle_a_deg":36.8699,"angle_b_deg":53.1301,"angle_c_deg":90,"perimeter":12,"area":6,"inradius":1,"circumradius":2.5,"side_type":"scalene","angle_type":"right","method":"SSS"}`
- Sides 5 and 7 with 60° between them (SAS): inputs `{"side_a":5,"side_b":7,"angle_c_deg":60}` → `{"side_c":6.245,"angle_a_deg":43.8979,"angle_b_deg":76.1021,"angle_c_deg":60,"perimeter":18.245,"area":15.1554,"inradius":1.6613,"circumradius":3.6056,"side_type":"scalene","angle_type":"acute","method":"SAS"}`
- Equilateral, side 5: inputs `{"side_a":5,"side_b":5,"side_c":5}` → `{"angle_a_deg":60,"area":10.8253,"inradius":1.4434,"circumradius":2.8868,"side_type":"equilateral","angle_type":"acute"}`

```
GET https://tttkmbb.com/api/v1/calculate/triangle-solver?side_a=3&side_b=4&side_c=5
```

## Limitations

You know two angles and a side (ASA/AAS) or a non-included angle (SSA), which this calculator does not accept; for right triangles from two sides use right-triangle. Sides must satisfy the triangle inequality. A triangle is classified as right when its largest angle is within 1e-6° of 90°, so rounded side lengths such as 1, 1, 1.4142 classify as acute. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Where is angle C?**

Between side_a and side_b, opposite side_c. For SAS enter that included angle; a non-included angle (SSA) can give two solutions and is not supported here.

**Why do I get a triangle inequality error?**

No triangle exists when one side is as long as or longer than the other two together, e.g. 1, 2, 10. Check the units and the order of the sides.

## Related

- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Area only, including the base-and-height method.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Simpler solver for right-angled triangles.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert the angles to radians or gradians.


---

# Rectangle Calculator

> Computes the area, perimeter and diagonal of a rectangle from its length and width. Lengths are unit-agnostic; the area is in the square of the input unit.

- Calculator id: `rectangle` · Category: Geometry (`geometry`) · Tool name: `calculate_rectangle_properties`
- Canonical page: https://tttkmbb.com/geometry/rectangle · This document: https://tttkmbb.com/geometry/rectangle.md · JSON definition: https://tttkmbb.com/geometry/rectangle.json

## Purpose

Computes the area, perimeter and diagonal of a rectangle from its length and width. Lengths are unit-agnostic; the area is in the square of the input unit.

**Use when:** You need the area, perimeter or diagonal of a rectangle or square (enter equal length and width).

**Do not use when:** The shape is a box with depth (use rectangular-prism) or a slanted quadrilateral (use parallelogram or trapezoid).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `length` | number | units | required | Length of the rectangle. (> 0) |
| `width` | number | units | required | Width of the rectangle. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | length × width. |
| `perimeter` | number | units | 2 × (length + width). |
| `diagonal` | number | units | √(length² + width²). |
| `diagonal_angle_deg` | number | degrees | Angle between the diagonal and the length side = atan(width / length). |

## Formula

`area = length × width; perimeter = 2 × (length + width); diagonal = √(length² + width²); diagonal_angle_deg = atan(width / length)`

## Data Sources

- Wikipedia – Rectangle — https://en.wikipedia.org/wiki/Rectangle (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Rectangle — https://mathworld.wolfram.com/Rectangle.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/rectangle?length=…&width=…`
- `POST https://tttkmbb.com/api/v1/calculate/rectangle` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/rectangle · OpenAPI operationId `calculate_rectangle_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "rectangle", "inputs": {…}}`

## Example

- 5 by 3: inputs `{"length":5,"width":3}` → `{"area":15,"perimeter":16,"diagonal":5.831,"diagonal_angle_deg":30.9638}`
- 12 by 5: inputs `{"length":12,"width":5}` → `{"area":60,"perimeter":34,"diagonal":13,"diagonal_angle_deg":22.6199}`

```
GET https://tttkmbb.com/api/v1/calculate/rectangle?length=5&width=3
```

## Limitations

The shape is a box with depth (use rectangular-prism) or a slanted quadrilateral (use parallelogram or trapezoid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does it matter which side is the length?**

No for area, perimeter and diagonal. Only diagonal_angle_deg is measured from the side entered as length.

**How do I use it for a square?**

Enter the same value for length and width; the diagonal is then side × √2 and the diagonal angle is 45°.

## Related

- [Rectangular Prism Calculator](https://tttkmbb.com/geometry/rectangular-prism.md) — Add a height to get a box's volume and surface area.
- [Parallelogram Calculator](https://tttkmbb.com/geometry/parallelogram.md) — Quadrilateral with slanted sides.
- [Flooring Calculator](https://tttkmbb.com/construction/flooring.md) — Estimate flooring material for a rectangular room.


---

# Trapezoid Calculator

> Computes the area and midsegment of a trapezoid (trapezium) from its two parallel sides and height, and the perimeter when both non-parallel legs are given.

- Calculator id: `trapezoid` · Category: Geometry (`geometry`) · Tool name: `calculate_trapezoid_properties`
- Canonical page: https://tttkmbb.com/geometry/trapezoid · This document: https://tttkmbb.com/geometry/trapezoid.md · JSON definition: https://tttkmbb.com/geometry/trapezoid.json

## Purpose

Computes the area and midsegment of a trapezoid (trapezium) from its two parallel sides and height, and the perimeter when both non-parallel legs are given.

**Use when:** You need the area of a quadrilateral with exactly one pair of parallel sides, or its perimeter when all four sides are known.

**Do not use when:** Both pairs of sides are parallel (use parallelogram or rectangle) or you only know the four sides without the height (the height cannot be derived without an angle in general).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base_a` | number | units | required | First parallel side. (> 0) |
| `base_b` | number | units | required | Second parallel side. (> 0) |
| `height` | number | units | required | Perpendicular distance between the two parallel sides. (> 0) |
| `leg_c` | number | units | optional | First non-parallel side (optional, needed for the perimeter). (> 0) |
| `leg_d` | number | units | optional | Second non-parallel side (optional, needed for the perimeter). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | (base_a + base_b) / 2 × height. |
| `midsegment` | number | units | Segment joining the midpoints of the legs = (base_a + base_b) / 2. |
| `perimeter` | number | units | base_a + base_b + leg_c + leg_d (only when both legs are given). |

## Formula

`area = (base_a + base_b) / 2 × height; midsegment = (base_a + base_b) / 2; perimeter = base_a + base_b + leg_c + leg_d`

Each leg must be at least as long as the height (a leg equal to the height is perpendicular to the bases, as in a right trapezoid).

## Data Sources

- Wikipedia – Trapezoid — https://en.wikipedia.org/wiki/Trapezoid (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Trapezoid — https://mathworld.wolfram.com/Trapezoid.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/trapezoid?base_a=…&base_b=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/trapezoid` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/trapezoid · OpenAPI operationId `calculate_trapezoid_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "trapezoid", "inputs": {…}}`

## Example

- Bases 8 and 5, height 4, legs 4.5 and 5: inputs `{"base_a":8,"base_b":5,"height":4,"leg_c":4.5,"leg_d":5}` → `{"area":26,"midsegment":6.5,"perimeter":22.5}`
- Bases 10 and 6, height 3: inputs `{"base_a":10,"base_b":6,"height":3}` → `{"area":24,"midsegment":8}`

```
GET https://tttkmbb.com/api/v1/calculate/trapezoid?base_a=8&base_b=5&height=4&leg_c=4.5&leg_d=5
```

## Limitations

Both pairs of sides are parallel (use parallelogram or rectangle) or you only know the four sides without the height (the height cannot be derived without an angle in general). Each leg must be at least as long as the height (a leg equal to the height is perpendicular to the bases, as in a right trapezoid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Trapezoid or trapezium?**

In US usage a trapezoid has one pair of parallel sides; in British usage that shape is called a trapezium. This calculator uses the one-pair-of-parallel-sides definition.

**Can I get the area from four sides only?**

Not in general: the shape is not rigid unless which sides are parallel and the height (or an angle) are known. Enter the height directly.

## Related

- [Parallelogram Calculator](https://tttkmbb.com/geometry/parallelogram.md) — Both pairs of sides parallel.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — A trapezoid with one base of length 0 is a triangle.


---

# Parallelogram Calculator

> Computes the area of a parallelogram from base and height and, when the slanted side is given, its perimeter, the acute angle between base and side in degrees, and both diagonals.

- Calculator id: `parallelogram` · Category: Geometry (`geometry`) · Tool name: `calculate_parallelogram_properties`
- Canonical page: https://tttkmbb.com/geometry/parallelogram · This document: https://tttkmbb.com/geometry/parallelogram.md · JSON definition: https://tttkmbb.com/geometry/parallelogram.json

## Purpose

Computes the area of a parallelogram from base and height and, when the slanted side is given, its perimeter, the acute angle between base and side in degrees, and both diagonals.

**Use when:** You need the area, perimeter, angles or diagonals of a quadrilateral whose opposite sides are parallel (including rhombi).

**Do not use when:** All angles are right angles (use rectangle) or only one pair of sides is parallel (use trapezoid).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base` | number | units | required | Length of one side chosen as the base. (> 0) |
| `height` | number | units | required | Perpendicular distance between the base and its opposite side. (> 0) |
| `side` | number | units | optional | Length of the slanted side adjacent to the base (optional; must be at least the height). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | base × height. |
| `perimeter` | number | units | 2 × (base + side), only when side is given. |
| `angle_deg` | number | degrees | Acute angle between base and side = asin(height / side); the obtuse angle is 180° minus this. |
| `diagonal_long` | number | units | √(base² + side² + 2·base·√(side² − height²)). |
| `diagonal_short` | number | units | √(base² + side² − 2·base·√(side² − height²)). |

## Formula

`area = base × height; perimeter = 2 × (base + side); angle_deg = asin(height / side); diagonals = √(base² + side² ± 2·base·√(side² − height²))`

## Data Sources

- Wikipedia – Parallelogram — https://en.wikipedia.org/wiki/Parallelogram (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Parallelogram — https://mathworld.wolfram.com/Parallelogram.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/parallelogram?base=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/parallelogram` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/parallelogram · OpenAPI operationId `calculate_parallelogram_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "parallelogram", "inputs": {…}}`

## Example

- Base 8, height 5, side 6: inputs `{"base":8,"height":5,"side":6}` → `{"area":40,"perimeter":28,"angle_deg":56.4427,"diagonal_long":12.372,"diagonal_short":6.8508}`
- Base 10, height 3: inputs `{"base":10,"height":3}` → `{"area":30}`

```
GET https://tttkmbb.com/api/v1/calculate/parallelogram?base=8&height=5&side=6
```

## Limitations

All angles are right angles (use rectangle) or only one pair of sides is parallel (use trapezoid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why must the side be at least the height?**

The height is the perpendicular distance between the parallel sides, so the slanted side can never be shorter than it; side = height gives a rectangle.

**How do I compute a rhombus?**

Enter side = base. The area is still base × height, or you can use diagonal_long × diagonal_short / 2.

## Related

- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Special case with right angles.
- [Trapezoid Calculator](https://tttkmbb.com/geometry/trapezoid.md) — Only one pair of parallel sides.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Half a parallelogram cut along a diagonal.


---

# Regular Polygon Calculator

> Computes the area, perimeter, interior and exterior angles in degrees, apothem, circumradius and number of diagonals of a regular polygon from its number of sides and side length.

- Calculator id: `regular-polygon` · Category: Geometry (`geometry`) · Tool name: `calculate_regular_polygon_properties`
- Canonical page: https://tttkmbb.com/geometry/regular-polygon · This document: https://tttkmbb.com/geometry/regular-polygon.md · JSON definition: https://tttkmbb.com/geometry/regular-polygon.json

## Purpose

Computes the area, perimeter, interior and exterior angles in degrees, apothem, circumradius and number of diagonals of a regular polygon from its number of sides and side length.

**Use when:** You need properties of an equilateral, equiangular polygon (pentagon, hexagon, octagon, …) with 3 to 100 sides.

**Do not use when:** The polygon is irregular (split it into triangles and use triangle-area) or is a square, for which rectangle also works.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `number_of_sides` | integer |  | required | Number of sides n (3 = equilateral triangle, 4 = square, 6 = hexagon, …). (min 3, max 100) |
| `side_length` | number | units | required | Length of each side. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `polygon_name` | string |  | Common name of the polygon (e.g. hexagon), or n-gon. |
| `area` | number | units² | n × s² / (4 × tan(180° / n)). |
| `perimeter` | number | units | n × s. |
| `interior_angle_deg` | number | degrees | (n − 2) × 180° / n. |
| `exterior_angle_deg` | number | degrees | 360° / n. |
| `interior_angle_sum_deg` | number | degrees | (n − 2) × 180°. |
| `apothem` | number | units | Distance from the centre to the middle of a side = s / (2 × tan(180° / n)). |
| `circumradius` | number | units | Distance from the centre to a vertex = s / (2 × sin(180° / n)). |
| `diagonals` | integer |  | n × (n − 3) / 2. |

## Formula

`With n = number_of_sides and s = side_length: area = n·s² / (4·tan(π/n)); perimeter = n·s; interior angle = (n − 2)·180°/n; exterior angle = 360°/n; apothem = s / (2·tan(π/n)); circumradius = s / (2·sin(π/n)); diagonals = n·(n − 3)/2`

## Data Sources

- Wikipedia – Regular polygon — https://en.wikipedia.org/wiki/Regular_polygon (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Regular Polygon — https://mathworld.wolfram.com/RegularPolygon.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/regular-polygon?number_of_sides=…&side_length=…`
- `POST https://tttkmbb.com/api/v1/calculate/regular-polygon` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/regular-polygon · OpenAPI operationId `calculate_regular_polygon_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "regular-polygon", "inputs": {…}}`

## Example

- Hexagon, side 2: inputs `{"number_of_sides":6,"side_length":2}` → `{"polygon_name":"hexagon","area":10.3923,"perimeter":12,"interior_angle_deg":120,"exterior_angle_deg":60,"interior_angle_sum_deg":720,"apothem":1.7321,"circumradius":2,"diagonals":9}`
- Pentagon, side 10: inputs `{"number_of_sides":5,"side_length":10}` → `{"polygon_name":"pentagon","area":172.0477,"perimeter":50,"interior_angle_deg":108,"exterior_angle_deg":72,"apothem":6.8819,"circumradius":8.5065,"diagonals":5}`

```
GET https://tttkmbb.com/api/v1/calculate/regular-polygon?number_of_sides=6&side_length=2
```

## Limitations

The polygon is irregular (split it into triangles and use triangle-area) or is a square, for which rectangle also works. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the apothem?**

The perpendicular distance from the centre to a side, equal to the radius of the inscribed circle. Area also equals perimeter × apothem / 2.

**Can I start from the circumradius instead of the side?**

Convert first: side = 2 × R × sin(180° / n), then enter that side length.

## Related

- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — Limit of a regular polygon as the number of sides grows; the circumscribed circle.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Area of a general (irregular) triangle.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert the angles to radians.


---

# Ellipse Calculator

> Computes the area, approximate perimeter (Ramanujan's second approximation), eccentricity and focal distances of an ellipse from its semi-major and semi-minor axes.

- Calculator id: `ellipse` · Category: Geometry (`geometry`) · Tool name: `calculate_ellipse_properties`
- Canonical page: https://tttkmbb.com/geometry/ellipse · This document: https://tttkmbb.com/geometry/ellipse.md · JSON definition: https://tttkmbb.com/geometry/ellipse.json

## Purpose

Computes the area, approximate perimeter (Ramanujan's second approximation), eccentricity and focal distances of an ellipse from its semi-major and semi-minor axes.

**Use when:** You need the area or circumference of an ellipse or oval, or the position of its foci, from the two half-axes.

**Do not use when:** Both axes are equal (use circle for exact results) or you need the arc length of part of an ellipse, which requires elliptic integrals.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `semi_major_a` | number | units | required | Half of the longest diameter (centre to the farthest point). (> 0) |
| `semi_minor_b` | number | units | required | Half of the shortest diameter. If larger than a, the two are swapped. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | π × a × b. |
| `perimeter` | number | units | Ramanujan's second approximation; relative error below 4·10⁻⁵ % for a/b ≤ 5 and about 0.04 % as b → 0. |
| `eccentricity` | number |  | e = √(1 − b² / a²); 0 for a circle, approaching 1 for a very flat ellipse. |
| `linear_eccentricity` | number | units | c = √(a² − b²), distance from the centre to each focus. |
| `distance_between_foci` | number | units | 2 × c. |

## Formula

`area = π·a·b; h = ((a − b) / (a + b))²; perimeter ≈ π·(a + b)·(1 + 3h / (10 + √(4 − 3h))) (Ramanujan 1914, second approximation); eccentricity = √(1 − b²/a²); c = √(a² − b²)`

The exact perimeter is a complete elliptic integral of the second kind with no closed form; Ramanujan's second approximation is used because its error is negligible for practical axis ratios.

## Data Sources

- Wikipedia – Ellipse – circumference — https://en.wikipedia.org/wiki/Ellipse#Circumference (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Ellipse — https://mathworld.wolfram.com/Ellipse.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ellipse?semi_major_a=…&semi_minor_b=…`
- `POST https://tttkmbb.com/api/v1/calculate/ellipse` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ellipse · OpenAPI operationId `calculate_ellipse_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ellipse", "inputs": {…}}`

## Example

- a = 5, b = 3: inputs `{"semi_major_a":5,"semi_minor_b":3}` → `{"area":47.1239,"perimeter":25.527,"eccentricity":0.8,"linear_eccentricity":4,"distance_between_foci":8}`
- a = 7, b = 4: inputs `{"semi_major_a":7,"semi_minor_b":4}` → `{"area":87.9646,"perimeter":35.2032,"eccentricity":0.8207,"linear_eccentricity":5.7446}`

```
GET https://tttkmbb.com/api/v1/calculate/ellipse?semi_major_a=5&semi_minor_b=3
```

## Limitations

Both axes are equal (use circle for exact results) or you need the arc length of part of an ellipse, which requires elliptic integrals. The exact perimeter is a complete elliptic integral of the second kind with no closed form; Ramanujan's second approximation is used because its error is negligible for practical axis ratios. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do I enter the full axes or the half-axes?**

The half-axes (semi-axes), measured from the centre. If you know the full width and height of the oval, halve them first.

**How accurate is the perimeter?**

Ramanujan's second formula is exact for a circle and within 0.00004 % up to an axis ratio of 5:1; the worst case (a degenerate ellipse with b = 0) is about 0.04 % low.

## Related

- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — Exact results when both axes are equal.
- [Area Converter](https://tttkmbb.com/conversion/area.md) — Convert the area to another unit.


---

# Sphere Calculator

> Computes the volume, surface area, diameter and great-circle circumference of a sphere from its radius. The volume is in the cube and the surface area in the square of the input unit.

- Calculator id: `sphere` · Category: Geometry (`geometry`) · Tool name: `calculate_sphere_properties`
- Canonical page: https://tttkmbb.com/geometry/sphere · This document: https://tttkmbb.com/geometry/sphere.md · JSON definition: https://tttkmbb.com/geometry/sphere.json

## Purpose

Computes the volume, surface area, diameter and great-circle circumference of a sphere from its radius. The volume is in the cube and the surface area in the square of the input unit.

**Use when:** You need the volume or surface area of a ball, globe, bubble or planet from its radius.

**Do not use when:** The object is a hemisphere or spherical cap (halve or use the cap formula), an ellipsoid, or you only need a flat circle (use circle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `radius` | number | units | required | Radius of the sphere (half the diameter). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | 4/3 × π × r³. |
| `surface_area` | number | units² | 4 × π × r². |
| `diameter` | number | units | 2 × r. |
| `great_circle_circumference` | number | units | 2 × π × r, the length of the equator of the sphere. |

## Formula

`volume = 4/3 · π · radius³; surface_area = 4 · π · radius²; diameter = 2 · radius; great_circle_circumference = 2 · π · radius`

## Data Sources

- Wikipedia – Sphere — https://en.wikipedia.org/wiki/Sphere (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Sphere — https://mathworld.wolfram.com/Sphere.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sphere?radius=…`
- `POST https://tttkmbb.com/api/v1/calculate/sphere` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sphere · OpenAPI operationId `calculate_sphere_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sphere", "inputs": {…}}`

## Example

- Radius 2: inputs `{"radius":2}` → `{"volume":33.5103,"surface_area":50.2655,"diameter":4,"great_circle_circumference":12.5664}`
- Earth mean radius 6371 km: inputs `{"radius":6371}` → `{"volume":1083206916846,"surface_area":510064472,"great_circle_circumference":40030.1736}`

```
GET https://tttkmbb.com/api/v1/calculate/sphere?radius=2
```

## Limitations

The object is a hemisphere or spherical cap (halve or use the cap formula), an ellipsoid, or you only need a flat circle (use circle). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**I know the diameter, not the radius.**

Enter half the diameter. Doubling the radius multiplies the surface area by 4 and the volume by 8.

**How do I find the radius from a volume?**

r = (3 × volume / (4π))^(1/3). Enter that radius to get the other properties.

## Related

- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — The great circle (cross-section through the centre) of the same radius.
- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Compare with a cylinder of the same radius and height 2r (Archimedes' 2:3 ratio).
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert the volume to litres, gallons or other units.


---

# Cylinder Calculator

> Computes the volume, base area, lateral (curved) surface area and total surface area of a right circular cylinder from its radius and height.

- Calculator id: `cylinder` · Category: Geometry (`geometry`) · Tool name: `calculate_cylinder_properties`
- Canonical page: https://tttkmbb.com/geometry/cylinder · This document: https://tttkmbb.com/geometry/cylinder.md · JSON definition: https://tttkmbb.com/geometry/cylinder.json

## Purpose

Computes the volume, base area, lateral (curved) surface area and total surface area of a right circular cylinder from its radius and height.

**Use when:** You need the capacity or surface of a can, tank, pipe, pillar or any straight circular cylinder.

**Do not use when:** The cylinder is hollow (compute outer minus inner), tilted (oblique), or tapers to a point (use cone).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `radius` | number | units | required | Radius of the circular base. (> 0) |
| `height` | number | units | required | Distance between the two bases, measured perpendicular to them. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | π × r² × h. |
| `base_area` | number | units² | π × r², area of one circular end. |
| `lateral_area` | number | units² | 2 × π × r × h, the curved side only. |
| `total_surface_area` | number | units² | 2 × π × r × (r + h), both ends plus the side. |

## Formula

`volume = π · radius² · height; base_area = π · radius²; lateral_area = 2 · π · radius · height; total_surface_area = 2 · π · radius · (radius + height)`

## Data Sources

- Wikipedia – Cylinder — https://en.wikipedia.org/wiki/Cylinder (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Cylinder — https://mathworld.wolfram.com/Cylinder.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/cylinder?radius=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/cylinder` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/cylinder · OpenAPI operationId `calculate_cylinder_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "cylinder", "inputs": {…}}`

## Example

- Radius 3, height 5: inputs `{"radius":3,"height":5}` → `{"volume":141.3717,"base_area":28.2743,"lateral_area":94.2478,"total_surface_area":150.7964}`
- Radius 1, height 1: inputs `{"radius":1,"height":1}` → `{"volume":3.1416,"lateral_area":6.2832,"total_surface_area":12.5664}`

```
GET https://tttkmbb.com/api/v1/calculate/cylinder?radius=3&height=5
```

## Limitations

The cylinder is hollow (compute outer minus inner), tilted (oblique), or tapers to a point (use cone). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I get litres from the volume?**

Use the cube of the input unit: 1 dm³ = 1 litre, 1 cm³ = 1 ml, 1 m³ = 1000 litres. Enter dimensions in dm to read the volume directly in litres.

**Is the top included in the surface area?**

total_surface_area includes both circular ends; lateral_area is the curved side only (e.g. a label wrapped around a can).

## Related

- [Cone Calculator](https://tttkmbb.com/geometry/cone.md) — Same base but tapering to a point (one third of the volume).
- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — Properties of the circular base.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert the volume to litres or gallons.


---

# Cone Calculator

> Computes the volume, slant height, base area, lateral (curved) surface area, total surface area and half-apex angle in degrees of a right circular cone from its base radius and height.

- Calculator id: `cone` · Category: Geometry (`geometry`) · Tool name: `calculate_cone_properties`
- Canonical page: https://tttkmbb.com/geometry/cone · This document: https://tttkmbb.com/geometry/cone.md · JSON definition: https://tttkmbb.com/geometry/cone.json

## Purpose

Computes the volume, slant height, base area, lateral (curved) surface area, total surface area and half-apex angle in degrees of a right circular cone from its base radius and height.

**Use when:** You need the capacity or surface of a funnel, cone-shaped pile, roof or any right circular cone.

**Do not use when:** The cone is truncated (frustum), oblique, or has a square base (use pyramid).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `radius` | number | units | required | Radius of the circular base. (> 0) |
| `height` | number | units | required | Perpendicular distance from the base to the apex. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | 1/3 × π × r² × h. |
| `slant_height` | number | units | √(r² + h²), distance from the apex to the edge of the base. |
| `base_area` | number | units² | π × r². |
| `lateral_area` | number | units² | π × r × slant_height, the curved surface only. |
| `total_surface_area` | number | units² | π × r × (r + slant_height). |
| `half_apex_angle_deg` | number | degrees | Angle between the axis and the slant side = atan(r / h). |

## Formula

`volume = π · radius² · height / 3; slant_height = √(radius² + height²); base_area = π · radius²; lateral_area = π · radius · slant_height; total_surface_area = π · radius · (radius + slant_height); half_apex_angle_deg = atan(radius / height)`

## Data Sources

- Wikipedia – Cone — https://en.wikipedia.org/wiki/Cone (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Cone — https://mathworld.wolfram.com/Cone.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/cone?radius=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/cone` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/cone · OpenAPI operationId `calculate_cone_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "cone", "inputs": {…}}`

## Example

- Radius 3, height 4: inputs `{"radius":3,"height":4}` → `{"volume":37.6991,"slant_height":5,"base_area":28.2743,"lateral_area":47.1239,"total_surface_area":75.3982,"half_apex_angle_deg":36.8699}`
- Radius 5, height 12: inputs `{"radius":5,"height":12}` → `{"volume":314.1593,"slant_height":13,"lateral_area":204.2035,"total_surface_area":282.7433,"half_apex_angle_deg":22.6199}`

```
GET https://tttkmbb.com/api/v1/calculate/cone?radius=3&height=4
```

## Limitations

The cone is truncated (frustum), oblique, or has a square base (use pyramid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Height or slant height?**

Enter the perpendicular height (base to apex along the axis). If you only know the slant height l, the height is √(l² − r²).

**Why is the volume a third of a cylinder's?**

A cone with the same base and height has exactly one third of the cylinder's volume; this follows from integrating the shrinking cross-sections.

## Related

- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Same base without the taper (three times the volume).
- [Square Pyramid Calculator](https://tttkmbb.com/geometry/pyramid.md) — The square-based counterpart.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — The cross-section through the axis is a right triangle with legs r and h.


---

# Rectangular Prism Calculator

> Computes the volume, total surface area, space diagonal and total edge length of a rectangular prism (cuboid or box) from its length, width and height.

- Calculator id: `rectangular-prism` · Category: Geometry (`geometry`) · Tool name: `calculate_rectangular_prism_properties`
- Canonical page: https://tttkmbb.com/geometry/rectangular-prism · This document: https://tttkmbb.com/geometry/rectangular-prism.md · JSON definition: https://tttkmbb.com/geometry/rectangular-prism.json

## Purpose

Computes the volume, total surface area, space diagonal and total edge length of a rectangular prism (cuboid or box) from its length, width and height.

**Use when:** You need the capacity, surface or longest internal dimension of a box, room, aquarium, container or any cuboid.

**Do not use when:** The base is not a rectangle (use cylinder or pyramid) or you only need the floor area (use rectangle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `length` | number | units | required | Length of the base. (> 0) |
| `width` | number | units | required | Width of the base. (> 0) |
| `height` | number | units | required | Height of the prism. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | length × width × height. |
| `surface_area` | number | units² | 2 × (length×width + length×height + width×height). |
| `space_diagonal` | number | units | √(length² + width² + height²), the longest straight line inside the box. |
| `total_edge_length` | number | units | 4 × (length + width + height). |

## Formula

`volume = length · width · height; surface_area = 2 · (length·width + length·height + width·height); space_diagonal = √(length² + width² + height²); total_edge_length = 4 · (length + width + height)`

## Data Sources

- Wikipedia – Cuboid — https://en.wikipedia.org/wiki/Cuboid (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Cuboid — https://mathworld.wolfram.com/Cuboid.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/rectangular-prism?length=…&width=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/rectangular-prism` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/rectangular-prism · OpenAPI operationId `calculate_rectangular_prism_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "rectangular-prism", "inputs": {…}}`

## Example

- 3 × 4 × 12: inputs `{"length":3,"width":4,"height":12}` → `{"volume":144,"surface_area":192,"space_diagonal":13,"total_edge_length":76}`
- 2 × 3 × 4: inputs `{"length":2,"width":3,"height":4}` → `{"volume":24,"surface_area":52,"space_diagonal":5.3852,"total_edge_length":36}`

```
GET https://tttkmbb.com/api/v1/calculate/rectangular-prism?length=3&width=4&height=12
```

## Limitations

The base is not a rectangle (use cylinder or pyramid) or you only need the floor area (use rectangle). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I use it for a cube?**

Enter the same value for all three sides: volume = side³, surface area = 6 × side², space diagonal = side × √3.

**Will a rod of a given length fit in the box?**

Only if it is no longer than the space diagonal (ignoring the rod's thickness).

## Related

- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Area and diagonal of one face.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert the volume to litres, gallons or cubic feet.
- [Concrete Slab Calculator](https://tttkmbb.com/construction/concrete-slab.md) — Concrete needed for a rectangular slab of these dimensions.


---

# Square Pyramid Calculator

> Computes the volume, slant height, lateral edge, base area, lateral and total surface area and face slope in degrees of a right square pyramid from its base side and height.

- Calculator id: `pyramid` · Category: Geometry (`geometry`) · Tool name: `calculate_square_pyramid_properties`
- Canonical page: https://tttkmbb.com/geometry/pyramid · This document: https://tttkmbb.com/geometry/pyramid.md · JSON definition: https://tttkmbb.com/geometry/pyramid.json

## Purpose

Computes the volume, slant height, lateral edge, base area, lateral and total surface area and face slope in degrees of a right square pyramid from its base side and height.

**Use when:** You need the volume or surface of a pyramid with a square base and the apex above the centre of the base.

**Do not use when:** The base is a circle (use cone), a non-square rectangle or triangle, or the apex is off-centre (oblique pyramid).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base_side` | number | units | required | Length of one side of the square base. (> 0) |
| `height` | number | units | required | Perpendicular distance from the base to the apex. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | base_side² × height / 3. |
| `slant_height` | number | units | √(height² + (base_side / 2)²), height of each triangular face. |
| `lateral_edge` | number | units | √(height² + base_side² / 2), length of each edge from a base corner to the apex. |
| `base_area` | number | units² | base_side². |
| `lateral_area` | number | units² | 2 × base_side × slant_height (four triangular faces). |
| `total_surface_area` | number | units² | base_side² + 2 × base_side × slant_height. |
| `face_slope_deg` | number | degrees | Angle between a triangular face and the base = atan(height / (base_side / 2)). |

## Formula

`volume = base_side² · height / 3; slant_height = √(height² + (base_side/2)²); lateral_edge = √(height² + base_side²/2); lateral_area = 2 · base_side · slant_height; total_surface_area = base_side² + lateral_area; face_slope_deg = atan(2 · height / base_side)`

## Data Sources

- Wikipedia – Square pyramid — https://en.wikipedia.org/wiki/Square_pyramid (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Square Pyramid — https://mathworld.wolfram.com/SquarePyramid.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pyramid?base_side=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/pyramid` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pyramid · OpenAPI operationId `calculate_square_pyramid_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pyramid", "inputs": {…}}`

## Example

- Base 6, height 4: inputs `{"base_side":6,"height":4}` → `{"volume":48,"slant_height":5,"lateral_edge":5.831,"base_area":36,"lateral_area":60,"total_surface_area":96,"face_slope_deg":53.1301}`
- Great Pyramid of Giza (230.4 m base, 146.6 m original height): inputs `{"base_side":230.4,"height":146.6}` → `{"volume":2594046,"slant_height":186.4473,"lateral_area":85914.92,"face_slope_deg":51.8393}`

```
GET https://tttkmbb.com/api/v1/calculate/pyramid?base_side=6&height=4
```

## Limitations

The base is a circle (use cone), a non-square rectangle or triangle, or the apex is off-centre (oblique pyramid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Slant height or lateral edge?**

The slant height runs from the apex to the midpoint of a base side (the height of a face); the lateral edge runs from the apex to a base corner and is longer.

**What about a rectangular base?**

Volume is length × width × height / 3, but the two pairs of faces have different slant heights; this calculator only handles square bases.

## Related

- [Cone Calculator](https://tttkmbb.com/geometry/cone.md) — Circular-based counterpart with the same volume formula (base area × height / 3).
- [Rectangular Prism Calculator](https://tttkmbb.com/geometry/rectangular-prism.md) — A prism with the same base and height has three times the volume.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Slant height and lateral edge come from right triangles with the height as one leg.


---

# Descriptive Statistics Calculator

> Computes summary statistics for a list of numbers: count, sum, mean, median, mode, range, sample and population variance and standard deviation, standard error, coefficient of variation, quartiles (linear interpolation) and skewness.

- Calculator id: `descriptive-statistics` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_descriptive_statistics`
- Canonical page: https://tttkmbb.com/statistics/descriptive-statistics · This document: https://tttkmbb.com/statistics/descriptive-statistics.md · JSON definition: https://tttkmbb.com/statistics/descriptive-statistics.json

## Purpose

Computes summary statistics for a list of numbers: count, sum, mean, median, mode, range, sample and population variance and standard deviation, standard error, coefficient of variation, quartiles (linear interpolation) and skewness.

**Use when:** You have a set of numeric observations and need its central tendency, spread or quartiles, e.g. the standard deviation of a data set.

**Do not use when:** You need a single percentile or the percentile rank of one value (use percentile), a standardised score (use z-score), or statistics of two paired variables (use correlation or linear-regression).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `values` | number_list |  | required | The data set, as a list of numbers (comma-separated or JSON array). At least 2 values are needed for sample statistics. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `count` | integer |  | Number of values. |
| `sum` | number |  | Sum of all values. |
| `mean` | number |  | Arithmetic mean = sum / n. |
| `median` | number |  | Middle value of the sorted data (average of the two middle values when n is even). |
| `mode` | string |  | Most frequent value(s), comma-separated when several values tie; 'none' when no value repeats. |
| `mode_count` | integer |  | How many times the mode occurs. |
| `min` | number |  | Smallest value. |
| `max` | number |  | Largest value. |
| `range` | number |  | max − min. |
| `sample_variance` | number |  | Σ(x − mean)² / (n − 1). Use when the data are a sample of a larger population (n ≥ 2). |
| `sample_std_dev` | number |  | √sample_variance (n ≥ 2). |
| `population_variance` | number |  | Σ(x − mean)² / n. Use when the data are the entire population. |
| `population_std_dev` | number |  | √population_variance. |
| `standard_error` | number |  | s / √n (n ≥ 2). |
| `coefficient_of_variation_percent` | number | % | 100 × s / mean; only meaningful for ratio-scale data with a positive mean (omitted when the mean is 0). |
| `q1` | number |  | 25th percentile by linear interpolation (Excel PERCENTILE.INC / R type 7). |
| `q3` | number |  | 75th percentile by the same method. |
| `iqr` | number |  | Q3 − Q1. |
| `skewness` | number |  | Adjusted Fisher-Pearson sample skewness G1 (same as Excel SKEW); requires n ≥ 3 and s > 0. Positive = right tail longer. |

## Formula

`mean = Σx / n; sample_variance = Σ(x − mean)² / (n − 1); population_variance = Σ(x − mean)² / n; standard_error = s / √n; CV% = 100·s / mean; quartile at p: rank = p·(n − 1), value = x(⌊rank⌋) + (rank − ⌊rank⌋)·(x(⌊rank⌋+1) − x(⌊rank⌋)) on sorted data; skewness G1 = n / ((n − 1)(n − 2)) · Σ((x − mean) / s)³`

Quartiles use linear interpolation between order statistics (Hyndman & Fan type 7, the default in Excel PERCENTILE.INC, NumPy and R); other conventions (Tukey hinges, exclusive method) can give different Q1/Q3 for small samples. Sample statistics are omitted for n = 1.

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.1 Measures of Location — https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm (government, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.6 Measures of Scale — https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm (government, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.11 Measures of Skewness and Kurtosis — https://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/descriptive-statistics?values=…`
- `POST https://tttkmbb.com/api/v1/calculate/descriptive-statistics` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/descriptive-statistics · OpenAPI operationId `calculate_descriptive_statistics` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_descriptive_statistics` (dedicated) or `run_calculator` with `{"calculator_id": "descriptive-statistics", "inputs": {…}}`

## Example

- 2, 4, 4, 4, 5, 5, 7, 9: inputs `{"values":[2,4,4,4,5,5,7,9]}` → `{"count":8,"sum":40,"mean":5,"median":4.5,"mode":"4","mode_count":3,"min":2,"max":9,"range":7,"sample_variance":4.5714,"sample_std_dev":2.1381,"population_variance":4,"population_std_dev":2,"standard_error":0.7559,"coefficient_of_variation_percent":42.76,"q1":4,"q3":5.5,"iqr":1.5,"skewness":0.8185}`
- 4, 8, 15, 16, 23, 42: inputs `{"values":[4,8,15,16,23,42]}` → `{"count":6,"mean":18,"median":15.5,"mode":"none","sample_std_dev":13.4907,"population_std_dev":12.3153,"q1":9.75,"q3":21.25,"iqr":11.5,"skewness":1.2426}`

```
GET https://tttkmbb.com/api/v1/calculate/descriptive-statistics?values=2%2C4%2C4%2C4%2C5%2C5%2C7%2C9
```

## Limitations

You need a single percentile or the percentile rank of one value (use percentile), a standardised score (use z-score), or statistics of two paired variables (use correlation or linear-regression). Quartiles use linear interpolation between order statistics (Hyndman & Fan type 7, the default in Excel PERCENTILE.INC, NumPy and R); other conventions (Tukey hinges, exclusive method) can give different Q1/Q3 for small samples. Sample statistics are omitted for n = 1. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Sample or population standard deviation?**

Use the sample version (n − 1 denominator) when the values are a sample drawn from a larger population and you want to estimate its spread; use the population version (n denominator) when the values are the whole population of interest.

**Why do my quartiles differ from another tool?**

There are several quartile conventions. This calculator uses linear interpolation (Excel PERCENTILE.INC, R type 7); Excel QUARTILE.EXC, Minitab and the Tukey hinge method interpolate differently and can differ for small n.

**What does the coefficient of variation mean?**

It is the standard deviation as a percentage of the mean, allowing spread to be compared between data sets with different units or scales; it is not meaningful when the mean is near zero or negative.

## Related

- [Percentile Calculator](https://tttkmbb.com/statistics/percentile.md) — Find any percentile or the percentile rank of a value in the same data.
- [Z-Score Calculator](https://tttkmbb.com/statistics/z-score.md) — Standardise a single value using the mean and standard deviation.
- [Confidence Interval Calculator](https://tttkmbb.com/statistics/confidence-interval.md) — Turn the mean and standard deviation into a confidence interval for the population mean.


---

# Z-Score Calculator

> Standardises a value against a mean and standard deviation (z = (x − μ) / σ) and reports the corresponding percentile and tail probabilities under the normal distribution.

- Calculator id: `z-score` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_z_score`
- Canonical page: https://tttkmbb.com/statistics/z-score · This document: https://tttkmbb.com/statistics/z-score.md · JSON definition: https://tttkmbb.com/statistics/z-score.json

## Purpose

Standardises a value against a mean and standard deviation (z = (x − μ) / σ) and reports the corresponding percentile and tail probabilities under the normal distribution.

**Use when:** You need how many standard deviations a value lies from the mean, or the percentile a value corresponds to in a normally distributed population (test scores, measurements, quality control).

**Do not use when:** You need the probability between two values or the density (use normal-distribution), the data are clearly not normal, or you need the empirical percentile rank within an actual data set (use percentile).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | The observation to standardise. |
| `mean` | number |  | required | Mean of the population or reference distribution. |
| `std_dev` | number |  | required | Standard deviation of the population or reference distribution. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `z_score` | number |  | (value − mean) / std_dev: distance from the mean in standard deviations. |
| `percentile` | number | % | Percentage of a normal population with values below x: 100 × Φ(z). |
| `probability_below` | number |  | Standard normal CDF Φ(z). |
| `probability_above` | number |  | 1 − Φ(z). |
| `interpretation` | string |  | Plain-language position relative to the mean. |

## Formula

`z = (value − mean) / std_dev; percentile = 100 × Φ(z), where Φ is the standard normal CDF`

Φ is evaluated with the Abramowitz & Stegun 7.1.26 erf approximation (absolute error below 1.5·10⁻⁷). The percentile interpretation assumes the reference population is normally distributed.

## Data Sources

- Wikipedia – Standard score — https://en.wikipedia.org/wiki/Standard_score (reference, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.6.1 Normal Distribution — https://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/z-score?value=…&mean=…&std_dev=…`
- `POST https://tttkmbb.com/api/v1/calculate/z-score` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/z-score · OpenAPI operationId `calculate_z_score` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "z-score", "inputs": {…}}`

## Example

- x = 1.96 on the standard normal: inputs `{"value":1.96,"mean":0,"std_dev":1}` → `{"z_score":1.96,"percentile":97.5,"probability_below":0.975,"probability_above":0.025}`
- Score 85, mean 70, SD 10: inputs `{"value":85,"mean":70,"std_dev":10}` → `{"z_score":1.5,"percentile":93.32,"probability_below":0.9332,"probability_above":0.0668,"interpretation":"1.5 standard deviations above the mean"}`

```
GET https://tttkmbb.com/api/v1/calculate/z-score?value=1.96&mean=0&std_dev=1
```

## Limitations

You need the probability between two values or the density (use normal-distribution), the data are clearly not normal, or you need the empirical percentile rank within an actual data set (use percentile). Φ is evaluated with the Abramowitz & Stegun 7.1.26 erf approximation (absolute error below 1.5·10⁻⁷). The percentile interpretation assumes the reference population is normally distributed. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I use the sample or population standard deviation?**

Use the population σ when it is known (e.g. a standardised test). When only a sample is available, the sample s is the usual substitute and the percentile becomes approximate, especially for small samples.

**What is a 'significant' z-score?**

By convention |z| > 1.96 corresponds to the outer 5 % of a normal distribution (two-sided) and |z| > 2.576 to the outer 1 %; values beyond |z| = 3 are often flagged as outliers.

## Related

- [Normal Distribution Calculator](https://tttkmbb.com/statistics/normal-distribution.md) — Probabilities between two values and the density at a point.
- [Percentile Calculator](https://tttkmbb.com/statistics/percentile.md) — Empirical percentile rank within an actual list of values.
- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Compute the mean and standard deviation from data first.


---

# Normal Distribution Calculator

> Computes cumulative probabilities P(X < x), P(X > x) and P(x < X < x2) and the density for a normal (Gaussian) distribution with a given mean and standard deviation.

- Calculator id: `normal-distribution` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_normal_distribution_probability`
- Canonical page: https://tttkmbb.com/statistics/normal-distribution · This document: https://tttkmbb.com/statistics/normal-distribution.md · JSON definition: https://tttkmbb.com/statistics/normal-distribution.json

## Purpose

Computes cumulative probabilities P(X < x), P(X > x) and P(x < X < x2) and the density for a normal (Gaussian) distribution with a given mean and standard deviation.

**Use when:** You need the probability that a normally distributed quantity falls below, above or between given values, or the z-scores of those values.

**Do not use when:** The variable is a count of successes or events (use binomial-distribution or poisson-distribution), or you need the value at a given probability from real data (use percentile).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mean` | number |  | optional, default 0 | Mean of the distribution (default 0 = standard normal). |
| `std_dev` | number |  | optional, default 1 | Standard deviation of the distribution (default 1 = standard normal). (> 0) |
| `x` | number |  | required | The value at which to evaluate the distribution. |
| `x2` | number |  | optional | Optional second value; when given, the probability between x and x2 is also returned. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `z_score` | number |  | (x − mean) / std_dev. |
| `probability_below` | number |  | Cumulative probability up to x. |
| `probability_above` | number |  | Upper-tail probability beyond x. |
| `probability_density` | number |  | Value of the probability density function at x (not a probability). |
| `z_score_2` | number |  | (x2 − mean) / std_dev (only when x2 is given). |
| `probability_between` | number |  | Probability between the two values, in either order (only when x2 is given). |

## Formula

`z = (x − mean) / std_dev; P(X < x) = Φ(z); P(X > x) = 1 − Φ(z); P(x < X < x2) = |Φ(z2) − Φ(z)|; f(x) = exp(−z² / 2) / (std_dev · √(2π))`

Φ is computed from the Abramowitz & Stegun erf approximation (absolute error < 1.5·10⁻⁷); results are exact to the displayed decimals. For a continuous distribution P(X ≤ x) = P(X < x).

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.6.1 Normal Distribution — https://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm (government, retrieved 2026-09-23)
- Wikipedia – Normal distribution — https://en.wikipedia.org/wiki/Normal_distribution (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/normal-distribution?x=…`
- `POST https://tttkmbb.com/api/v1/calculate/normal-distribution` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/normal-distribution · OpenAPI operationId `calculate_normal_distribution_probability` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "normal-distribution", "inputs": {…}}`

## Example

- Standard normal, x = 1.96: inputs `{"x":1.96}` → `{"z_score":1.96,"probability_below":0.975,"probability_above":0.025,"probability_density":0.05844}`
- IQ 85 to 115 (mean 100, SD 15): inputs `{"mean":100,"std_dev":15,"x":85,"x2":115}` → `{"z_score":-1,"probability_below":0.1587,"probability_above":0.8413,"probability_density":0.01613,"z_score_2":1,"probability_between":0.6827}`

```
GET https://tttkmbb.com/api/v1/calculate/normal-distribution?x=1.96
```

## Limitations

The variable is a count of successes or events (use binomial-distribution or poisson-distribution), or you need the value at a given probability from real data (use percentile). Φ is computed from the Abramowitz & Stegun erf approximation (absolute error < 1.5·10⁻⁷); results are exact to the displayed decimals. For a continuous distribution P(X ≤ x) = P(X < x). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the 68–95–99.7 rule?**

For a normal distribution about 68.27 % of values lie within 1 SD of the mean, 95.45 % within 2 SD and 99.73 % within 3 SD; the second example (85–115 with SD 15) reproduces the 68.27 % figure.

**Why is the density larger than 1 sometimes?**

f(x) is a density, not a probability: it can exceed 1 when the standard deviation is small (below 0.399). Probabilities come from areas under the curve, i.e. the CDF outputs.

## Related

- [Z-Score Calculator](https://tttkmbb.com/statistics/z-score.md) — Standardise a single value and read its percentile.
- [Confidence Interval Calculator](https://tttkmbb.com/statistics/confidence-interval.md) — Use normal critical values to build an interval for a mean.


---

# Confidence Interval Calculator

> Computes a confidence interval for a population mean from the sample mean, standard deviation and sample size using the normal (z) critical value: mean ± z · s / √n.

- Calculator id: `confidence-interval` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_confidence_interval`
- Canonical page: https://tttkmbb.com/statistics/confidence-interval · This document: https://tttkmbb.com/statistics/confidence-interval.md · JSON definition: https://tttkmbb.com/statistics/confidence-interval.json

## Purpose

Computes a confidence interval for a population mean from the sample mean, standard deviation and sample size using the normal (z) critical value: mean ± z · s / √n.

**Use when:** You have a sample mean, its standard deviation and the sample size and want the interval that likely contains the population mean at a given confidence level.

**Do not use when:** The statistic is a proportion or survey percentage (use margin-of-error), or the sample is small (n < 30) with an unknown population SD, where a t-based interval is the correct choice and this z interval is slightly too narrow.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sample_mean` | number |  | required | Mean of the sample. |
| `std_dev` | number |  | required | Population standard deviation σ if known, otherwise the sample standard deviation s. (> 0) |
| `sample_size` | integer |  | required | Number of observations in the sample. (min 2) |
| `confidence_level_percent` | number | % | optional, default 95 | Confidence level in percent (commonly 90, 95 or 99). Determines the critical z value. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `z_value` | number |  | Two-sided standard normal critical value for the confidence level (1.6449 for 90 %, 1.96 for 95 %, 2.5758 for 99 %). |
| `standard_error` | number |  | std_dev / √sample_size. |
| `margin_of_error` | number |  | z_value × standard_error (half-width of the interval). |
| `lower_bound` | number |  | sample_mean − margin_of_error. |
| `upper_bound` | number |  | sample_mean + margin_of_error. |

## Formula

`z = Φ⁻¹(1 − (1 − confidence_level_percent/100) / 2); standard_error = std_dev / √sample_size; margin_of_error = z × standard_error; interval = sample_mean ± margin_of_error`

Uses the normal critical value, which is exact when the population σ is known and a good approximation when s is estimated from n ≥ 30 observations. For smaller samples with an estimated s, the Student t critical value with n − 1 degrees of freedom should replace z (e.g. 2.045 instead of 1.96 for n = 30 at 95 %).

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean — https://www.itl.nist.gov/div898/handbook/eda/section3/eda352.htm (government, retrieved 2026-09-23)
- Wikipedia – Confidence interval — https://en.wikipedia.org/wiki/Confidence_interval (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/confidence-interval?sample_mean=…&std_dev=…&sample_size=…`
- `POST https://tttkmbb.com/api/v1/calculate/confidence-interval` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/confidence-interval · OpenAPI operationId `calculate_confidence_interval` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "confidence-interval", "inputs": {…}}`

## Example

- Mean 100, SD 15, n = 36, 95 %: inputs `{"sample_mean":100,"std_dev":15,"sample_size":36,"confidence_level_percent":95}` → `{"z_value":1.96,"standard_error":2.5,"margin_of_error":4.9,"lower_bound":95.1,"upper_bound":104.9}`
- Mean 50, SD 8, n = 100, 99 %: inputs `{"sample_mean":50,"std_dev":8,"sample_size":100,"confidence_level_percent":99}` → `{"z_value":2.5758,"standard_error":0.8,"margin_of_error":2.0607,"lower_bound":47.9393,"upper_bound":52.0607}`

```
GET https://tttkmbb.com/api/v1/calculate/confidence-interval?sample_mean=100&std_dev=15&sample_size=36&confidence_level_percent=95
```

## Limitations

The statistic is a proportion or survey percentage (use margin-of-error), or the sample is small (n < 30) with an unknown population SD, where a t-based interval is the correct choice and this z interval is slightly too narrow. Uses the normal critical value, which is exact when the population σ is known and a good approximation when s is estimated from n ≥ 30 observations. For smaller samples with an estimated s, the Student t critical value with n − 1 degrees of freedom should replace z (e.g. 2.045 instead of 1.96 for n = 30 at 95 %). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What does a 95 % confidence interval mean?**

If the sampling were repeated many times and an interval computed each time, about 95 % of those intervals would contain the true population mean. It does not mean there is a 95 % probability that this particular interval contains it.

**When should I use t instead of z?**

When the population standard deviation is unknown and estimated from the sample, the t distribution with n − 1 degrees of freedom is the exact choice; for n ≥ 30 the difference from z is small (about 4 % wider at n = 30, under 1 % at n = 200).

## Related

- [Margin of Error Calculator](https://tttkmbb.com/statistics/margin-of-error.md) — Confidence interval for a proportion or survey percentage.
- [Sample Size Calculator](https://tttkmbb.com/statistics/sample-size.md) — How many observations are needed for a target margin of error.
- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Get the sample mean and standard deviation from raw data.


---

# Sample Size Calculator

> Computes the number of respondents needed to estimate a population proportion within a given margin of error at a given confidence level (Cochran's formula), with an optional finite population correction.

- Calculator id: `sample-size` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_sample_size`
- Canonical page: https://tttkmbb.com/statistics/sample-size · This document: https://tttkmbb.com/statistics/sample-size.md · JSON definition: https://tttkmbb.com/statistics/sample-size.json

## Purpose

Computes the number of respondents needed to estimate a population proportion within a given margin of error at a given confidence level (Cochran's formula), with an optional finite population correction.

**Use when:** You are planning a survey, poll or A/B test on a proportion and need to know how many people to sample for a target margin of error.

**Do not use when:** You already have a sample and want its margin of error (use margin-of-error), or you are estimating a mean rather than a proportion (the formula would need the standard deviation instead of p(1 − p)).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `confidence_level_percent` | number | % | optional, default 95 | Confidence level in percent (commonly 90, 95 or 99). Determines the critical z value. (> 0) |
| `margin_of_error_percent` | number | % | required | Acceptable half-width of the confidence interval, in percentage points (5 means ±5 %). (> 0, max 50) |
| `expected_proportion_percent` | number | % | optional, default 50 | Anticipated percentage with the attribute. 50 % is the conservative choice giving the largest sample. (min 1, max 99) |
| `population_size` | integer |  | optional | Optional total population size N. When given, the finite population correction is applied; omit for large or unknown populations. (min 2) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `z_value` | number |  | Two-sided normal critical value for the confidence level. |
| `sample_size` | integer |  | Minimum number of respondents, rounded up; includes the finite population correction when population_size is given. |
| `sample_size_infinite_population` | integer |  | n0 = z² p (1 − p) / e², rounded up, before any finite population correction. |

## Formula

`n0 = z² · p · (1 − p) / e², with p = expected_proportion_percent/100 and e = margin_of_error_percent/100; with population_size N: n = n0 / (1 + (n0 − 1) / N); both rounded up`

Cochran's sample-size formula for a proportion with the normal approximation. The finite population correction is applied to the unrounded n0 (as in most survey references); rounding n0 first would occasionally add one respondent.

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.4.2 Sample sizes required (proportions) — https://www.itl.nist.gov/div898/handbook/prc/section2/prc242.htm (government, retrieved 2026-09-23)
- Wikipedia – Sample size determination — https://en.wikipedia.org/wiki/Sample_size_determination (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sample-size?margin_of_error_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/sample-size` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sample-size · OpenAPI operationId `calculate_sample_size` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sample-size", "inputs": {…}}`

## Example

- 95 %, ±5 %, p = 50 %: inputs `{"confidence_level_percent":95,"margin_of_error_percent":5,"expected_proportion_percent":50}` → `{"z_value":1.96,"sample_size":385,"sample_size_infinite_population":385}`
- Same, population of 1,000: inputs `{"confidence_level_percent":95,"margin_of_error_percent":5,"expected_proportion_percent":50,"population_size":1000}` → `{"sample_size":278,"sample_size_infinite_population":385}`

```
GET https://tttkmbb.com/api/v1/calculate/sample-size?confidence_level_percent=95&margin_of_error_percent=5&expected_proportion_percent=50
```

## Limitations

You already have a sample and want its margin of error (use margin-of-error), or you are estimating a mean rather than a proportion (the formula would need the standard deviation instead of p(1 − p)). Cochran's sample-size formula for a proportion with the normal approximation. The finite population correction is applied to the unrounded n0 (as in most survey references); rounding n0 first would occasionally add one respondent. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is 385 the usual answer?**

At 95 % confidence, ±5 % margin and p = 50 %: 1.96² × 0.25 / 0.05² = 384.16, rounded up to 385. Halving the margin to ±2.5 % quadruples the sample to 1,537.

**Does the sample size depend on the population size?**

Only when the sample is a noticeable fraction of the population. For a population of 1,000 the correction reduces 385 to 278; for populations above about 100,000 it changes almost nothing.

**What about non-response?**

The result is the number of completed responses. Divide by the expected response rate to get the number of invitations (e.g. 385 / 0.2 = 1,925 for a 20 % response rate).

## Related

- [Margin of Error Calculator](https://tttkmbb.com/statistics/margin-of-error.md) — Margin of error of a sample you already have.
- [Confidence Interval Calculator](https://tttkmbb.com/statistics/confidence-interval.md) — Interval for a mean from a sample.


---

# Margin of Error Calculator

> Computes the margin of error (half-width of the confidence interval) of a sample proportion from the sample size, confidence level and observed percentage, with an optional finite population correction.

- Calculator id: `margin-of-error` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_margin_of_error`
- Canonical page: https://tttkmbb.com/statistics/margin-of-error · This document: https://tttkmbb.com/statistics/margin-of-error.md · JSON definition: https://tttkmbb.com/statistics/margin-of-error.json

## Purpose

Computes the margin of error (half-width of the confidence interval) of a sample proportion from the sample size, confidence level and observed percentage, with an optional finite population correction.

**Use when:** You have poll or survey results (n respondents, x % answering a certain way) and need the ± margin at a confidence level.

**Do not use when:** You are still planning the survey and need the required sample size (use sample-size), or the statistic is a mean rather than a percentage (use confidence-interval).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `sample_size` | integer |  | required | Number of respondents or observations. (min 1) |
| `confidence_level_percent` | number | % | optional, default 95 | Confidence level in percent (commonly 90, 95 or 99). Determines the critical z value. (> 0) |
| `proportion_percent` | number | % | optional, default 50 | Percentage of the sample with the attribute. 50 % gives the largest (most conservative) margin. (min 0, max 100) |
| `population_size` | integer |  | optional | Optional total population size N. When given, the finite population correction is applied; omit for large or unknown populations. (min 2) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `z_value` | number |  | Two-sided normal critical value for the confidence level. |
| `standard_error_percent` | number | % | 100 × √(p (1 − p) / n), after the finite population correction if applied. |
| `margin_of_error_percent` | number | % | z_value × standard error, in percentage points. |
| `lower_bound_percent` | number | % | proportion − margin (not truncated at 0). |
| `upper_bound_percent` | number | % | proportion + margin (not truncated at 100). |

## Formula

`margin = z · √(p (1 − p) / sample_size) × 100, with p = proportion_percent/100; with population_size N the margin is multiplied by √((N − sample_size) / (N − 1))`

Normal (Wald) approximation to the binomial, standard in survey reporting; it is inaccurate when n·p or n·(1 − p) is below about 10 (very small samples or extreme percentages), where a Wilson interval should be used.

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.4.1 Confidence intervals for a proportion — https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm (government, retrieved 2026-09-23)
- Wikipedia – Margin of error — https://en.wikipedia.org/wiki/Margin_of_error (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/margin-of-error?sample_size=…`
- `POST https://tttkmbb.com/api/v1/calculate/margin-of-error` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/margin-of-error · OpenAPI operationId `calculate_margin_of_error` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "margin-of-error", "inputs": {…}}`

## Example

- n = 1,000, 95 %, 50 %: inputs `{"sample_size":1000,"confidence_level_percent":95,"proportion_percent":50}` → `{"z_value":1.96,"standard_error_percent":1.5811,"margin_of_error_percent":3.1,"lower_bound_percent":46.9,"upper_bound_percent":53.1}`
- n = 400, 99 %, 30 %: inputs `{"sample_size":400,"confidence_level_percent":99,"proportion_percent":30}` → `{"z_value":2.5758,"standard_error_percent":2.2913,"margin_of_error_percent":5.9,"lower_bound_percent":24.1,"upper_bound_percent":35.9}`

```
GET https://tttkmbb.com/api/v1/calculate/margin-of-error?sample_size=1000&confidence_level_percent=95&proportion_percent=50
```

## Limitations

You are still planning the survey and need the required sample size (use sample-size), or the statistic is a mean rather than a percentage (use confidence-interval). Normal (Wald) approximation to the binomial, standard in survey reporting; it is inaccurate when n·p or n·(1 − p) is below about 10 (very small samples or extreme percentages), where a Wilson interval should be used. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why do polls report ±3 %?**

A sample of about 1,000 at 95 % confidence and p = 50 % gives 1.96 × √(0.25 / 1000) = 3.1 percentage points; the same sample gives a smaller margin for percentages far from 50 %.

**Is the margin in percent or percentage points?**

Percentage points: a result of 40 % with a ±3 % margin means 37 % to 43 %.

## Related

- [Sample Size Calculator](https://tttkmbb.com/statistics/sample-size.md) — Plan the sample size for a target margin.
- [Confidence Interval Calculator](https://tttkmbb.com/statistics/confidence-interval.md) — Interval for a sample mean instead of a proportion.


---

# Binomial Distribution Calculator

> Computes the probability of exactly, at most, at least, fewer than or more than k successes in n independent trials with success probability p, plus the mean, variance and standard deviation of the distribution.

- Calculator id: `binomial-distribution` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_binomial_probability`
- Canonical page: https://tttkmbb.com/statistics/binomial-distribution · This document: https://tttkmbb.com/statistics/binomial-distribution.md · JSON definition: https://tttkmbb.com/statistics/binomial-distribution.json

## Purpose

Computes the probability of exactly, at most, at least, fewer than or more than k successes in n independent trials with success probability p, plus the mean, variance and standard deviation of the distribution.

**Use when:** You have a fixed number of independent yes/no trials with a constant success probability (coin flips, defect counts in a batch, conversions among n visitors) and need the probability of a number of successes.

**Do not use when:** Trials are not independent or p changes, the number of trials is not fixed, or you count events over time or space at an average rate (use poisson-distribution).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `trials` | integer |  | required | Total number of independent trials. (min 1, max 100000) |
| `successes` | integer |  | required | Number of successes of interest (0 ≤ k ≤ n). (min 0, max 100000) |
| `probability_of_success` | number |  | required | Probability of success on a single trial, as a number between 0 and 1 (0.5 for 50 %), not a percentage. (min 0, max 1) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `probability_exact` | number |  | Probability of exactly k successes. |
| `probability_at_most` | number |  | Cumulative probability of k or fewer successes. |
| `probability_at_least` | number |  | Probability of k or more successes. |
| `probability_less_than` | number |  | Probability of fewer than k successes. |
| `probability_more_than` | number |  | Probability of more than k successes. |
| `mean` | number |  | Expected number of successes n·p. |
| `variance` | number |  | n·p·(1 − p). |
| `std_dev` | number |  | √(n·p·(1 − p)). |

## Formula

`P(X = k) = C(n, k) · p^k · (1 − p)^(n − k); P(X ≤ k) = Σ_{i=0..k} P(X = i); P(X ≥ k) = Σ_{i=k..n} P(X = i); mean = n·p; variance = n·p·(1 − p)`

Probabilities are computed term by term in log space, so large n does not overflow the binomial coefficient. Results are exact (no normal approximation).

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.6.18 Binomial Distribution — https://www.itl.nist.gov/div898/handbook/eda/section3/eda366i.htm (government, retrieved 2026-09-23)
- Wikipedia – Binomial distribution — https://en.wikipedia.org/wiki/Binomial_distribution (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/binomial-distribution?trials=…&successes=…&probability_of_success=…`
- `POST https://tttkmbb.com/api/v1/calculate/binomial-distribution` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/binomial-distribution · OpenAPI operationId `calculate_binomial_probability` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "binomial-distribution", "inputs": {…}}`

## Example

- 3 heads in 10 fair coin flips: inputs `{"trials":10,"successes":3,"probability_of_success":0.5}` → `{"probability_exact":0.117188,"probability_at_most":0.171875,"probability_at_least":0.945313,"probability_less_than":0.054688,"probability_more_than":0.828125,"mean":5,"variance":2.5,"std_dev":1.5811}`
- 2 defects in 20 items at 10 %: inputs `{"trials":20,"successes":2,"probability_of_success":0.1}` → `{"probability_exact":0.28518,"probability_at_most":0.676927,"probability_at_least":0.608253,"mean":2,"variance":1.8,"std_dev":1.3416}`

```
GET https://tttkmbb.com/api/v1/calculate/binomial-distribution?trials=10&successes=3&probability_of_success=0.5
```

## Limitations

Trials are not independent or p changes, the number of trials is not fixed, or you count events over time or space at an average rate (use poisson-distribution). Probabilities are computed term by term in log space, so large n does not overflow the binomial coefficient. Results are exact (no normal approximation). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is p a percentage?**

No. Enter the single-trial success probability as a fraction between 0 and 1: 0.25 for 25 %.

**When can the normal approximation be used instead?**

When n·p ≥ 10 and n·(1 − p) ≥ 10 the binomial is close to a normal with mean n·p and SD √(n·p·(1 − p)); this calculator does not need the approximation because it computes the exact sum.

## Related

- [Poisson Distribution Calculator](https://tttkmbb.com/statistics/poisson-distribution.md) — Counts of rare events at an average rate (limit of the binomial for large n, small p).
- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Combine the probabilities of two events.
- [Combinations and Permutations Calculator](https://tttkmbb.com/math/combinations-permutations.md) — The binomial coefficient C(n, k) used in the formula.


---

# Poisson Distribution Calculator

> Computes the probability of exactly, at most, at least, fewer than or more than k events when events occur independently at a constant average rate λ per interval, plus the mean, variance and standard deviation.

- Calculator id: `poisson-distribution` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_poisson_probability`
- Canonical page: https://tttkmbb.com/statistics/poisson-distribution · This document: https://tttkmbb.com/statistics/poisson-distribution.md · JSON definition: https://tttkmbb.com/statistics/poisson-distribution.json

## Purpose

Computes the probability of exactly, at most, at least, fewer than or more than k events when events occur independently at a constant average rate λ per interval, plus the mean, variance and standard deviation.

**Use when:** You count independent events over a fixed interval of time or space with a known average rate (calls per hour, defects per metre, arrivals per minute) and need the probability of a given count.

**Do not use when:** The number of trials is fixed and each has a success probability (use binomial-distribution), the rate varies over the interval, or events cluster (over-dispersion).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `lambda` | number |  | required | Expected number of events in the interval (mean of the distribution). (> 0, max 10000) |
| `events` | integer |  | required | Number of events of interest. (min 0, max 100000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `probability_exact` | number |  | Probability of exactly k events. |
| `probability_at_most` | number |  | Cumulative probability of k or fewer events. |
| `probability_at_least` | number |  | Probability of k or more events = 1 − P(X ≤ k − 1). |
| `probability_less_than` | number |  | Probability of fewer than k events. |
| `probability_more_than` | number |  | Probability of more than k events = 1 − P(X ≤ k). |
| `mean` | number |  | λ. |
| `variance` | number |  | λ (equal to the mean for a Poisson distribution). |
| `std_dev` | number |  | √λ. |

## Formula

`P(X = k) = e^(−λ) · λ^k / k!; P(X ≤ k) = Σ_{i=0..k} P(X = i); P(X ≥ k) = 1 − P(X ≤ k − 1); mean = variance = λ`

Terms are evaluated in log space (log k! accumulated incrementally), so large λ and k do not overflow. Scale λ to the interval you are asking about: 2 calls per minute is λ = 10 for a 5-minute window.

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.6.19 Poisson Distribution — https://www.itl.nist.gov/div898/handbook/eda/section3/eda366j.htm (government, retrieved 2026-09-23)
- Wikipedia – Poisson distribution — https://en.wikipedia.org/wiki/Poisson_distribution (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/poisson-distribution?lambda=…&events=…`
- `POST https://tttkmbb.com/api/v1/calculate/poisson-distribution` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/poisson-distribution · OpenAPI operationId `calculate_poisson_probability` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "poisson-distribution", "inputs": {…}}`

## Example

- λ = 3, k = 2: inputs `{"lambda":3,"events":2}` → `{"probability_exact":0.224042,"probability_at_most":0.42319,"probability_at_least":0.800852,"probability_less_than":0.199148,"probability_more_than":0.57681,"mean":3,"variance":3,"std_dev":1.7321}`
- λ = 5, no events: inputs `{"lambda":5,"events":0}` → `{"probability_exact":0.006738,"probability_at_most":0.006738,"probability_at_least":1,"probability_more_than":0.993262,"std_dev":2.2361}`

```
GET https://tttkmbb.com/api/v1/calculate/poisson-distribution?lambda=3&events=2
```

## Limitations

The number of trials is fixed and each has a success probability (use binomial-distribution), the rate varies over the interval, or events cluster (over-dispersion). Terms are evaluated in log space (log k! accumulated incrementally), so large λ and k do not overflow. Scale λ to the interval you are asking about: 2 calls per minute is λ = 10 for a 5-minute window. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I get λ from a rate?**

Multiply the rate by the length of the interval in the same units: 4 customers per hour over 15 minutes gives λ = 1.

**When does Poisson approximate the binomial?**

For many trials with a small success probability (n ≥ 20, p ≤ 0.05, or more loosely n·p < 10) the binomial(n, p) is close to Poisson(λ = n·p).

## Related

- [Binomial Distribution Calculator](https://tttkmbb.com/statistics/binomial-distribution.md) — Exact probabilities for a fixed number of trials.
- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Combine probabilities of two events.


---

# Probability of Two Events Calculator

> Combines the probabilities of two events A and B that are either independent or mutually exclusive into the probabilities of both, at least one, exactly one, one but not the other, and neither occurring.

- Calculator id: `probability-of-events` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_event_probabilities`
- Canonical page: https://tttkmbb.com/statistics/probability-of-events · This document: https://tttkmbb.com/statistics/probability-of-events.md · JSON definition: https://tttkmbb.com/statistics/probability-of-events.json

## Purpose

Combines the probabilities of two events A and B that are either independent or mutually exclusive into the probabilities of both, at least one, exactly one, one but not the other, and neither occurring.

**Use when:** You know P(A) and P(B) and how the events relate (independent or mutually exclusive) and need P(A and B), P(A or B), P(neither) or P(exactly one).

**Do not use when:** The events are dependent with a known conditional probability (apply P(A and B) = P(A)·P(B|A) directly), you need the probability of k successes in repeated trials (use binomial-distribution), or you need an expected payoff (use expected-value).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `probability_a` | number |  | required | Probability of event A, as a number between 0 and 1 (0.25 for 25 %). (min 0, max 1) |
| `probability_b` | number |  | required | Probability of event B, between 0 and 1. (min 0, max 1) |
| `relationship` | enum: independent \| mutually_exclusive |  | optional, default "independent" | How A and B relate: independent events multiply (P(A and B) = P(A)·P(B)); mutually exclusive events cannot occur together (P(A and B) = 0). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `probability_a_and_b` | number |  | Both events occur. |
| `probability_a_or_b` | number |  | At least one of the events occurs. |
| `probability_a_not_b` | number |  | A occurs but B does not. |
| `probability_b_not_a` | number |  | B occurs but A does not. |
| `probability_exactly_one` | number |  | Exactly one of the two events occurs. |
| `probability_neither` | number |  | Neither event occurs = 1 − P(A or B). |

## Formula

`Independent: P(A and B) = P(A)·P(B). Mutually exclusive: P(A and B) = 0. Then P(A or B) = P(A) + P(B) − P(A and B); P(A not B) = P(A) − P(A and B); P(exactly one) = P(A) + P(B) − 2·P(A and B); P(neither) = 1 − P(A or B)`

The identities follow from the addition rule of probability; independence is an assumption about the events, not something the calculator can check. Mutually exclusive events require P(A) + P(B) ≤ 1.

## Data Sources

- Wikipedia – Independence (probability theory) — https://en.wikipedia.org/wiki/Independence_(probability_theory) (reference, retrieved 2026-09-23)
- Wikipedia – Mutual exclusivity — https://en.wikipedia.org/wiki/Mutual_exclusivity (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/probability-of-events?probability_a=…&probability_b=…`
- `POST https://tttkmbb.com/api/v1/calculate/probability-of-events` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/probability-of-events · OpenAPI operationId `calculate_event_probabilities` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "probability-of-events", "inputs": {…}}`

## Example

- Two independent coin flips (heads): inputs `{"probability_a":0.5,"probability_b":0.5,"relationship":"independent"}` → `{"probability_a_and_b":0.25,"probability_a_or_b":0.75,"probability_a_not_b":0.25,"probability_b_not_a":0.25,"probability_exactly_one":0.5,"probability_neither":0.25}`
- Mutually exclusive 0.2 and 0.3: inputs `{"probability_a":0.2,"probability_b":0.3,"relationship":"mutually_exclusive"}` → `{"probability_a_and_b":0,"probability_a_or_b":0.5,"probability_a_not_b":0.2,"probability_exactly_one":0.5,"probability_neither":0.5}`

```
GET https://tttkmbb.com/api/v1/calculate/probability-of-events?probability_a=0.5&probability_b=0.5&relationship=independent
```

## Limitations

The events are dependent with a known conditional probability (apply P(A and B) = P(A)·P(B|A) directly), you need the probability of k successes in repeated trials (use binomial-distribution), or you need an expected payoff (use expected-value). The identities follow from the addition rule of probability; independence is an assumption about the events, not something the calculator can check. Mutually exclusive events require P(A) + P(B) ≤ 1. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the difference between independent and mutually exclusive?**

Independent events do not influence each other (rolling a die twice); mutually exclusive events cannot happen together (rolling a 1 and rolling a 6 on the same roll). Two events with non-zero probability cannot be both.

**Can I enter percentages?**

No, enter fractions between 0 and 1: 0.3 for 30 %. The outputs are fractions as well.

## Related

- [Binomial Distribution Calculator](https://tttkmbb.com/statistics/binomial-distribution.md) — Probability of k successes in repeated independent trials.
- [Expected Value Calculator](https://tttkmbb.com/statistics/expected-value.md) — Average outcome of a probabilistic payoff.


---

# Correlation Coefficient Calculator

> Computes the Pearson product-moment correlation coefficient r, the coefficient of determination r², and the sample covariance for two paired lists of numbers, with a strength/direction interpretation.

- Calculator id: `correlation` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_correlation`
- Canonical page: https://tttkmbb.com/statistics/correlation · This document: https://tttkmbb.com/statistics/correlation.md · JSON definition: https://tttkmbb.com/statistics/correlation.json

## Purpose

Computes the Pearson product-moment correlation coefficient r, the coefficient of determination r², and the sample covariance for two paired lists of numbers, with a strength/direction interpretation.

**Use when:** You have paired measurements of two numeric variables and want to quantify the strength and direction of their linear relationship.

**Do not use when:** You need the fitted line or predictions (use linear-regression), the relationship is clearly non-linear or the data are ranks/ordinal (Spearman's rank correlation is more appropriate), or you only have one variable (use descriptive-statistics).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `x_values` | number_list |  | required | Independent (explanatory) variable, one number per observation. |
| `y_values` | number_list |  | required | Dependent (response) variable, in the same order as x_values. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `sample_size` | integer |  | Number of (x, y) pairs. |
| `pearson_r` | number |  | Linear correlation coefficient between −1 and 1. |
| `r_squared` | number |  | Coefficient of determination: fraction of the variance in y explained by a linear relationship with x. |
| `covariance` | number |  | Σ(x − x̄)(y − ȳ) / (n − 1). |
| `interpretation` | string |  | Strength (very weak < 0.2, weak < 0.4, moderate < 0.6, strong < 0.8, very strong ≥ 0.8 in \|r\|) and direction. |

## Formula

`r = Σ(x − x̄)(y − ȳ) / √(Σ(x − x̄)² · Σ(y − ȳ)²); r² = r × r; covariance = Σ(x − x̄)(y − ȳ) / (n − 1)`

Pearson's r measures linear association only; the strength bands follow the common convention (Evans 1996) and are a rough guide, not a significance test. r is undefined when either variable is constant.

## Data Sources

- Wikipedia – Pearson correlation coefficient — https://en.wikipedia.org/wiki/Pearson_correlation_coefficient (reference, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 4.1.4.1 Linear Least Squares Regression — https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd141.htm (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/correlation?x_values=…&y_values=…`
- `POST https://tttkmbb.com/api/v1/calculate/correlation` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/correlation · OpenAPI operationId `calculate_correlation` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "correlation", "inputs": {…}}`

## Example

- x = 1..5, y = 2, 4, 5, 4, 5: inputs `{"x_values":[1,2,3,4,5],"y_values":[2,4,5,4,5]}` → `{"sample_size":5,"pearson_r":0.7746,"r_squared":0.6,"covariance":1.5,"interpretation":"Strong positive linear correlation"}`
- Perfect negative relationship: inputs `{"x_values":[1,2,3,4],"y_values":[10,8,6,4]}` → `{"pearson_r":-1,"r_squared":1,"covariance":-3.3333,"interpretation":"Perfect negative linear correlation"}`

```
GET https://tttkmbb.com/api/v1/calculate/correlation?x_values=1%2C2%2C3%2C4%2C5&y_values=2%2C4%2C5%2C4%2C5
```

## Limitations

You need the fitted line or predictions (use linear-regression), the relationship is clearly non-linear or the data are ranks/ordinal (Spearman's rank correlation is more appropriate), or you only have one variable (use descriptive-statistics). Pearson's r measures linear association only; the strength bands follow the common convention (Evans 1996) and are a rough guide, not a significance test. r is undefined when either variable is constant. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does correlation imply causation?**

No. A high |r| shows that the variables move together linearly; it says nothing about which causes which or whether a third variable drives both.

**Is a given r statistically significant?**

That depends on n: the test statistic t = r·√((n − 2) / (1 − r²)) is compared with a t distribution with n − 2 degrees of freedom. For n = 5, |r| must exceed about 0.88 to be significant at the 5 % level.

## Related

- [Linear Regression Calculator](https://tttkmbb.com/statistics/linear-regression.md) — Fit the least-squares line and predict y from x.
- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Summary statistics of a single variable.


---

# Linear Regression Calculator

> Fits an ordinary least-squares line to paired (x, y) data and returns the slope, intercept, equation, Pearson r, R², the standard error of the estimate and an optional prediction for a new x.

- Calculator id: `linear-regression` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_linear_regression`
- Canonical page: https://tttkmbb.com/statistics/linear-regression · This document: https://tttkmbb.com/statistics/linear-regression.md · JSON definition: https://tttkmbb.com/statistics/linear-regression.json

## Purpose

Fits an ordinary least-squares line to paired (x, y) data and returns the slope, intercept, equation, Pearson r, R², the standard error of the estimate and an optional prediction for a new x.

**Use when:** You want the best-fit straight line through paired data, its equation, or a predicted y for a given x (trend lines, calibration curves, simple forecasting).

**Do not use when:** The relationship is curved or has several predictors (needs polynomial or multiple regression), or you only need the strength of association (use correlation).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `x_values` | number_list |  | required | Independent (explanatory) variable, one number per observation. |
| `y_values` | number_list |  | required | Dependent (response) variable, in the same order as x_values. |
| `x_new` | number |  | optional | Optional x value at which to evaluate the fitted line. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `slope` | number |  | Change in y per unit change in x. |
| `intercept` | number |  | Fitted y at x = 0. |
| `equation` | string |  | Fitted line as y = bx + a with coefficients rounded to 4 decimals. |
| `pearson_r` | number |  | Correlation coefficient of x and y (omitted when y is constant). |
| `r_squared` | number |  | Fraction of the variance in y explained by the line (omitted when y is constant). |
| `standard_error_of_estimate` | number |  | √(Σ(y − ŷ)² / (n − 2)): typical vertical distance of the points from the line (needs n ≥ 3). |
| `sample_size` | integer |  | Number of (x, y) pairs used. |
| `predicted_y` | number |  | intercept + slope × x_new (only when x_new is given). |

## Formula

`slope = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)²; intercept = ȳ − slope · x̄; r = Σ(x − x̄)(y − ȳ) / √(Σ(x − x̄)² Σ(y − ȳ)²); ŷ(x_new) = intercept + slope · x_new`

Ordinary least squares minimises the sum of squared vertical residuals; it assumes x is measured without error and residuals have constant variance. Predictions outside the observed x range are extrapolations.

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 4.1.4.1 Linear Least Squares Regression — https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd141.htm (government, retrieved 2026-09-23)
- Wikipedia – Simple linear regression — https://en.wikipedia.org/wiki/Simple_linear_regression (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/linear-regression?x_values=…&y_values=…`
- `POST https://tttkmbb.com/api/v1/calculate/linear-regression` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/linear-regression · OpenAPI operationId `calculate_linear_regression` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "linear-regression", "inputs": {…}}`

## Example

- x = 1..5, y = 2, 4, 5, 4, 5, predict x = 6: inputs `{"x_values":[1,2,3,4,5],"y_values":[2,4,5,4,5],"x_new":6}` → `{"slope":0.6,"intercept":2.2,"equation":"y = 0.6x + 2.2","pearson_r":0.7746,"r_squared":0.6,"standard_error_of_estimate":0.8944,"sample_size":5,"predicted_y":5.8}`
- Exact line y = 2x + 1: inputs `{"x_values":[0,1,2,3],"y_values":[1,3,5,7]}` → `{"slope":2,"intercept":1,"equation":"y = 2x + 1","pearson_r":1,"r_squared":1,"standard_error_of_estimate":0}`

```
GET https://tttkmbb.com/api/v1/calculate/linear-regression?x_values=1%2C2%2C3%2C4%2C5&y_values=2%2C4%2C5%2C4%2C5&x_new=6
```

## Limitations

The relationship is curved or has several predictors (needs polynomial or multiple regression), or you only need the strength of association (use correlation). Ordinary least squares minimises the sum of squared vertical residuals; it assumes x is measured without error and residuals have constant variance. Predictions outside the observed x range are extrapolations. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How good is the fit?**

R² near 1 means the line explains most of the variation in y; the standard error of the estimate gives the typical residual in y units. Always inspect the residuals for curvature or outliers as well.

**Which variable goes on x?**

x is the predictor (the variable you control or know first) and y the response; swapping them gives a different line because least squares minimises vertical distances only.

## Related

- [Correlation Coefficient Calculator](https://tttkmbb.com/statistics/correlation.md) — Only the strength of the linear association.
- [Slope Calculator](https://tttkmbb.com/math/slope.md) — Slope of a line through two known points.


---

# Weighted Average Calculator

> Computes the weighted arithmetic mean Σ(w·x) / Σw of a list of values and a matching list of weights, along with the total weight and the unweighted mean for comparison.

- Calculator id: `weighted-average` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_weighted_average`
- Canonical page: https://tttkmbb.com/statistics/weighted-average · This document: https://tttkmbb.com/statistics/weighted-average.md · JSON definition: https://tttkmbb.com/statistics/weighted-average.json

## Purpose

Computes the weighted arithmetic mean Σ(w·x) / Σw of a list of values and a matching list of weights, along with the total weight and the unweighted mean for comparison.

**Use when:** Values contribute unequally to an average: course grades with credit weights, portfolio returns by allocation, survey answers with sampling weights, average price over different quantities.

**Do not use when:** All items count equally (use descriptive-statistics for the plain mean), or the weights are probabilities of outcomes (use expected-value, which also gives the variance).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `values` | number_list |  | required | The values to average. |
| `weights` | number_list |  | required | Non-negative weight for each value, in the same order (percentages, credits, quantities); they need not sum to 1. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `weighted_average` | number |  | Σ(values × weights) / Σweights. |
| `total_weight` | number |  | Sum of the weights. |
| `weighted_sum` | number |  | Σ(values × weights) before dividing by the total weight. |
| `simple_average` | number |  | Plain arithmetic mean of the values, for comparison. |
| `count` | integer |  | Number of value/weight pairs. |

## Formula

`weighted_average = Σ(values_i × weights_i) / Σ weights_i`

## Data Sources

- Wikipedia – Weighted arithmetic mean — https://en.wikipedia.org/wiki/Weighted_arithmetic_mean (reference, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.1 Measures of Location — https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/weighted-average?values=…&weights=…`
- `POST https://tttkmbb.com/api/v1/calculate/weighted-average` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/weighted-average · OpenAPI operationId `calculate_weighted_average` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "weighted-average", "inputs": {…}}`

## Example

- Grades 90, 80, 70 weighted 50/30/20 %: inputs `{"values":[90,80,70],"weights":[0.5,0.3,0.2]}` → `{"weighted_average":83,"total_weight":1,"weighted_sum":83,"simple_average":80,"count":3}`
- 4, 8, 15 with weights 2, 1, 1: inputs `{"values":[4,8,15],"weights":[2,1,1]}` → `{"weighted_average":7.75,"total_weight":4,"weighted_sum":31,"simple_average":9}`

```
GET https://tttkmbb.com/api/v1/calculate/weighted-average?values=90%2C80%2C70&weights=0.5%2C0.3%2C0.2
```

## Limitations

All items count equally (use descriptive-statistics for the plain mean), or the weights are probabilities of outcomes (use expected-value, which also gives the variance). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do the weights have to add up to 1 or 100?**

No. The result is divided by the total weight, so 50/30/20, 5/3/2 and 0.5/0.3/0.2 all give the same average.

**What if a weight is zero?**

That value is ignored. At least one weight must be positive; negative weights are rejected.

## Related

- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Unweighted mean, median and spread of a list.
- [Expected Value Calculator](https://tttkmbb.com/statistics/expected-value.md) — Probability-weighted mean and variance of outcomes.
- [GPA Calculator](https://tttkmbb.com/everyday/gpa.md) — Credit-weighted grade point average.


---

# Percentile Calculator

> For a list of numbers, computes the value at a given percentile (linear interpolation, as in Excel PERCENTILE.INC) and/or the percentile rank of a given value (percentage of values below it, counting ties as half).

- Calculator id: `percentile` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_percentile`
- Canonical page: https://tttkmbb.com/statistics/percentile · This document: https://tttkmbb.com/statistics/percentile.md · JSON definition: https://tttkmbb.com/statistics/percentile.json

## Purpose

For a list of numbers, computes the value at a given percentile (linear interpolation, as in Excel PERCENTILE.INC) and/or the percentile rank of a given value (percentage of values below it, counting ties as half).

**Use when:** You need the k-th percentile of a data set (e.g. the 90th percentile response time) or want to know what percentile a particular value falls at within the data.

**Do not use when:** You want a percentile from a normal distribution rather than actual data (use z-score or normal-distribution), or you need quartiles together with other summary statistics (use descriptive-statistics).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `values` | number_list |  | required | The data set (order does not matter). |
| `percentile` | number | % | optional | Percentile between 0 and 100 whose value you want (e.g. 90 for the 90th percentile). Give this, value, or both. (min 0, max 100) |
| `value` | number |  | optional | A value whose percentile rank within the data you want. Give this, percentile, or both. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `value_at_percentile` | number |  | Data value at the requested percentile by linear interpolation between sorted values (only when percentile is given). |
| `percentile_rank` | number | % | 100 × (count below + 0.5 × count equal) / n (only when value is given). |
| `count_below` | integer |  | Number of data values strictly less than value. |
| `count_equal` | integer |  | Number of data values equal to value. |
| `count` | integer |  | Size of the data set. |

## Formula

`value at percentile p: rank = p/100 · (n − 1) on the sorted data, value = x(⌊rank⌋) + (rank − ⌊rank⌋) · (x(⌊rank⌋+1) − x(⌊rank⌋)); percentile rank of v = 100 · (count(x < v) + 0.5 · count(x = v)) / n`

The value-at-percentile method is Hyndman & Fan type 7 (Excel PERCENTILE.INC, R and NumPy default); the 'exclusive' method and nearest-rank method give different results for small n. Percentile rank uses the definition with ties counted as half.

## Data Sources

- Wikipedia – Percentile — https://en.wikipedia.org/wiki/Percentile (reference, retrieved 2026-09-23)
- Wikipedia – Percentile rank — https://en.wikipedia.org/wiki/Percentile_rank (reference, retrieved 2026-09-23)
- Microsoft Support – PERCENTILE.INC function — https://support.microsoft.com/en-us/office/percentile-inc-function-680f9539-45eb-410b-9a5e-c1355e5fe2ed (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/percentile?values=…`
- `POST https://tttkmbb.com/api/v1/calculate/percentile` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/percentile · OpenAPI operationId `calculate_percentile` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "percentile", "inputs": {…}}`

## Example

- 40th percentile of 15, 20, 35, 40, 50: inputs `{"values":[15,20,35,40,50],"percentile":40}` → `{"value_at_percentile":29,"count":5}`
- Rank of 5 and 90th percentile in 2, 4, 4, 4, 5, 5, 7, 9: inputs `{"values":[2,4,4,4,5,5,7,9],"value":5,"percentile":90}` → `{"percentile_rank":62.5,"count_below":4,"count_equal":2,"value_at_percentile":7.6,"count":8}`

```
GET https://tttkmbb.com/api/v1/calculate/percentile?values=15%2C20%2C35%2C40%2C50&percentile=40
```

## Limitations

You want a percentile from a normal distribution rather than actual data (use z-score or normal-distribution), or you need quartiles together with other summary statistics (use descriptive-statistics). The value-at-percentile method is Hyndman & Fan type 7 (Excel PERCENTILE.INC, R and NumPy default); the 'exclusive' method and nearest-rank method give different results for small n. Percentile rank uses the definition with ties counted as half. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why does Excel give a different number?**

PERCENTILE.INC matches this calculator; PERCENTILE.EXC uses rank = p·(n + 1) and is undefined near the ends. Some textbooks use the nearest-rank method, which always returns an actual data value.

**How are ties handled in the percentile rank?**

Values equal to the query count as half below and half above, so the rank of the median of a symmetric data set is 50 %. A value below the minimum has rank 0 and above the maximum rank 100.

## Related

- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Quartiles, median and spread of the same data.
- [Z-Score Calculator](https://tttkmbb.com/statistics/z-score.md) — Percentile under a normal distribution from mean and SD.


---

# Expected Value Calculator

> Computes the expected value E[X] = Σ x·p(x), the variance and the standard deviation of a discrete random variable from its list of outcomes and their probabilities.

- Calculator id: `expected-value` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_expected_value`
- Canonical page: https://tttkmbb.com/statistics/expected-value · This document: https://tttkmbb.com/statistics/expected-value.md · JSON definition: https://tttkmbb.com/statistics/expected-value.json

## Purpose

Computes the expected value E[X] = Σ x·p(x), the variance and the standard deviation of a discrete random variable from its list of outcomes and their probabilities.

**Use when:** You have a set of possible outcomes (payoffs, scores, counts) with known probabilities and need the long-run average and its spread: bets, lotteries, insurance, decision analysis.

**Do not use when:** The probabilities are unknown and you have observed data instead (use descriptive-statistics), or the weights are not probabilities (use weighted-average).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `values` | number_list |  | required | Numeric value of each possible outcome (negative for losses). |
| `probabilities` | number_list |  | required | Probability of each outcome as a fraction between 0 and 1, in the same order as values; they must sum to 1 (within 0.001). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `expected_value` | number |  | Σ values × probabilities: the long-run average outcome. |
| `variance` | number |  | Σ probabilities × (values − E[X])². |
| `std_dev` | number |  | √variance. |
| `count` | integer |  | Number of outcome/probability pairs. |

## Formula

`E[X] = Σ values_i × probabilities_i; variance = Σ probabilities_i × (values_i − E[X])²; std_dev = √variance`

Probabilities are checked to sum to 1 within 0.001 (to tolerate rounded inputs such as 0.1667) and rescaled to sum exactly to 1 before computing; a note is added when rescaling changed them by more than 10⁻⁶.

## Data Sources

- Wikipedia – Expected value — https://en.wikipedia.org/wiki/Expected_value (reference, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.1 Measures of Location — https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/expected-value?values=…&probabilities=…`
- `POST https://tttkmbb.com/api/v1/calculate/expected-value` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/expected-value · OpenAPI operationId `calculate_expected_value` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "expected-value", "inputs": {…}}`

## Example

- Payouts 0, 10, 100 with probabilities 0.7, 0.25, 0.05: inputs `{"values":[0,10,100],"probabilities":[0.7,0.25,0.05]}` → `{"expected_value":7.5,"variance":468.75,"std_dev":21.6506,"count":3}`
- Fair six-sided die: inputs `{"values":[1,2,3,4,5,6],"probabilities":[0.1666667,0.1666667,0.1666667,0.1666667,0.1666667,0.1666667]}` → `{"expected_value":3.5,"variance":2.9167,"std_dev":1.7078}`

```
GET https://tttkmbb.com/api/v1/calculate/expected-value?values=0%2C10%2C100&probabilities=0.7%2C0.25%2C0.05
```

## Limitations

The probabilities are unknown and you have observed data instead (use descriptive-statistics), or the weights are not probabilities (use weighted-average). Probabilities are checked to sum to 1 within 0.001 (to tolerate rounded inputs such as 0.1667) and rescaled to sum exactly to 1 before computing; a note is added when rescaling changed them by more than 10⁻⁶. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What does a negative expected value mean?**

On average you lose that amount per play; for a lottery ticket or casino bet the expected value is negative because the house keeps a margin. It says nothing about any single outcome.

**Can I enter percentages?**

No, probabilities are fractions: 0.25 for 25 %. Values can be any numbers, including negative amounts for losses.

## Related

- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Combine probabilities of events before computing payoffs.
- [Weighted Average Calculator](https://tttkmbb.com/statistics/weighted-average.md) — Weighted mean when the weights are not probabilities.
- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Mean and variance of observed data instead of a known distribution.


---

# Length Converter

> Converts a length or distance between metric (nm to km), imperial/US (in, ft, yd, mi), nautical and astronomical units using exact NIST factors (1 in = 0.0254 m, 1 mi = 1609.344 m).

- Calculator id: `length` · Category: Unit Conversion (`conversion`) · Tool name: `convert_length`
- Canonical page: https://tttkmbb.com/conversion/length · This document: https://tttkmbb.com/conversion/length.md · JSON definition: https://tttkmbb.com/conversion/length.json

## Purpose

Converts a length or distance between metric (nm to km), imperial/US (in, ft, yd, mi), nautical and astronomical units using exact NIST factors (1 in = 0.0254 m, 1 mi = 1609.344 m).

**Use when:** You need a distance, height or length in a different unit, e.g. miles to kilometres, feet to metres or inches to centimetres.

**Do not use when:** You need an area (use area), a volume (use volume), or a speed (use speed); for walking distance from step counts use steps-to-distance.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: nm \| um \| mm \| cm \| m \| km \| in \| ft \| yd \| mi \| nmi \| fathom \| au \| ly |  | required | Unit of the input value. Accepted symbols: nm, um, mm, cm, m, km, in, ft, yd, mi, nmi, fathom, au, ly; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: nm \| um \| mm \| cm \| m \| km \| in \| ft \| yd \| mi \| nmi \| fathom \| au \| ly |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported length unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in m) / (1 to_unit in m)`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/length?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/length` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/length · OpenAPI operationId `convert_length` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "length", "inputs": {…}}`

## Example

- 5 miles to kilometres: inputs `{"value":5,"from_unit":"mi","to_unit":"km"}` → `{"result":8.04672,"factor":1.609344,"formula":"1 mi = 1.609344 km","result_text":"5 mi = 8.04672 km","conversion_table":{"m":8046.72,"ft":26400}}`
- 6 feet to centimetres: inputs `{"value":6,"from_unit":"ft","to_unit":"cm"}` → `{"result":182.88,"factor":30.48,"conversion_table":{"in":72,"m":1.8288}}`

```
GET https://tttkmbb.com/api/v1/calculate/length?value=5&from_unit=mi&to_unit=km
```

## Limitations

You need an area (use area), a volume (use volume), or a speed (use speed); for walking distance from step counts use steps-to-distance. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which mile is used?**

The international statute mile (1609.344 m exactly). Nautical miles (1852 m) are the separate unit nmi.

**Are the factors exact?**

Yes for all SI and customary units: 1 in = 25.4 mm exactly by the 1959 international yard and pound agreement, so ft, yd and mi are exact multiples. The light-year uses the IAU Julian year (9 460 730 472 580 800 m).

## Related

- [Area Converter](https://tttkmbb.com/conversion/area.md) — Convert square units of the same lengths.
- [Speed Converter](https://tttkmbb.com/conversion/speed.md) — Convert distance-per-time units such as mph and km/h.
- [Steps to Distance Calculator](https://tttkmbb.com/fitness/steps-to-distance.md) — Turn step counts into distance.


---

# Mass / Weight Converter

> Converts mass between metric units (μg to tonne), avoirdupois units (grain, oz, lb, stone, short and long ton) and carats using the exact definition 1 lb = 0.45359237 kg.

- Calculator id: `mass` · Category: Unit Conversion (`conversion`) · Tool name: `convert_mass`
- Canonical page: https://tttkmbb.com/conversion/mass · This document: https://tttkmbb.com/conversion/mass.md · JSON definition: https://tttkmbb.com/conversion/mass.json

## Purpose

Converts mass between metric units (μg to tonne), avoirdupois units (grain, oz, lb, stone, short and long ton) and carats using the exact definition 1 lb = 0.45359237 kg.

**Use when:** You need body weight, ingredient weight or freight mass in another unit, e.g. pounds to kilograms, ounces to grams or stones to pounds.

**Do not use when:** You need to convert weight to volume (needs a density; use density) or to force in newtons (use force).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: ug \| mg \| g \| kg \| t \| grain \| oz \| lb \| st \| ton_us \| ton_uk \| ct |  | required | Unit of the input value. Accepted symbols: ug, mg, g, kg, t, grain, oz, lb, st, ton_us, ton_uk, ct; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: ug \| mg \| g \| kg \| t \| grain \| oz \| lb \| st \| ton_us \| ton_uk \| ct |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported mass unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in kg) / (1 to_unit in kg)`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/mass?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/mass` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/mass · OpenAPI operationId `convert_mass` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "mass", "inputs": {…}}`

## Example

- 150 pounds to kilograms: inputs `{"value":150,"from_unit":"lb","to_unit":"kg"}` → `{"result":68.038856,"factor":0.45359237,"formula":"1 lb = 0.45359237 kg","conversion_table":{"st":10.7143,"g":68038.9}}`
- 2.5 kg to ounces: inputs `{"value":2.5,"from_unit":"kg","to_unit":"oz"}` → `{"result":88.184905,"conversion_table":{"lb":5.51156,"g":2500}}`

```
GET https://tttkmbb.com/api/v1/calculate/mass?value=150&from_unit=lb&to_unit=kg
```

## Limitations

You need to convert weight to volume (needs a density; use density) or to force in newtons (use force). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which ton does 'ton' mean?**

The plain alias 'ton' resolves to the US short ton (2000 lb = 907.18474 kg). Use ton_uk for the long ton (2240 lb) and t for the metric tonne (1000 kg).

**Is an ounce the same as a fluid ounce?**

No. The ounce here is the avoirdupois mass unit (28.349523125 g); fluid ounces are volume units handled by the volume and cooking-measurements calculators.

**Weight or mass?**

Everyday 'weight' in kg or lb is mass. The gravitational force on that mass (kgf, lbf, N) is handled by the force converter.

## Related

- [Density Converter](https://tttkmbb.com/conversion/density.md) — Convert between mass and volume with a density.
- [Force Converter](https://tttkmbb.com/conversion/force.md) — Mass to weight-force (kgf, lbf, N).
- [BMI Calculator](https://tttkmbb.com/health/bmi.md) — Use the converted body weight in kg.


---

# Temperature Converter

> Converts temperatures between Celsius, Fahrenheit, Kelvin and Rankine with the exact defining relations (°F = °C × 9/5 + 32, K = °C + 273.15, °R = °F + 459.67) and rejects values below absolute zero.

- Calculator id: `temperature` · Category: Unit Conversion (`conversion`) · Tool name: `convert_temperature`
- Canonical page: https://tttkmbb.com/conversion/temperature · This document: https://tttkmbb.com/conversion/temperature.md · JSON definition: https://tttkmbb.com/conversion/temperature.json

## Purpose

Converts temperatures between Celsius, Fahrenheit, Kelvin and Rankine with the exact defining relations (°F = °C × 9/5 + 32, K = °C + 273.15, °R = °F + 459.67) and rejects values below absolute zero.

**Use when:** You need a weather, cooking, body or laboratory temperature in another scale, e.g. Fahrenheit to Celsius or Celsius to Kelvin.

**Do not use when:** You need to convert a temperature difference (a change of 10 °C is 18 °F, not 50 °F: multiply by 9/5 without the offset) or heat energy (use energy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: C \| F \| K \| R |  | required | Unit of the input value. Accepted symbols: C, F, K, R; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: C \| F \| K \| R |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported temperature unit (6 significant figures), keyed by unit symbol. |

## Formula

`°F = °C × 9/5 + 32; °C = (°F − 32) × 5/9; K = °C + 273.15; °R = °F + 459.67 = K × 9/5`

Kelvin is the base: the input is converted to kelvin and then to the target scale. Results below 0 K raise OUT_OF_RANGE.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/temperature?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/temperature` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/temperature · OpenAPI operationId `convert_temperature` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `convert_temperature` (dedicated) or `run_calculator` with `{"calculator_id": "temperature", "inputs": {…}}`

## Example

- 100 °F to °C: inputs `{"value":100,"from_unit":"F","to_unit":"C"}` → `{"result":37.777778,"formula":"°C = (°F − 32) × 5/9","result_text":"100 °F = 37.7778 °C","conversion_table":{"K":310.928,"R":559.67}}`
- 25 °C to °F: inputs `{"value":25,"from_unit":"C","to_unit":"F"}` → `{"result":77,"formula":"°F = °C × 9/5 + 32","conversion_table":{"K":298.15,"R":536.67}}`

```
GET https://tttkmbb.com/api/v1/calculate/temperature?value=100&from_unit=F&to_unit=C
```

## Limitations

You need to convert a temperature difference (a change of 10 °C is 18 °F, not 50 °F: multiply by 9/5 without the offset) or heat energy (use energy). Kelvin is the base: the input is converted to kelvin and then to the target scale. Results below 0 K raise OUT_OF_RANGE. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is there no factor output?**

Temperature scales have different zero points, so the conversion is affine (multiply and add), not a simple multiplication. The formula output shows the exact relation used.

**Where do the scales coincide?**

−40 °C = −40 °F. Absolute zero is 0 K = −273.15 °C = −459.67 °F = 0 °R; water freezes at 273.15 K and boils at 373.15 K at 1 atm.

**Can I convert a temperature difference?**

Not with this tool: a difference of Δ °C equals Δ × 9/5 °F and Δ K; entering it here would wrongly apply the 32 or 273.15 offset.

## Related

- [Specific Heat Calculator](https://tttkmbb.com/physics/specific-heat.md) — Heat needed for a temperature change.
- [Ideal Gas Law Calculator](https://tttkmbb.com/chemistry/ideal-gas-law.md) — Gas calculations need absolute temperature in kelvin.


---

# Area Converter

> Converts areas between metric (mm² to km², hectare) and US/imperial units (in², ft², yd², acre, mi²) using exact factors (1 ft² = 0.09290304 m², 1 acre = 4046.8564224 m²).

- Calculator id: `area` · Category: Unit Conversion (`conversion`) · Tool name: `convert_area`
- Canonical page: https://tttkmbb.com/conversion/area · This document: https://tttkmbb.com/conversion/area.md · JSON definition: https://tttkmbb.com/conversion/area.json

## Purpose

Converts areas between metric (mm² to km², hectare) and US/imperial units (in², ft², yd², acre, mi²) using exact factors (1 ft² = 0.09290304 m², 1 acre = 4046.8564224 m²).

**Use when:** You need land, floor or surface area in another unit, e.g. square feet to square metres, acres to hectares or square miles to square kilometres.

**Do not use when:** You need to compute an area from dimensions (use rectangle, circle or triangle-area) or material quantities for a floor (use flooring).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: mm2 \| cm2 \| m2 \| ha \| km2 \| in2 \| ft2 \| yd2 \| acre \| mi2 |  | required | Unit of the input value. Accepted symbols: mm2, cm2, m2, ha, km2, in2, ft2, yd2, acre, mi2; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: mm2 \| cm2 \| m2 \| ha \| km2 \| in2 \| ft2 \| yd2 \| acre \| mi2 |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported area unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in m2) / (1 to_unit in m2)`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/area?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/area` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/area · OpenAPI operationId `convert_area` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "area", "inputs": {…}}`

## Example

- 1 acre to square feet: inputs `{"value":1,"from_unit":"acre","to_unit":"ft2"}` → `{"result":43560,"factor":43560,"formula":"1 acre = 43560 ft²","conversion_table":{"m2":4046.86,"ha":0.404686}}`
- 120 m² to square feet: inputs `{"value":120,"from_unit":"m2","to_unit":"ft2"}` → `{"result":1291.66925,"conversion_table":{"yd2":143.519,"acre":0.0296526}}`

```
GET https://tttkmbb.com/api/v1/calculate/area?value=1&from_unit=acre&to_unit=ft2
```

## Limitations

You need to compute an area from dimensions (use rectangle, circle or triangle-area) or material quantities for a floor (use flooring). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I enter square units?**

Use m2, ft2, km2 (or m², sq ft, square feet, sqm and similar spellings); the enum values are the ASCII forms.

**Is the acre exact?**

Yes: the international acre is 4046.8564224 m² (66 × 660 international feet). The US survey acre differs by about 4 parts per million and is not used here.

## Related

- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Compute area from side lengths first.
- [Flooring Calculator](https://tttkmbb.com/construction/flooring.md) — Estimate flooring from a floor area.
- [Length Converter](https://tttkmbb.com/conversion/length.md) — Convert the underlying lengths.


---

# Volume Converter

> Converts volumes between metric units (mL, L, cm³, m³), US customary units (tsp to gallon, in³, ft³, yd³, oil barrel), imperial units (fl oz, pint, quart, gallon) and metric kitchen units, with exact definitions (1 US gal = 3.785411784 L, 1 imperial gal = 4.54609 L).

- Calculator id: `volume` · Category: Unit Conversion (`conversion`) · Tool name: `convert_volume`
- Canonical page: https://tttkmbb.com/conversion/volume · This document: https://tttkmbb.com/conversion/volume.md · JSON definition: https://tttkmbb.com/conversion/volume.json

## Purpose

Converts volumes between metric units (mL, L, cm³, m³), US customary units (tsp to gallon, in³, ft³, yd³, oil barrel), imperial units (fl oz, pint, quart, gallon) and metric kitchen units, with exact definitions (1 US gal = 3.785411784 L, 1 imperial gal = 4.54609 L).

**Use when:** You need a liquid or bulk volume in another unit, e.g. gallons to litres, cubic feet to cubic metres or millilitres to cups.

**Do not use when:** You need a volume from dimensions (use cylinder, sphere or rectangular-prism), a recipe conversion with tablespoons and cups only (cooking-measurements is a focused subset), or mass from volume (use density).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: mL \| L \| m3 \| cm3 \| tsp \| tbsp \| fl_oz_us \| cup_us \| pint_us \| quart_us \| gal_us \| fl_oz_uk \| pint_uk \| quart_uk \| gal_uk \| in3 \| ft3 \| yd3 \| bbl \| tsp_metric \| tbsp_metric \| cup_metric |  | required | Unit of the input value. Accepted symbols: mL, L, m3, cm3, tsp, tbsp, fl_oz_us, cup_us, pint_us, quart_us, gal_us, fl_oz_uk, pint_uk, quart_uk, gal_uk, in3, ft3, yd3, bbl, tsp_metric, tbsp_metric, cup_metric; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: mL \| L \| m3 \| cm3 \| tsp \| tbsp \| fl_oz_us \| cup_us \| pint_us \| quart_us \| gal_us \| fl_oz_uk \| pint_uk \| quart_uk \| gal_uk \| in3 \| ft3 \| yd3 \| bbl \| tsp_metric \| tbsp_metric \| cup_metric |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported volume unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in L) / (1 to_unit in L)`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/volume?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/volume` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/volume · OpenAPI operationId `convert_volume` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "volume", "inputs": {…}}`

## Example

- 1 US gallon to litres: inputs `{"value":1,"from_unit":"gal_us","to_unit":"L"}` → `{"result":3.785412,"factor":3.785411784,"formula":"1 gal_us = 3.785411784 L","conversion_table":{"mL":3785.41,"fl_oz_us":128,"gal_uk":0.832674}}`
- 500 mL to US cups: inputs `{"value":500,"from_unit":"mL","to_unit":"cup_us"}` → `{"result":2.113376,"conversion_table":{"fl_oz_us":16.907,"L":0.5}}`

```
GET https://tttkmbb.com/api/v1/calculate/volume?value=1&from_unit=gal_us&to_unit=L
```

## Limitations

You need a volume from dimensions (use cylinder, sphere or rectangular-prism), a recipe conversion with tablespoons and cups only (cooking-measurements is a focused subset), or mass from volume (use density). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**US or imperial gallon?**

The plain aliases gal, gallon, pint, quart, fl oz and cup resolve to US customary units; imperial units are gal_uk, pint_uk, quart_uk and fl_oz_uk (an imperial gallon is about 20% larger).

**Is a millilitre the same as a cubic centimetre?**

Yes, exactly: 1 mL = 1 cm³ = 1 cc, and 1 L = 1 dm³ = 0.001 m³.

**Which barrel is bbl?**

The US oil barrel of 42 US gallons (158.987294928 L). Beer and other barrels differ.

## Related

- [Cooking Measurement Converter](https://tttkmbb.com/conversion/cooking-measurements.md) — Kitchen-only subset with teaspoons, tablespoons and cups.
- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Compute tank volume from dimensions.
- [Density Converter](https://tttkmbb.com/conversion/density.md) — Convert volume to mass with a density.


---

# Speed Converter

> Converts speeds between m/s, km/h, km/s, mph, ft/s, knots and Mach number using exact factors (1 mph = 0.44704 m/s, 1 kn = 1852/3600 m/s) and 340.294 m/s for Mach 1 at sea level.

- Calculator id: `speed` · Category: Unit Conversion (`conversion`) · Tool name: `convert_speed`
- Canonical page: https://tttkmbb.com/conversion/speed · This document: https://tttkmbb.com/conversion/speed.md · JSON definition: https://tttkmbb.com/conversion/speed.json

## Purpose

Converts speeds between m/s, km/h, km/s, mph, ft/s, knots and Mach number using exact factors (1 mph = 0.44704 m/s, 1 kn = 1852/3600 m/s) and 340.294 m/s for Mach 1 at sea level.

**Use when:** You need a vehicle, wind, running or aircraft speed in another unit, e.g. km/h to mph, knots to km/h or m/s to ft/s.

**Do not use when:** You need running pace (min/km or min/mile, use pace-converter) or to derive speed from distance and time (use speed-distance-time).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: m/s \| km/h \| km/s \| mph \| ft/s \| kn \| mach |  | required | Unit of the input value. Accepted symbols: m/s, km/h, km/s, mph, ft/s, kn, mach; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: m/s \| km/h \| km/s \| mph \| ft/s \| kn \| mach |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported speed unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in m/s) / (1 to_unit in m/s)`

Mach is not a fixed unit: 340.294 m/s is the ICAO standard-atmosphere speed of sound at sea level and 15 °C; it falls to about 295 m/s at cruising altitude.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/speed?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/speed` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/speed · OpenAPI operationId `convert_speed` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "speed", "inputs": {…}}`

## Example

- 100 km/h to mph: inputs `{"value":100,"from_unit":"km/h","to_unit":"mph"}` → `{"result":62.137119,"formula":"1 km/h = 0.6213711922 mph","conversion_table":{"m/s":27.7778,"kn":53.9957,"ft/s":91.1344}}`
- 25 knots to km/h: inputs `{"value":25,"from_unit":"kn","to_unit":"km/h"}` → `{"result":46.3,"factor":1.852,"conversion_table":{"mph":28.7695,"m/s":12.8611}}`

```
GET https://tttkmbb.com/api/v1/calculate/speed?value=100&from_unit=km%2Fh&to_unit=mph
```

## Limitations

You need running pace (min/km or min/mile, use pace-converter) or to derive speed from distance and time (use speed-distance-time). Mach is not a fixed unit: 340.294 m/s is the ICAO standard-atmosphere speed of sound at sea level and 15 °C; it falls to about 295 m/s at cruising altitude. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is a knot exactly?**

One nautical mile (1852 m) per hour, i.e. 0.514444 m/s or 1.150779 mph.

**Is Mach constant?**

No; Mach number depends on air temperature. The factor here is for sea level in the international standard atmosphere (340.294 m/s ≈ 1225 km/h).

## Related

- [Pace Converter](https://tttkmbb.com/fitness/pace-converter.md) — Running pace (min/km, min/mi) instead of speed.
- [Speed, Distance & Time Calculator](https://tttkmbb.com/physics/speed-distance-time.md) — Solve for speed, distance or time.
- [Length Converter](https://tttkmbb.com/conversion/length.md) — Convert the distance units alone.


---

# Time Converter

> Converts durations between nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, weeks, fortnights, 30-day months, 365-day years and Julian years (365.25 days).

- Calculator id: `time` · Category: Unit Conversion (`conversion`) · Tool name: `convert_time`
- Canonical page: https://tttkmbb.com/conversion/time · This document: https://tttkmbb.com/conversion/time.md · JSON definition: https://tttkmbb.com/conversion/time.json

## Purpose

Converts durations between nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, weeks, fortnights, 30-day months, 365-day years and Julian years (365.25 days).

**Use when:** You need a duration in another unit, e.g. hours to minutes, days to weeks or seconds to milliseconds.

**Do not use when:** You need the time between two calendar dates (use date-difference), a date shifted by a duration (use add-days), or a clock-time difference (use time-duration).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: ns \| us \| ms \| s \| min \| h \| day \| week \| fortnight \| month_30 \| year_365 \| year_julian |  | required | Unit of the input value. Accepted symbols: ns, us, ms, s, min, h, day, week, fortnight, month_30, year_365, year_julian; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: ns \| us \| ms \| s \| min \| h \| day \| week \| fortnight \| month_30 \| year_365 \| year_julian |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported time unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in s) / (1 to_unit in s)`

Calendar units are fixed averages: month_30 = 30 days, year_365 = 365 days, year_julian = 365.25 days; real calendar months (28–31 days) and leap years need a date calculator.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/time?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/time` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/time · OpenAPI operationId `convert_time` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "time", "inputs": {…}}`

## Example

- 3 hours to minutes: inputs `{"value":3,"from_unit":"h","to_unit":"min"}` → `{"result":180,"factor":60,"formula":"1 h = 60 min","conversion_table":{"s":10800,"day":0.125}}`
- 90 days to weeks: inputs `{"value":90,"from_unit":"day","to_unit":"week"}` → `{"result":12.857143,"conversion_table":{"h":2160,"month_30":3,"year_365":0.246575}}`

```
GET https://tttkmbb.com/api/v1/calculate/time?value=3&from_unit=h&to_unit=min
```

## Limitations

You need the time between two calendar dates (use date-difference), a date shifted by a duration (use add-days), or a clock-time difference (use time-duration). Calendar units are fixed averages: month_30 = 30 days, year_365 = 365 days, year_julian = 365.25 days; real calendar months (28–31 days) and leap years need a date calculator. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How long is a month or a year here?**

month_30 is exactly 30 days and year_365 exactly 365 days (year_julian is 365.25 days, the astronomical convention). For real calendar arithmetic use date-difference or add-days.

**Does 'day' account for daylight-saving changes?**

No. A day is exactly 86,400 s; clock changes and leap seconds are ignored.

## Related

- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Exact days between two calendar dates.
- [Time Duration Calculator](https://tttkmbb.com/everyday/time-duration.md) — Duration between two clock times.
- [Add or Subtract Days Calculator](https://tttkmbb.com/everyday/add-days.md) — Add a duration to a date.


---

# Data Storage Converter

> Converts digital storage and transfer sizes between bits, bytes, decimal SI multiples (KB = 1000 B, MB, GB, TB, PB), binary IEC multiples (KiB = 1024 B, MiB, GiB, TiB, PiB) and kilobit/megabit/gigabit/terabit.

- Calculator id: `data-storage` · Category: Unit Conversion (`conversion`) · Tool name: `convert_data_storage`
- Canonical page: https://tttkmbb.com/conversion/data-storage · This document: https://tttkmbb.com/conversion/data-storage.md · JSON definition: https://tttkmbb.com/conversion/data-storage.json

## Purpose

Converts digital storage and transfer sizes between bits, bytes, decimal SI multiples (KB = 1000 B, MB, GB, TB, PB), binary IEC multiples (KiB = 1024 B, MiB, GiB, TiB, PiB) and kilobit/megabit/gigabit/terabit.

**Use when:** You need a file, disk or memory size in another unit, e.g. GB to GiB, MB to bits or TB to GB, or want to explain why a '1 TB' drive shows as 931 GiB.

**Do not use when:** You need transfer time from size and bandwidth (use download-time) or a number in binary/hex (use base-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: bit \| B \| KB \| MB \| GB \| TB \| PB \| KiB \| MiB \| GiB \| TiB \| PiB \| kbit \| Mbit \| Gbit \| Tbit |  | required | Unit of the input value. Accepted symbols: bit, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB, kbit, Mbit, Gbit, Tbit; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: bit \| B \| KB \| MB \| GB \| TB \| PB \| KiB \| MiB \| GiB \| TiB \| PiB \| kbit \| Mbit \| Gbit \| Tbit |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported data storage unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in B) / (1 to_unit in B)`

KB/MB/GB/TB/PB follow the SI decimal prefixes (powers of 1000, as used by drive manufacturers and IEC 80000-13); KiB/MiB/GiB/TiB/PiB are binary (powers of 1024, as most operating systems report). 1 byte = 8 bits.

## Data Sources

- NIST – Metric (SI) Prefixes — https://www.nist.gov/pml/owm/metric-si-prefixes (standard, retrieved 2026-09-23)
- Wikipedia – Binary prefix (IEC 80000-13 kibi/mebi/gibi) — https://en.wikipedia.org/wiki/Binary_prefix (reference, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/data-storage?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/data-storage` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/data-storage · OpenAPI operationId `convert_data_storage` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "data-storage", "inputs": {…}}`

## Example

- 1 GB to GiB: inputs `{"value":1,"from_unit":"GB","to_unit":"GiB"}` → `{"result":0.931323,"formula":"1 GB = 0.9313225746 GiB","conversion_table":{"MB":1000,"MiB":953.674,"bit":8000000000}}`
- 500 MB to megabits: inputs `{"value":500,"from_unit":"MB","to_unit":"Mbit"}` → `{"result":4000,"factor":8,"conversion_table":{"GB":0.5,"MiB":476.837}}`

```
GET https://tttkmbb.com/api/v1/calculate/data-storage?value=1&from_unit=GB&to_unit=GiB
```

## Limitations

You need transfer time from size and bandwidth (use download-time) or a number in binary/hex (use base-converter). KB/MB/GB/TB/PB follow the SI decimal prefixes (powers of 1000, as used by drive manufacturers and IEC 80000-13); KiB/MiB/GiB/TiB/PiB are binary (powers of 1024, as most operating systems report). 1 byte = 8 bits. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is 1 KB 1000 or 1024 bytes?**

Here KB = 1000 bytes (SI) and KiB = 1024 bytes (IEC). Windows labels 1024-byte units as 'KB', which is why a 1 TB (10^12 B) drive shows as 931 GiB.

**How do I enter megabits?**

Use Mbit, kbit, Gbit or Tbit (or 'megabits'). Bandwidth figures such as 100 Mbps are megabits per second; divide by 8 for MB per second.

## Related

- [Download Time Calculator](https://tttkmbb.com/everyday/download-time.md) — Time to transfer a file at a given bandwidth.
- [Number Base Converter](https://tttkmbb.com/math/base-converter.md) — Convert numbers between binary, decimal and hexadecimal.


---

# Energy Converter

> Converts energy between joules (J to GJ), calories (thermochemical cal = 4.184 J, kcal), watt-hours (Wh, kWh, MWh), BTU (International Table, 1055.05585262 J), MMBTU, therm (EC), electronvolts, ergs and foot-pounds.

- Calculator id: `energy` · Category: Unit Conversion (`conversion`) · Tool name: `convert_energy`
- Canonical page: https://tttkmbb.com/conversion/energy · This document: https://tttkmbb.com/conversion/energy.md · JSON definition: https://tttkmbb.com/conversion/energy.json

## Purpose

Converts energy between joules (J to GJ), calories (thermochemical cal = 4.184 J, kcal), watt-hours (Wh, kWh, MWh), BTU (International Table, 1055.05585262 J), MMBTU, therm (EC), electronvolts, ergs and foot-pounds.

**Use when:** You need an energy amount in another unit, e.g. kWh to MJ, kcal to kJ, BTU to kWh or therms to kWh for utility bills.

**Do not use when:** You need power (rate of energy, use power), the cost of electricity (use electricity-cost) or calories from macronutrient grams (use calories-from-macros).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: J \| kJ \| MJ \| GJ \| erg \| cal \| kcal \| Wh \| kWh \| MWh \| BTU \| MMBTU \| therm \| eV \| ft_lbf |  | required | Unit of the input value. Accepted symbols: J, kJ, MJ, GJ, erg, cal, kcal, Wh, kWh, MWh, BTU, MMBTU, therm, eV, ft_lbf; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: J \| kJ \| MJ \| GJ \| erg \| cal \| kcal \| Wh \| kWh \| MWh \| BTU \| MMBTU \| therm \| eV \| ft_lbf |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported energy unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in J) / (1 to_unit in J)`

cal is the thermochemical calorie (4.184 J) and kcal the food Calorie (4184 J); BTU is the International Table BTU and therm the EC therm (100,000 BTU_IT). The International Steam Table calorie (4.1868 J) and US therm (105,480,400 J) differ by 0.07% and 0.02%.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/energy?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/energy` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/energy · OpenAPI operationId `convert_energy` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "energy", "inputs": {…}}`

## Example

- 100 kWh to megajoules: inputs `{"value":100,"from_unit":"kWh","to_unit":"MJ"}` → `{"result":360,"factor":3.6,"formula":"1 kWh = 3.6 MJ","conversion_table":{"BTU":341214,"kcal":86042.1}}`
- 2000 kcal to kilojoules: inputs `{"value":2000,"from_unit":"kcal","to_unit":"kJ"}` → `{"result":8368,"factor":4.184,"conversion_table":{"kWh":2.32444,"BTU":7931.34}}`

```
GET https://tttkmbb.com/api/v1/calculate/energy?value=100&from_unit=kWh&to_unit=MJ
```

## Limitations

You need power (rate of energy, use power), the cost of electricity (use electricity-cost) or calories from macronutrient grams (use calories-from-macros). cal is the thermochemical calorie (4.184 J) and kcal the food Calorie (4184 J); BTU is the International Table BTU and therm the EC therm (100,000 BTU_IT). The International Steam Table calorie (4.1868 J) and US therm (105,480,400 J) differ by 0.07% and 0.02%. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is a food Calorie the same as a calorie?**

A food Calorie (kcal, 'large calorie') is 1000 thermochemical calories (cal). Use kcal for nutrition labels.

**Which BTU is used?**

The International Table BTU (1055.05585262 J), the definition used by NIST SP 811 and in HVAC ratings. The thermochemical BTU (1054.35 J) is 0.07% smaller.

**How many kWh in a therm?**

29.3071 kWh (1 therm = 100,000 BTU = 105.5056 MJ).

## Related

- [Power Converter](https://tttkmbb.com/conversion/power.md) — Energy per unit time (W, hp, BTU/h).
- [Electricity Cost Calculator](https://tttkmbb.com/everyday/electricity-cost.md) — Cost of a kWh amount at a tariff.
- [Kinetic Energy Calculator](https://tttkmbb.com/physics/kinetic-energy.md) — Energy of a moving mass in joules.


---

# Pressure Converter

> Converts pressure between pascals (Pa to MPa), bar/millibar, standard atmospheres, psi and ksi, millimetres and inches of mercury, torr and technical atmospheres (kgf/cm²) using NIST factors (1 psi = 6894.757293168 Pa, 1 atm = 101325 Pa).

- Calculator id: `pressure` · Category: Unit Conversion (`conversion`) · Tool name: `convert_pressure`
- Canonical page: https://tttkmbb.com/conversion/pressure · This document: https://tttkmbb.com/conversion/pressure.md · JSON definition: https://tttkmbb.com/conversion/pressure.json

## Purpose

Converts pressure between pascals (Pa to MPa), bar/millibar, standard atmospheres, psi and ksi, millimetres and inches of mercury, torr and technical atmospheres (kgf/cm²) using NIST factors (1 psi = 6894.757293168 Pa, 1 atm = 101325 Pa).

**Use when:** You need tyre, weather, hydraulic, vacuum or blood pressure in another unit, e.g. psi to bar, atm to kPa or mmHg to kPa.

**Do not use when:** You need to compute pressure from force and area (a physics calculation, not a unit conversion) or the gas law relation between pressure, volume and temperature (use ideal-gas-law).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: Pa \| hPa \| kPa \| MPa \| bar \| mbar \| atm \| psi \| ksi \| mmHg \| torr \| inHg \| kgf/cm2 |  | required | Unit of the input value. Accepted symbols: Pa, hPa, kPa, MPa, bar, mbar, atm, psi, ksi, mmHg, torr, inHg, kgf/cm2; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: Pa \| hPa \| kPa \| MPa \| bar \| mbar \| atm \| psi \| ksi \| mmHg \| torr \| inHg \| kgf/cm2 |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported pressure unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in Pa) / (1 to_unit in Pa)`

mmHg uses the conventional value 133.322387415 Pa (mercury density 13.5951 g/cm³ at 0 °C); torr is defined as exactly 1/760 atm, so 1 mmHg ≈ 1.000000142 torr. inHg = 25.4 mmHg.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pressure?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/pressure` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pressure · OpenAPI operationId `convert_pressure` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pressure", "inputs": {…}}`

## Example

- 1 atm to psi: inputs `{"value":1,"from_unit":"atm","to_unit":"psi"}` → `{"result":14.695949,"formula":"1 atm = 14.69594878 psi","conversion_table":{"bar":1.01325,"mmHg":760,"kPa":101.325,"torr":760}}`
- 32 psi to bar: inputs `{"value":32,"from_unit":"psi","to_unit":"bar"}` → `{"result":2.206322,"conversion_table":{"kPa":220.632,"atm":2.17747}}`

```
GET https://tttkmbb.com/api/v1/calculate/pressure?value=1&from_unit=atm&to_unit=psi
```

## Limitations

You need to compute pressure from force and area (a physics calculation, not a unit conversion) or the gas law relation between pressure, volume and temperature (use ideal-gas-law). mmHg uses the conventional value 133.322387415 Pa (mercury density 13.5951 g/cm³ at 0 °C); torr is defined as exactly 1/760 atm, so 1 mmHg ≈ 1.000000142 torr. inHg = 25.4 mmHg. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is bar the same as atmosphere?**

No. 1 bar = 100,000 Pa exactly; 1 atm = 101,325 Pa = 1.01325 bar = 14.6959 psi.

**Gauge or absolute pressure?**

The converter changes units only. Tyre gauges read pressure above atmospheric (psig); add 1 atm (14.6959 psi) for absolute pressure.

## Related

- [Force Converter](https://tttkmbb.com/conversion/force.md) — Convert the force units behind psi and kgf/cm².
- [Ideal Gas Law Calculator](https://tttkmbb.com/chemistry/ideal-gas-law.md) — Pressure–volume–temperature of a gas.
- [Density Converter](https://tttkmbb.com/conversion/density.md) — Hydrostatic pressure needs fluid density.


---

# Power Converter

> Converts power between watts (W to GW), mechanical horsepower (745.69987158227 W), metric horsepower (735.49875 W), BTU per hour, foot-pounds per second, kcal/h and tons of refrigeration.

- Calculator id: `power` · Category: Unit Conversion (`conversion`) · Tool name: `convert_power`
- Canonical page: https://tttkmbb.com/conversion/power · This document: https://tttkmbb.com/conversion/power.md · JSON definition: https://tttkmbb.com/conversion/power.json

## Purpose

Converts power between watts (W to GW), mechanical horsepower (745.69987158227 W), metric horsepower (735.49875 W), BTU per hour, foot-pounds per second, kcal/h and tons of refrigeration.

**Use when:** You need engine, motor, heater or air-conditioner power in another unit, e.g. hp to kW, kW to BTU/h or tons of refrigeration to kW.

**Do not use when:** You need energy (use energy) or to compute power from work and time or voltage and current (use work-power or electric-power).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: W \| kW \| MW \| GW \| hp \| hp_metric \| BTU/h \| ft_lbf/s \| kcal/h \| ton_refrigeration |  | required | Unit of the input value. Accepted symbols: W, kW, MW, GW, hp, hp_metric, BTU/h, ft_lbf/s, kcal/h, ton_refrigeration; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: W \| kW \| MW \| GW \| hp \| hp_metric \| BTU/h \| ft_lbf/s \| kcal/h \| ton_refrigeration |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported power unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in W) / (1 to_unit in W)`

hp is the mechanical (imperial) horsepower of 550 ft·lbf/s; hp_metric (PS, cv, ch) is 75 kgf·m/s. Electrical horsepower (746 W exactly) and boiler horsepower (9809.5 W) are not included.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/power?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/power` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/power · OpenAPI operationId `convert_power` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "power", "inputs": {…}}`

## Example

- 100 hp to kilowatts: inputs `{"value":100,"from_unit":"hp","to_unit":"kW"}` → `{"result":74.569987,"formula":"1 hp = 0.7456998716 kW","conversion_table":{"BTU/h":254443,"hp_metric":101.387}}`
- 2 kW to BTU per hour: inputs `{"value":2,"from_unit":"kW","to_unit":"BTU/h"}` → `{"result":6824.283,"conversion_table":{"hp":2.68204,"W":2000}}`

```
GET https://tttkmbb.com/api/v1/calculate/power?value=100&from_unit=hp&to_unit=kW
```

## Limitations

You need energy (use energy) or to compute power from work and time or voltage and current (use work-power or electric-power). hp is the mechanical (imperial) horsepower of 550 ft·lbf/s; hp_metric (PS, cv, ch) is 75 kgf·m/s. Electrical horsepower (746 W exactly) and boiler horsepower (9809.5 W) are not included. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Mechanical or metric horsepower?**

hp is the mechanical horsepower (745.7 W) used in the US and UK; hp_metric is the metric PS/cv/ch (735.5 W) used in European car specifications. They differ by 1.4%.

**What is a ton of refrigeration?**

The cooling rate that freezes one short ton of water in 24 hours: 12,000 BTU/h = 3516.85 W (3.517 kW).

## Related

- [Energy Converter](https://tttkmbb.com/conversion/energy.md) — Power × time gives energy (kWh, J).
- [Work & Power Calculator](https://tttkmbb.com/physics/work-power.md) — Compute power from work and time.
- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Power from voltage, current and resistance.


---

# Angle Converter

> Converts plane angles between degrees, radians, milliradians, gradians (gon), arcminutes, arcseconds and turns (revolutions) using π rad = 180° = 200 gon = 0.5 turn.

- Calculator id: `angle` · Category: Unit Conversion (`conversion`) · Tool name: `convert_angle`
- Canonical page: https://tttkmbb.com/conversion/angle · This document: https://tttkmbb.com/conversion/angle.md · JSON definition: https://tttkmbb.com/conversion/angle.json

## Purpose

Converts plane angles between degrees, radians, milliradians, gradians (gon), arcminutes, arcseconds and turns (revolutions) using π rad = 180° = 200 gon = 0.5 turn.

**Use when:** You need an angle in another unit, e.g. degrees to radians for trigonometry, arcseconds for astronomy or turns for rotation counts.

**Do not use when:** You need an angle from a slope or triangle (use slope, right-triangle or triangle-solver) or a rotational speed (use frequency for rpm and rad/s).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: deg \| rad \| mrad \| grad \| arcmin \| arcsec \| turn |  | required | Unit of the input value. Accepted symbols: deg, rad, mrad, grad, arcmin, arcsec, turn; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: deg \| rad \| mrad \| grad \| arcmin \| arcsec \| turn |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported angle unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in rad) / (1 to_unit in rad)`

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/angle?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/angle` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/angle · OpenAPI operationId `convert_angle` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "angle", "inputs": {…}}`

## Example

- 180 degrees to radians: inputs `{"value":180,"from_unit":"deg","to_unit":"rad"}` → `{"result":3.141593,"factor":0.0174532925,"formula":"1 ° = 0.01745329252 rad","conversion_table":{"grad":200,"turn":0.5,"arcmin":10800}}`
- 1 radian to degrees: inputs `{"value":1,"from_unit":"rad","to_unit":"deg"}` → `{"result":57.29578,"conversion_table":{"grad":63.662,"arcsec":206265}}`

```
GET https://tttkmbb.com/api/v1/calculate/angle?value=180&from_unit=deg&to_unit=rad
```

## Limitations

You need an angle from a slope or triangle (use slope, right-triangle or triangle-solver) or a rotational speed (use frequency for rpm and rad/s). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How many degrees is one radian?**

180/π = 57.29578°; a full turn is 2π rad = 360° = 400 gon.

**What is a milliradian?**

1/1000 of a radian (0.0573°), used in optics and ballistics. The NATO 'mil' (1/6400 turn = 0.98175 mrad) is a different unit and is not included.

## Related

- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Angles from triangle sides.
- [Slope Calculator](https://tttkmbb.com/math/slope.md) — Angle of a line from its gradient.
- [Frequency Converter](https://tttkmbb.com/conversion/frequency.md) — Rotational speed in rpm or rad/s.


---

# Fuel Economy Converter

> Converts fuel consumption between litres per 100 km, kilometres per litre, miles per US gallon and miles per imperial gallon; L/100km is the base and the mpg relations are reciprocal (L/100km = 235.214583 / mpg_US).

- Calculator id: `fuel-economy` · Category: Unit Conversion (`conversion`) · Tool name: `convert_fuel_economy`
- Canonical page: https://tttkmbb.com/conversion/fuel-economy · This document: https://tttkmbb.com/conversion/fuel-economy.md · JSON definition: https://tttkmbb.com/conversion/fuel-economy.json

## Purpose

Converts fuel consumption between litres per 100 km, kilometres per litre, miles per US gallon and miles per imperial gallon; L/100km is the base and the mpg relations are reciprocal (L/100km = 235.214583 / mpg_US).

**Use when:** You need a car's fuel economy in another convention, e.g. mpg to L/100km, L/100km to km/L or US mpg to UK mpg.

**Do not use when:** You need the fuel cost of a trip (use fuel-cost) or plain volume or distance conversions (use volume, length).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Fuel economy in from_unit (must be greater than 0). (> 0) |
| `from_unit` | enum: L/100km \| km/L \| mpg_us \| mpg_uk |  | required | Unit of the input value. Accepted symbols: L/100km, km/L, mpg_us, mpg_uk; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: L/100km \| km/L \| mpg_us \| mpg_uk |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported fuel economy unit (6 significant figures), keyed by unit symbol. |

## Formula

`L/100km = 100 / (km/L) = 235.214583 / mpg(US) = 282.480936 / mpg(UK); mpg(UK) = mpg(US) × 1.200950`

Consumption (L/100km) and economy (km/L, mpg) are reciprocals, so the conversion is non-linear and no constant factor applies. Constants: 100 × 3.785411784 / 1.609344 = 235.214583 and 100 × 4.54609 / 1.609344 = 282.480936.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- Wikipedia – Fuel economy in automobiles (units and conversions) — https://en.wikipedia.org/wiki/Fuel_economy_in_automobiles (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/fuel-economy?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/fuel-economy` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/fuel-economy · OpenAPI operationId `convert_fuel_economy` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "fuel-economy", "inputs": {…}}`

## Example

- 30 US mpg to L/100km: inputs `{"value":30,"from_unit":"mpg_us","to_unit":"L/100km"}` → `{"result":7.840486,"formula":"L/100km = 235.214583 / mpg (US)","conversion_table":{"km/L":12.7543,"mpg_uk":36.0285}}`
- 6 L/100km to US mpg: inputs `{"value":6,"from_unit":"L/100km","to_unit":"mpg_us"}` → `{"result":39.202431,"conversion_table":{"km/L":16.6667,"mpg_uk":47.0802}}`

```
GET https://tttkmbb.com/api/v1/calculate/fuel-economy?value=30&from_unit=mpg_us&to_unit=L%2F100km
```

## Limitations

You need the fuel cost of a trip (use fuel-cost) or plain volume or distance conversions (use volume, length). Consumption (L/100km) and economy (km/L, mpg) are reciprocals, so the conversion is non-linear and no constant factor applies. Constants: 100 × 3.785411784 / 1.609344 = 235.214583 and 100 × 4.54609 / 1.609344 = 282.480936. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which mpg does 'mpg' mean?**

The plain alias mpg resolves to miles per US gallon (mpg_us). UK figures use the larger imperial gallon: mpg_uk = mpg_us × 1.20095.

**Why is lower L/100km better?**

L/100km measures consumption, mpg and km/L measure economy; 5 L/100km = 20 km/L = 47.0 US mpg, and halving consumption doubles mpg.

## Related

- [Fuel Cost Calculator](https://tttkmbb.com/everyday/fuel-cost.md) — Trip fuel cost from distance, consumption and price.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert gallons and litres directly.
- [Length Converter](https://tttkmbb.com/conversion/length.md) — Convert miles and kilometres directly.


---

# Force Converter

> Converts force between newtons (N, kN), dynes, gram-force, kilogram-force (kilopond), ounce-force, pound-force and kips using exact factors (1 lbf = 4.4482216152605 N, 1 kgf = 9.80665 N).

- Calculator id: `force` · Category: Unit Conversion (`conversion`) · Tool name: `convert_force`
- Canonical page: https://tttkmbb.com/conversion/force · This document: https://tttkmbb.com/conversion/force.md · JSON definition: https://tttkmbb.com/conversion/force.json

## Purpose

Converts force between newtons (N, kN), dynes, gram-force, kilogram-force (kilopond), ounce-force, pound-force and kips using exact factors (1 lbf = 4.4482216152605 N, 1 kgf = 9.80665 N).

**Use when:** You need a load, thrust or weight-force in another unit, e.g. lbf to N, kgf to N or kN to kips for structural loads.

**Do not use when:** You need to compute force from mass and acceleration (Newton's second law is a physics calculation, not a unit conversion), a spring force (use hookes-law) or plain mass units (use mass).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: N \| kN \| dyn \| gf \| kgf \| ozf \| lbf \| kip |  | required | Unit of the input value. Accepted symbols: N, kN, dyn, gf, kgf, ozf, lbf, kip; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: N \| kN \| dyn \| gf \| kgf \| ozf \| lbf \| kip |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported force unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in N) / (1 to_unit in N)`

kgf and lbf are the weights of 1 kg and 1 lb under standard gravity gₙ = 9.80665 m/s²; a mass in kg therefore has the same numeric value in kgf.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/force?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/force` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/force · OpenAPI operationId `convert_force` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "force", "inputs": {…}}`

## Example

- 100 pounds-force to newtons: inputs `{"value":100,"from_unit":"lbf","to_unit":"N"}` → `{"result":444.822162,"factor":4.4482216153,"formula":"1 lbf = 4.448221615 N","conversion_table":{"kgf":45.3592,"kN":0.444822}}`
- 500 N to kilograms-force: inputs `{"value":500,"from_unit":"N","to_unit":"kgf"}` → `{"result":50.985811,"conversion_table":{"lbf":112.404,"dyn":50000000}}`

```
GET https://tttkmbb.com/api/v1/calculate/force?value=100&from_unit=lbf&to_unit=N
```

## Limitations

You need to compute force from mass and acceleration (Newton's second law is a physics calculation, not a unit conversion), a spring force (use hookes-law) or plain mass units (use mass). kgf and lbf are the weights of 1 kg and 1 lb under standard gravity gₙ = 9.80665 m/s²; a mass in kg therefore has the same numeric value in kgf. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is kgf the same as kg?**

No. kg is mass; kgf is the force exerted by 1 kg under standard gravity (9.80665 N). On Earth the numbers match, which is why scales are labelled in kg.

**What is a kip?**

A kilopound-force, 1000 lbf = 4448.22 N, used in US structural engineering.

## Related

- [Mass / Weight Converter](https://tttkmbb.com/conversion/mass.md) — Mass units behind kgf and lbf.
- [Torque Converter](https://tttkmbb.com/conversion/torque.md) — Force × lever arm units (N·m, lbf·ft).
- [Hooke's Law Calculator](https://tttkmbb.com/physics/hookes-law.md) — Spring force from stiffness and displacement.


---

# Frequency Converter

> Converts frequency and rotational speed between hertz (Hz to THz), revolutions per minute, beats per minute, radians per second (angular frequency, ω = 2πf) and degrees per second.

- Calculator id: `frequency` · Category: Unit Conversion (`conversion`) · Tool name: `convert_frequency`
- Canonical page: https://tttkmbb.com/conversion/frequency · This document: https://tttkmbb.com/conversion/frequency.md · JSON definition: https://tttkmbb.com/conversion/frequency.json

## Purpose

Converts frequency and rotational speed between hertz (Hz to THz), revolutions per minute, beats per minute, radians per second (angular frequency, ω = 2πf) and degrees per second.

**Use when:** You need a rate of rotation or oscillation in another unit, e.g. rpm to Hz, GHz to MHz, rad/s to rpm or bpm to Hz.

**Do not use when:** You need wavelength from frequency (use wavelength-frequency), a pendulum's period (use pendulum) or a time interval (use time).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: Hz \| kHz \| MHz \| GHz \| THz \| rpm \| bpm \| rad/s \| deg/s |  | required | Unit of the input value. Accepted symbols: Hz, kHz, MHz, GHz, THz, rpm, bpm, rad/s, deg/s; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: Hz \| kHz \| MHz \| GHz \| THz \| rpm \| bpm \| rad/s \| deg/s |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported frequency unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in Hz) / (1 to_unit in Hz)`

1 Hz = 1 cycle per second = 60 rpm = 60 bpm = 2π rad/s = 360 °/s.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/frequency?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/frequency` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/frequency · OpenAPI operationId `convert_frequency` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "frequency", "inputs": {…}}`

## Example

- 3000 rpm to hertz: inputs `{"value":3000,"from_unit":"rpm","to_unit":"Hz"}` → `{"result":50,"formula":"1 rpm = 0.01666666667 Hz","conversion_table":{"rad/s":314.159,"kHz":0.05}}`
- 2.4 GHz to MHz: inputs `{"value":2.4,"from_unit":"GHz","to_unit":"MHz"}` → `{"result":2400,"factor":1000,"conversion_table":{"Hz":2400000000,"THz":0.0024}}`

```
GET https://tttkmbb.com/api/v1/calculate/frequency?value=3000&from_unit=rpm&to_unit=Hz
```

## Limitations

You need wavelength from frequency (use wavelength-frequency), a pendulum's period (use pendulum) or a time interval (use time). 1 Hz = 1 cycle per second = 60 rpm = 60 bpm = 2π rad/s = 360 °/s. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do rad/s and Hz relate?**

Angular frequency ω = 2πf: 1 Hz = 6.28319 rad/s, and 1 rad/s = 9.5493 rpm.

**Is rpm the same as Hz?**

Both count cycles, per minute versus per second: rpm / 60 = Hz. bpm (beats per minute) converts identically.

## Related

- [Wavelength & Frequency Calculator](https://tttkmbb.com/physics/wavelength-frequency.md) — Wavelength of a wave at this frequency.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Angular units used in rad/s and °/s.
- [Pendulum Period Calculator](https://tttkmbb.com/physics/pendulum.md) — Period and frequency of a pendulum.


---

# Density Converter

> Converts density between kg/m³, g/cm³, g/mL, kg/L, g/L, mg/L, lb/ft³, lb/in³, oz/in³ and lb per US gallon using exact mass and volume definitions (1 lb/ft³ = 16.01846337 kg/m³).

- Calculator id: `density` · Category: Unit Conversion (`conversion`) · Tool name: `convert_density`
- Canonical page: https://tttkmbb.com/conversion/density · This document: https://tttkmbb.com/conversion/density.md · JSON definition: https://tttkmbb.com/conversion/density.json

## Purpose

Converts density between kg/m³, g/cm³, g/mL, kg/L, g/L, mg/L, lb/ft³, lb/in³, oz/in³ and lb per US gallon using exact mass and volume definitions (1 lb/ft³ = 16.01846337 kg/m³).

**Use when:** You need a material or fluid density in another unit, e.g. g/cm³ to kg/m³, kg/m³ to lb/ft³ or g/mL to lb/gal.

**Do not use when:** You need to compute density from mass and volume (a physics calculation, not a unit conversion) or concentration in mol/L (use molarity).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: kg/m3 \| g/cm3 \| g/mL \| g/L \| mg/L \| kg/L \| lb/ft3 \| lb/in3 \| oz/in3 \| lb/gal_us |  | required | Unit of the input value. Accepted symbols: kg/m3, g/cm3, g/mL, g/L, mg/L, kg/L, lb/ft3, lb/in3, oz/in3, lb/gal_us; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: kg/m3 \| g/cm3 \| g/mL \| g/L \| mg/L \| kg/L \| lb/ft3 \| lb/in3 \| oz/in3 \| lb/gal_us |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported density unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in kg/m3) / (1 to_unit in kg/m3)`

Water at 4 °C has a density of about 1 g/cm³ = 1000 kg/m³ = 62.428 lb/ft³ = 8.345 lb/US gal; specific gravity is density divided by that of water.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/density?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/density` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/density · OpenAPI operationId `convert_density` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "density", "inputs": {…}}`

## Example

- 1 g/cm³ (water) to lb/ft³: inputs `{"value":1,"from_unit":"g/cm3","to_unit":"lb/ft3"}` → `{"result":62.427961,"formula":"1 g/cm³ = 62.42796058 lb/ft³","conversion_table":{"kg/m3":1000,"lb/gal_us":8.3454,"lb/in3":0.0361273}}`
- 7850 kg/m³ (steel) to lb/ft³: inputs `{"value":7850,"from_unit":"kg/m3","to_unit":"lb/ft3"}` → `{"result":490.059491,"conversion_table":{"g/cm3":7.85,"lb/in3":0.283599}}`

```
GET https://tttkmbb.com/api/v1/calculate/density?value=1&from_unit=g%2Fcm3&to_unit=lb%2Fft3
```

## Limitations

You need to compute density from mass and volume (a physics calculation, not a unit conversion) or concentration in mol/L (use molarity). Water at 4 °C has a density of about 1 g/cm³ = 1000 kg/m³ = 62.428 lb/ft³ = 8.345 lb/US gal; specific gravity is density divided by that of water. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Are g/cm³, g/mL and kg/L the same?**

Yes, all three equal 1000 kg/m³ exactly because 1 mL = 1 cm³ and 1 L = 1 dm³.

**How do I convert a weight to a volume?**

Divide mass by density: volume = mass / density (e.g. 5 kg of water ÷ 1 kg/L = 5 L). Convert the units first so mass, volume and density agree.

## Related

- [Mass / Weight Converter](https://tttkmbb.com/conversion/mass.md) — Mass units used in density.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Volume units used in density.
- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Molar concentration instead of mass density.


---

# Torque Converter

> Converts torque (moment of force) between N·m, kN·m, N·cm, mN·m, lbf·ft, lbf·in, kgf·m, kgf·cm and ozf·in using exact force and length definitions (1 lbf·ft = 1.3558179483 N·m).

- Calculator id: `torque` · Category: Unit Conversion (`conversion`) · Tool name: `convert_torque`
- Canonical page: https://tttkmbb.com/conversion/torque · This document: https://tttkmbb.com/conversion/torque.md · JSON definition: https://tttkmbb.com/conversion/torque.json

## Purpose

Converts torque (moment of force) between N·m, kN·m, N·cm, mN·m, lbf·ft, lbf·in, kgf·m, kgf·cm and ozf·in using exact force and length definitions (1 lbf·ft = 1.3558179483 N·m).

**Use when:** You need a wrench, bolt or engine torque in another unit, e.g. lb-ft to N·m, N·m to lb-in or kgf·m to N·m.

**Do not use when:** You need energy in joules or foot-pounds of work (use energy; torque and energy share dimensions but are different quantities) or the force alone (use force).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: Nm \| kNm \| Ncm \| mNm \| lbf_ft \| lbf_in \| kgf_m \| kgf_cm \| ozf_in |  | required | Unit of the input value. Accepted symbols: Nm, kNm, Ncm, mNm, lbf_ft, lbf_in, kgf_m, kgf_cm, ozf_in; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: Nm \| kNm \| Ncm \| mNm \| lbf_ft \| lbf_in \| kgf_m \| kgf_cm \| ozf_in |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported torque unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in Nm) / (1 to_unit in Nm)`

Torque = force × lever arm, so the factors are products of the force factors (lbf, kgf, ozf) and length factors (ft, in, m, cm).

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- BIPM – The International System of Units (SI Brochure, 9th edition) — https://www.bipm.org/en/publications/si-brochure (standard, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/torque?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/torque` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/torque · OpenAPI operationId `convert_torque` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "torque", "inputs": {…}}`

## Example

- 100 lb-ft to newton-metres: inputs `{"value":100,"from_unit":"lbf_ft","to_unit":"Nm"}` → `{"result":135.581795,"factor":1.3558179483,"formula":"1 lbf·ft = 1.355817948 N·m","conversion_table":{"kgf_m":13.8255,"lbf_in":1200}}`
- 250 N·m to lb-ft: inputs `{"value":250,"from_unit":"Nm","to_unit":"lbf_ft"}` → `{"result":184.390861,"conversion_table":{"kgf_m":25.4929,"lbf_in":2212.69}}`

```
GET https://tttkmbb.com/api/v1/calculate/torque?value=100&from_unit=lbf_ft&to_unit=Nm
```

## Limitations

You need energy in joules or foot-pounds of work (use energy; torque and energy share dimensions but are different quantities) or the force alone (use force). Torque = force × lever arm, so the factors are products of the force factors (lbf, kgf, ozf) and length factors (ft, in, m, cm). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is lb-ft the same as ft-lb?**

Both spellings denote the same torque unit (1 lbf·ft = 1.35582 N·m) and are accepted here. Foot-pound is also used for energy (ft·lbf in the energy converter); the numeric factor to joules is identical.

**How do I enter N·m?**

Use Nm (or N·m, N-m, newton metre); kgf·m is kgf_m and inch-pounds are lbf_in.

## Related

- [Force Converter](https://tttkmbb.com/conversion/force.md) — Force units behind each torque unit.
- [Energy Converter](https://tttkmbb.com/conversion/energy.md) — Same dimensions (N·m = J) but a different quantity.
- [Work & Power Calculator](https://tttkmbb.com/physics/work-power.md) — Work and power from force and motion.


---

# Cooking Measurement Converter

> Converts kitchen volume measures between US customary teaspoons, tablespoons, fluid ounces, cups, pints, quarts and gallons, metric teaspoons (5 mL), tablespoons (15 mL) and cups (250 mL), imperial fluid ounces and pints, and millilitres/litres.

- Calculator id: `cooking-measurements` · Category: Unit Conversion (`conversion`) · Tool name: `convert_cooking_measurements`
- Canonical page: https://tttkmbb.com/conversion/cooking-measurements · This document: https://tttkmbb.com/conversion/cooking-measurements.md · JSON definition: https://tttkmbb.com/conversion/cooking-measurements.json

## Purpose

Converts kitchen volume measures between US customary teaspoons, tablespoons, fluid ounces, cups, pints, quarts and gallons, metric teaspoons (5 mL), tablespoons (15 mL) and cups (250 mL), imperial fluid ounces and pints, and millilitres/litres.

**Use when:** You need to convert a recipe quantity between volume measures, e.g. cups to mL, tablespoons to teaspoons or fluid ounces to millilitres.

**Do not use when:** You need to convert a volume to grams or ounces by weight (that needs the ingredient's density; use cooking-converter), to scale a whole recipe (use recipe-scaler), or non-kitchen volumes such as cubic metres (use volume).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Amount to convert, expressed in from_unit. |
| `from_unit` | enum: tsp \| tbsp \| fl_oz_us \| cup_us \| pint_us \| quart_us \| gal_us \| mL \| L \| tsp_metric \| tbsp_metric \| cup_metric \| fl_oz_uk \| pint_uk |  | required | Unit of the input value. Accepted symbols: tsp, tbsp, fl_oz_us, cup_us, pint_us, quart_us, gal_us, mL, L, tsp_metric, tbsp_metric, cup_metric, fl_oz_uk, pint_uk; spelled-out names and common abbreviations are accepted too. |
| `to_unit` | enum: tsp \| tbsp \| fl_oz_us \| cup_us \| pint_us \| quart_us \| gal_us \| mL \| L \| tsp_metric \| tbsp_metric \| cup_metric \| fl_oz_uk \| pint_uk |  | required | Unit to convert into (same symbols as from_unit). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Converted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values). |
| `result_text` | string |  | The conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km". |
| `formula` | string |  | Relation used, e.g. "1 mi = 1.609344 km". |
| `factor` | number |  | Multiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions. |
| `conversion_table` | object |  | The input value expressed in every supported volume unit (6 significant figures), keyed by unit symbol. |

## Formula

`result = value × factor, factor = (1 from_unit in L) / (1 to_unit in L)`

US units follow the customary definitions (1 US cup = 236.5882365 mL, 1 tbsp = 14.7868 mL, 1 tsp = 4.9289 mL). US nutrition labels round to 240 mL, 15 mL and 5 mL; Australian tablespoons are 20 mL.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the International System of Units (SI), Appendix B conversion factors — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- 21 CFR 101.9(b)(5)(viii) – household measures used in US nutrition labeling — https://www.ecfr.gov/current/title-21/chapter-I/subchapter-B/part-101/section-101.9 (government, retrieved 2026-09-23)
- Wikipedia – Conversion of units — https://en.wikipedia.org/wiki/Conversion_of_units (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/cooking-measurements?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/cooking-measurements` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/cooking-measurements · OpenAPI operationId `convert_cooking_measurements` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "cooking-measurements", "inputs": {…}}`

## Example

- 2 US cups to millilitres: inputs `{"value":2,"from_unit":"cup_us","to_unit":"mL"}` → `{"result":473.176473,"formula":"1 cup_us = 236.5882365 mL","conversion_table":{"tbsp":32,"fl_oz_us":16,"cup_metric":1.89271}}`
- 3 tablespoons to teaspoons: inputs `{"value":3,"from_unit":"tbsp","to_unit":"tsp"}` → `{"result":9,"factor":3,"conversion_table":{"mL":44.3603,"fl_oz_us":1.5}}`

```
GET https://tttkmbb.com/api/v1/calculate/cooking-measurements?value=2&from_unit=cup_us&to_unit=mL
```

## Limitations

You need to convert a volume to grams or ounces by weight (that needs the ingredient's density; use cooking-converter), to scale a whole recipe (use recipe-scaler), or non-kitchen volumes such as cubic metres (use volume). US units follow the customary definitions (1 US cup = 236.5882365 mL, 1 tbsp = 14.7868 mL, 1 tsp = 4.9289 mL). US nutrition labels round to 240 mL, 15 mL and 5 mL; Australian tablespoons are 20 mL. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How many grams is a cup of flour?**

It depends on the ingredient: a US cup of water is 236.6 g but of all-purpose flour about 120–125 g. Volume-to-weight conversion needs a density; use cooking-converter for common ingredients.

**Which cup is used?**

cup_us is the US customary cup (236.588 mL); cup_metric is 250 mL (Australia, Canada, NZ). US labelling rounds the cup to 240 mL, 1.4% larger than the customary cup.

**Are US and imperial fluid ounces the same?**

No: 1 US fl oz = 29.5735 mL and 1 imperial fl oz = 28.4131 mL; a US pint is 16 US fl oz (473 mL), an imperial pint 20 imperial fl oz (568 mL).

## Related

- [Cooking Measurement Converter](https://tttkmbb.com/food/cooking-converter.md) — Volume-to-weight conversion for common ingredients.
- [Recipe Scaler](https://tttkmbb.com/food/recipe-scaler.md) — Scale all ingredient amounts by servings.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Full volume converter including cubic units and imperial gallons.


---

# Speed, Distance & Time Calculator

> Solves the uniform-motion relation speed = distance / time for whichever of the three quantities is omitted, and reports the speed in m/s, km/h and mph and the time as h:mm:ss.

- Calculator id: `speed-distance-time` · Category: Physics (`physics`) · Tool name: `solve_speed_distance_time`
- Canonical page: https://tttkmbb.com/physics/speed-distance-time · This document: https://tttkmbb.com/physics/speed-distance-time.md · JSON definition: https://tttkmbb.com/physics/speed-distance-time.json

## Purpose

Solves the uniform-motion relation speed = distance / time for whichever of the three quantities is omitted, and reports the speed in m/s, km/h and mph and the time as h:mm:ss.

**Use when:** You know any two of distance, elapsed time and average speed for travel at constant (average) speed and need the third.

**Do not use when:** Speed changes during the motion (use acceleration or free-fall), or you want a running pace per km or mile (use running-pace).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `distance_m` | number | m | optional | Distance travelled in metres (1 km = 1000 m, 1 mile = 1609.344 m). Omit to solve for it. (min 0) |
| `time_s` | number | s | optional | Elapsed time in seconds (1 h = 3600 s). Omit to solve for it. (> 0) |
| `speed_m_s` | number | m/s | optional | Average speed in metres per second (km/h ÷ 3.6, mph × 0.44704). Omit to solve for it. (min 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `solved_for` | string |  | Which input was computed: distance_m, time_s or speed_m_s. |
| `distance_m` | number | m | Distance travelled. |
| `distance_km` | number | km | Distance in kilometres. |
| `time_s` | number | s | Elapsed time. |
| `time_formatted` | string |  | Elapsed time as hours:minutes:seconds, rounded to the second. |
| `speed_m_s` | number | m/s | Average speed. |
| `speed_km_h` | number | km/h | Average speed in kilometres per hour (× 3.6). |
| `speed_mph` | number | mph | Average speed in miles per hour (÷ 0.44704). |

## Formula

`speed_m_s = distance_m / time_s; distance_m = speed_m_s × time_s; time_s = distance_m / speed_m_s; speed_km_h = 3.6 × speed_m_s; speed_mph = speed_m_s / 0.44704`

Uniform (constant or average) motion in a straight line; the result is the average speed over the interval, not an instantaneous value.

## Data Sources

- HyperPhysics – Motion equations for constant acceleration — http://hyperphysics.phy-astr.gsu.edu/hbase/mot.html (reference, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/speed-distance-time?`
- `POST https://tttkmbb.com/api/v1/calculate/speed-distance-time` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/speed-distance-time · OpenAPI operationId `solve_speed_distance_time` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "speed-distance-time", "inputs": {…}}`

## Example

- 100 m in 9.58 s (100 m world record): inputs `{"distance_m":100,"time_s":9.58}` → `{"solved_for":"speed_m_s","speed_m_s":10.4384,"speed_km_h":37.5783,"speed_mph":23.3501,"distance_km":0.1}`
- 150 km at 25 m/s: inputs `{"distance_m":150000,"speed_m_s":25}` → `{"solved_for":"time_s","time_s":6000,"time_formatted":"1:40:00","speed_km_h":90}`

```
GET https://tttkmbb.com/api/v1/calculate/speed-distance-time?distance_m=100&time_s=9.58
```

## Limitations

Speed changes during the motion (use acceleration or free-fall), or you want a running pace per km or mile (use running-pace). Uniform (constant or average) motion in a straight line; the result is the average speed over the interval, not an instantaneous value. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Can I enter km and hours instead of metres and seconds?**

No; convert first (1 km = 1000 m, 1 h = 3600 s, 1 km/h = 0.27778 m/s). Outputs include km, km/h and mph twins so you rarely need to convert results.

**What if I give all three values?**

The calculator returns an INVALID_PARAMETER error: supply exactly two, and the third is computed.

## Related

- [Acceleration Calculator](https://tttkmbb.com/physics/acceleration.md) — When speed changes uniformly over the interval.
- [Running Pace Calculator](https://tttkmbb.com/fitness/running-pace.md) — Pace per kilometre or mile for runners.
- [Speed Converter](https://tttkmbb.com/conversion/speed.md) — Convert a known speed between m/s, km/h, mph and knots.


---

# Acceleration Calculator

> Computes average acceleration from initial velocity, final velocity and elapsed time, plus the velocity change, the distance covered assuming constant acceleration, and the acceleration expressed in g.

- Calculator id: `acceleration` · Category: Physics (`physics`) · Tool name: `calculate_acceleration`
- Canonical page: https://tttkmbb.com/physics/acceleration · This document: https://tttkmbb.com/physics/acceleration.md · JSON definition: https://tttkmbb.com/physics/acceleration.json

## Purpose

Computes average acceleration from initial velocity, final velocity and elapsed time, plus the velocity change, the distance covered assuming constant acceleration, and the acceleration expressed in g.

**Use when:** You have start and end velocities over a known time interval and need the acceleration or deceleration, or the distance covered while changing speed uniformly (0–100 km/h times, braking).

**Do not use when:** You know the net force and mass instead of velocities (use force), the motion is vertical under gravity alone (use free-fall), or you only need speed from distance and time (use speed-distance-time).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `initial_velocity_m_s` | number | m/s | optional, default 0 | Velocity at the start of the interval; 0 when starting from rest (km/h ÷ 3.6). |
| `final_velocity_m_s` | number | m/s | required | Velocity at the end of the interval; use 0 for coming to a stop. |
| `time_s` | number | s | required | Duration of the velocity change in seconds. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `acceleration_m_s2` | number | m/s² | Average acceleration; negative values mean deceleration. |
| `acceleration_g` | number | g | Acceleration as a multiple of standard gravity (÷ 9.80665). |
| `velocity_change_m_s` | number | m/s | final_velocity − initial_velocity. |
| `distance_m` | number | m | Displacement during the interval for constant acceleration: (u + v) / 2 × t. |

## Formula

`a = (final_velocity_m_s − initial_velocity_m_s) / time_s; acceleration_g = a / 9.80665; distance_m = (initial_velocity_m_s + final_velocity_m_s) / 2 × time_s`

Assumes constant acceleration over the interval; for varying acceleration the result is the average acceleration and the distance is approximate.

## Data Sources

- HyperPhysics – Motion equations for constant acceleration — http://hyperphysics.phy-astr.gsu.edu/hbase/mot.html (reference, retrieved 2026-09-23)
- Wikipedia – Acceleration — https://en.wikipedia.org/wiki/Acceleration (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/acceleration?final_velocity_m_s=…&time_s=…`
- `POST https://tttkmbb.com/api/v1/calculate/acceleration` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/acceleration · OpenAPI operationId `calculate_acceleration` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "acceleration", "inputs": {…}}`

## Example

- 0 to 100 km/h (27.78 m/s) in 8 s: inputs `{"initial_velocity_m_s":0,"final_velocity_m_s":27.78,"time_s":8}` → `{"acceleration_m_s2":3.4725,"acceleration_g":0.3541,"velocity_change_m_s":27.78,"distance_m":111.12}`
- Braking from 30 m/s to rest in 5 s: inputs `{"initial_velocity_m_s":30,"final_velocity_m_s":0,"time_s":5}` → `{"acceleration_m_s2":-6,"acceleration_g":-0.6118,"distance_m":75}`

```
GET https://tttkmbb.com/api/v1/calculate/acceleration?initial_velocity_m_s=0&final_velocity_m_s=27.78&time_s=8
```

## Limitations

You know the net force and mass instead of velocities (use force), the motion is vertical under gravity alone (use free-fall), or you only need speed from distance and time (use speed-distance-time). Assumes constant acceleration over the interval; for varying acceleration the result is the average acceleration and the distance is approximate. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is my acceleration negative?**

The final velocity is lower than the initial one, i.e. the object is slowing down (deceleration). The magnitude is the same as for speeding up.

**How do I convert km/h to m/s?**

Divide by 3.6: 100 km/h = 27.78 m/s. Mph × 0.44704 gives m/s.

## Related

- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Multiply by mass to get the net force (F = m·a).
- [Speed, Distance & Time Calculator](https://tttkmbb.com/physics/speed-distance-time.md) — Uniform motion without acceleration.
- [Free Fall Calculator](https://tttkmbb.com/physics/free-fall.md) — Acceleration due to gravity alone.


---

# Force Calculator

> Computes net force from mass and acceleration with Newton's second law, reported in newtons, kilonewtons and pounds-force, together with the object's weight under standard gravity.

- Calculator id: `newtons-second-law` · Category: Physics (`physics`) · Tool name: `calculate_force`
- Canonical page: https://tttkmbb.com/physics/newtons-second-law · This document: https://tttkmbb.com/physics/newtons-second-law.md · JSON definition: https://tttkmbb.com/physics/newtons-second-law.json

## Purpose

Computes net force from mass and acceleration with Newton's second law, reported in newtons, kilonewtons and pounds-force, together with the object's weight under standard gravity.

**Use when:** You know a mass and its acceleration (or deceleration) and need the net force, or you need an object's weight in newtons or pounds-force from its mass.

**Do not use when:** You need the gravitational pull between two bodies (use gravitational-force), a spring force (use hookes-law) or the force in circular motion (use centripetal-force).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | required | Mass of the object in kilograms. (> 0) |
| `acceleration_m_s2` | number | m/s² | required | Acceleration of the mass; negative for deceleration. Use 9.80665 for the force needed to hold the object against gravity. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `force_n` | number | N | Net force F = m·a. |
| `force_kn` | number | kN | Force in kilonewtons. |
| `force_lbf` | number | lbf | Force in pounds-force (1 lbf = 4.4482216152605 N). |
| `weight_n` | number | N | Weight of the mass under standard gravity: m × 9.80665. |
| `weight_lbf` | number | lbf | Weight in pounds-force. |

## Formula

`force_n = mass_kg × acceleration_m_s2; weight_n = mass_kg × 9.80665; force_lbf = force_n / 4.4482216152605; force_kn = force_n / 1000`

## Data Sources

- HyperPhysics – Newton's laws — http://hyperphysics.phy-astr.gsu.edu/hbase/newt.html (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/newtons-second-law?mass_kg=…&acceleration_m_s2=…`
- `POST https://tttkmbb.com/api/v1/calculate/newtons-second-law` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/newtons-second-law · OpenAPI operationId `calculate_force` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "newtons-second-law", "inputs": {…}}`

## Example

- 1200 kg car accelerating at 3 m/s²: inputs `{"mass_kg":1200,"acceleration_m_s2":3}` → `{"force_n":3600,"force_kn":3.6,"force_lbf":809.3122,"weight_n":11767.98}`
- 0.145 kg baseball at 2000 m/s²: inputs `{"mass_kg":0.145,"acceleration_m_s2":2000}` → `{"force_n":290,"weight_n":1.422}`

```
GET https://tttkmbb.com/api/v1/calculate/newtons-second-law?mass_kg=1200&acceleration_m_s2=3
```

## Limitations

You need the gravitational pull between two bodies (use gravitational-force), a spring force (use hookes-law) or the force in circular motion (use centripetal-force). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the difference between mass and weight?**

Mass (kg) is the amount of matter; weight is the gravitational force on it, W = m·g, measured in newtons. A 1 kg mass weighs 9.80665 N on Earth and about 1.62 N on the Moon.

**Is the force the net force?**

Yes. F = m·a gives the resultant of all forces; individual forces such as friction or thrust must be combined with vector addition to obtain a.

## Related

- [Acceleration Calculator](https://tttkmbb.com/physics/acceleration.md) — Get acceleration from velocities and time first.
- [Gravitational Force Calculator](https://tttkmbb.com/physics/gravitational-force.md) — Force between two masses by Newton's law of gravitation.
- [Pressure Calculator](https://tttkmbb.com/physics/pressure-force-area.md) — Divide a force by area to get pressure.


---

# Kinetic Energy Calculator

> Computes the translational kinetic energy of a moving mass from KE = ½·m·v², reported in joules, kilojoules, kilowatt-hours and kilocalories.

- Calculator id: `kinetic-energy` · Category: Physics (`physics`) · Tool name: `calculate_kinetic_energy`
- Canonical page: https://tttkmbb.com/physics/kinetic-energy · This document: https://tttkmbb.com/physics/kinetic-energy.md · JSON definition: https://tttkmbb.com/physics/kinetic-energy.json

## Purpose

Computes the translational kinetic energy of a moving mass from KE = ½·m·v², reported in joules, kilojoules, kilowatt-hours and kilocalories.

**Use when:** You need the energy of motion of an object of known mass and speed (vehicle, projectile, ball), for example to compare impact or braking energies.

**Do not use when:** Rotation contributes significantly (rotational energy ½·I·ω² is not included), speeds approach the speed of light (relativistic formula needed), or you need energy from height (use potential-energy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | required | Mass of the moving object in kilograms. (> 0) |
| `velocity_m_s` | number | m/s | required | Speed in metres per second (km/h ÷ 3.6, mph × 0.44704). Limited to 10 % of the speed of light, below which the classical formula is accurate to within 1 %. (min 0, max 30000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `kinetic_energy_j` | number | J | KE = ½ × m × v². |
| `kinetic_energy_kj` | number | kJ | Kinetic energy in kilojoules. |
| `kinetic_energy_kwh` | number | kWh | Kinetic energy in kilowatt-hours (J ÷ 3,600,000). |
| `kinetic_energy_kcal` | number | kcal | Kinetic energy in kilocalories (thermochemical, J ÷ 4184). |
| `velocity_km_h` | number | km/h | The input speed in km/h. |

## Formula

`KE = ½ × mass_kg × velocity_m_s²; kJ = J / 1000; kWh = J / 3,600,000; kcal = J / 4184`

## Data Sources

- HyperPhysics – Kinetic energy — http://hyperphysics.phy-astr.gsu.edu/hbase/ke.html (reference, retrieved 2026-09-23)
- Wikipedia – Kinetic energy — https://en.wikipedia.org/wiki/Kinetic_energy (reference, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/kinetic-energy?mass_kg=…&velocity_m_s=…`
- `POST https://tttkmbb.com/api/v1/calculate/kinetic-energy` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/kinetic-energy · OpenAPI operationId `calculate_kinetic_energy` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_kinetic_energy` (dedicated) or `run_calculator` with `{"calculator_id": "kinetic-energy", "inputs": {…}}`

## Example

- 1200 kg car at 25 m/s (90 km/h): inputs `{"mass_kg":1200,"velocity_m_s":25}` → `{"kinetic_energy_j":375000,"kinetic_energy_kj":375,"kinetic_energy_kwh":0.104167,"kinetic_energy_kcal":89.6272,"velocity_km_h":90}`
- 0.145 kg baseball at 40 m/s: inputs `{"mass_kg":0.145,"velocity_m_s":40}` → `{"kinetic_energy_j":116,"kinetic_energy_kj":0.116,"velocity_km_h":144}`

```
GET https://tttkmbb.com/api/v1/calculate/kinetic-energy?mass_kg=1200&velocity_m_s=25
```

## Limitations

Rotation contributes significantly (rotational energy ½·I·ω² is not included), speeds approach the speed of light (relativistic formula needed), or you need energy from height (use potential-energy). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why does doubling the speed quadruple the energy?**

Kinetic energy scales with the square of speed (v²), which is why braking distance and crash severity rise much faster than speed.

**Does direction matter?**

No. Kinetic energy is a scalar; only the magnitude of the velocity (speed) enters the formula.

## Related

- [Momentum Calculator](https://tttkmbb.com/physics/momentum.md) — Momentum p = m·v of the same object.
- [Potential Energy Calculator](https://tttkmbb.com/physics/potential-energy.md) — Energy stored by height, exchanged with kinetic energy in free fall.
- [Work & Power Calculator](https://tttkmbb.com/physics/work-power.md) — Work needed to produce this energy change.


---

# Potential Energy Calculator

> Computes the gravitational potential energy of a mass raised to a height near a planet's surface with PE = m·g·h (standard gravity by default), and the speed the mass would reach if it fell that height freely.

- Calculator id: `potential-energy` · Category: Physics (`physics`) · Tool name: `calculate_potential_energy`
- Canonical page: https://tttkmbb.com/physics/potential-energy · This document: https://tttkmbb.com/physics/potential-energy.md · JSON definition: https://tttkmbb.com/physics/potential-energy.json

## Purpose

Computes the gravitational potential energy of a mass raised to a height near a planet's surface with PE = m·g·h (standard gravity by default), and the speed the mass would reach if it fell that height freely.

**Use when:** You need the energy stored by lifting a mass to a height, the minimum work to lift it, or the energy released when it falls (lifted loads, pumped hydro, dropped objects).

**Do not use when:** Heights are a significant fraction of the planet's radius (g is not constant; use gravitational-force), or you need elastic energy (use hookes-law) or energy of motion (use kinetic-energy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | required | Mass of the object in kilograms. (> 0) |
| `height_m` | number | m | required | Height above the reference level (ground) in metres. (min 0) |
| `gravity_m_s2` | number | m/s² | optional, default 9.80665 | Local gravitational acceleration. Default is standard gravity g_n = 9.80665 m/s² (Moon ≈ 1.62, Mars ≈ 3.72, Jupiter ≈ 24.8). (> 0, max 10000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `potential_energy_j` | number | J | PE = m × g × h. |
| `potential_energy_kj` | number | kJ | Potential energy in kilojoules. |
| `potential_energy_kwh` | number | kWh | Potential energy in kilowatt-hours (J ÷ 3,600,000). |
| `fall_speed_m_s` | number | m/s | √(2·g·h): speed reached if all the potential energy became kinetic energy (no air resistance). |

## Formula

`PE = mass_kg × gravity_m_s2 × height_m; fall_speed_m_s = √(2 × gravity_m_s2 × height_m)`

Valid where g can be treated as constant (heights small compared with the planet's radius, i.e. within a few tens of kilometres of Earth's surface).

## Data Sources

- HyperPhysics – Gravitational potential energy — http://hyperphysics.phy-astr.gsu.edu/hbase/pegrav.html (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/potential-energy?mass_kg=…&height_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/potential-energy` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/potential-energy · OpenAPI operationId `calculate_potential_energy` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "potential-energy", "inputs": {…}}`

## Example

- 70 kg lifted 10 m: inputs `{"mass_kg":70,"height_m":10}` → `{"potential_energy_j":6864.655,"potential_energy_kj":6.864655,"potential_energy_kwh":0.001907,"fall_speed_m_s":14.0047}`
- 2 kg at 1.5 m with g = 9.81: inputs `{"mass_kg":2,"height_m":1.5,"gravity_m_s2":9.81}` → `{"potential_energy_j":29.43,"fall_speed_m_s":5.4249}`

```
GET https://tttkmbb.com/api/v1/calculate/potential-energy?mass_kg=70&height_m=10
```

## Limitations

Heights are a significant fraction of the planet's radius (g is not constant; use gravitational-force), or you need elastic energy (use hookes-law) or energy of motion (use kinetic-energy). Valid where g can be treated as constant (heights small compared with the planet's radius, i.e. within a few tens of kilometres of Earth's surface). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which reference level should I use?**

Any level you choose; only differences in potential energy matter. Height is measured from that reference, and objects below it have negative potential energy.

**Should I use 9.81 or 9.80665?**

9.80665 m/s² is the defined standard gravity; the actual value varies from about 9.78 at the equator to 9.83 at the poles. The difference is under 0.3 %.

## Related

- [Kinetic Energy Calculator](https://tttkmbb.com/physics/kinetic-energy.md) — Energy of motion gained when the object falls.
- [Free Fall Calculator](https://tttkmbb.com/physics/free-fall.md) — Fall time and impact speed from the same height.
- [Work & Power Calculator](https://tttkmbb.com/physics/work-power.md) — Power needed to lift the mass in a given time.


---

# Work & Power Calculator

> Computes the mechanical work done by a constant force over a displacement, allowing for the angle between force and motion, and the average power when the duration is supplied.

- Calculator id: `work-power` · Category: Physics (`physics`) · Tool name: `calculate_work_and_power`
- Canonical page: https://tttkmbb.com/physics/work-power · This document: https://tttkmbb.com/physics/work-power.md · JSON definition: https://tttkmbb.com/physics/work-power.json

## Purpose

Computes the mechanical work done by a constant force over a displacement, allowing for the angle between force and motion, and the average power when the duration is supplied.

**Use when:** You know a constant force, the distance it acts over (optionally the angle and the time taken) and need the work in joules or the average power in watts, kilowatts or horsepower.

**Do not use when:** The force varies with position (for springs use hookes-law), you need electrical power from volts and amps (use electric-power), or you need energy of motion (use kinetic-energy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `force_n` | number | N | required | Magnitude of the constant force in newtons (weight = mass × 9.80665). (min 0) |
| `distance_m` | number | m | required | Displacement of the point of application in metres. (min 0) |
| `angle_degrees` | number | ° | optional, default 0 | 0° when the force acts along the motion; 90° gives zero work; more than 90° gives negative work (e.g. friction). (min 0, max 180) |
| `time_s` | number | s | optional | Optional duration over which the work is done; enables the power outputs. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `work_j` | number | J | W = F × d × cos θ. |
| `work_kj` | number | kJ | Work in kilojoules. |
| `work_kwh` | number | kWh | Work in kilowatt-hours. |
| `power_w` | number | W | P = W / t (only when time_s is given). |
| `power_kw` | number | kW | Power in kilowatts (only when time_s is given). |
| `power_hp` | number | hp | Power in mechanical horsepower, 1 hp = 745.69987 W (only when time_s is given). |

## Formula

`work_j = force_n × distance_m × cos(angle_degrees); power_w = work_j / time_s; power_hp = power_w / 745.69987`

## Data Sources

- Wikipedia – Work (physics) — https://en.wikipedia.org/wiki/Work_(physics) (reference, retrieved 2026-09-23)
- Wikipedia – Power (physics) — https://en.wikipedia.org/wiki/Power_(physics) (reference, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/work-power?force_n=…&distance_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/work-power` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/work-power · OpenAPI operationId `calculate_work_and_power` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "work-power", "inputs": {…}}`

## Example

- 50 N over 10 m in 4 s: inputs `{"force_n":50,"distance_m":10,"time_s":4}` → `{"work_j":500,"work_kj":0.5,"power_w":125,"power_kw":0.125,"power_hp":0.1676}`
- 100 N at 60° over 20 m: inputs `{"force_n":100,"distance_m":20,"angle_degrees":60}` → `{"work_j":1000,"work_kj":1}`

```
GET https://tttkmbb.com/api/v1/calculate/work-power?force_n=50&distance_m=10&time_s=4
```

## Limitations

The force varies with position (for springs use hookes-law), you need electrical power from volts and amps (use electric-power), or you need energy of motion (use kinetic-energy). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the work zero at 90°?**

Only the force component along the displacement does work; a force perpendicular to the motion (like the normal force on a sliding block) transfers no energy.

**Which horsepower is used?**

Mechanical (imperial) horsepower, 745.69987 W. Metric horsepower (PS) is 735.49875 W, about 1.4 % smaller.

## Related

- [Kinetic Energy Calculator](https://tttkmbb.com/physics/kinetic-energy.md) — Net work equals the change in kinetic energy.
- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Electrical power from voltage and current.
- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Get the force from mass and acceleration.


---

# Momentum Calculator

> Computes linear momentum from mass and velocity, the matching kinetic energy, and, when a stopping time is given, the average force needed to bring the object to rest (impulse–momentum theorem).

- Calculator id: `momentum` · Category: Physics (`physics`) · Tool name: `calculate_momentum`
- Canonical page: https://tttkmbb.com/physics/momentum · This document: https://tttkmbb.com/physics/momentum.md · JSON definition: https://tttkmbb.com/physics/momentum.json

## Purpose

Computes linear momentum from mass and velocity, the matching kinetic energy, and, when a stopping time is given, the average force needed to bring the object to rest (impulse–momentum theorem).

**Use when:** You need an object's momentum, or the average force involved in stopping or launching it over a known time (collisions, braking, catching a ball).

**Do not use when:** You need the outcome of a two-body collision (conservation of momentum between two objects is not implemented), or only the energy of motion (use kinetic-energy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | required | Mass of the object in kilograms. (> 0) |
| `velocity_m_s` | number | m/s | required | Velocity in metres per second; sign indicates direction along the line of motion. |
| `stop_time_s` | number | s | optional | Optional time over which the object is brought to rest; enables the average force output. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `momentum_kg_m_s` | number | kg·m/s | p = m × v (same sign as the velocity). |
| `kinetic_energy_j` | number | J | ½ × m × v² for the same object. |
| `average_stopping_force_n` | number | N | \|p\| / stop_time_s: mean force to remove all momentum in the given time (only when stop_time_s is given). |

## Formula

`p = mass_kg × velocity_m_s; KE = ½ × mass_kg × velocity_m_s²; average_stopping_force_n = |p| / stop_time_s (impulse F·Δt = Δp)`

## Data Sources

- HyperPhysics – Momentum — http://hyperphysics.phy-astr.gsu.edu/hbase/mom.html (reference, retrieved 2026-09-23)
- Wikipedia – Momentum — https://en.wikipedia.org/wiki/Momentum (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/momentum?mass_kg=…&velocity_m_s=…`
- `POST https://tttkmbb.com/api/v1/calculate/momentum` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/momentum · OpenAPI operationId `calculate_momentum` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "momentum", "inputs": {…}}`

## Example

- 1200 kg car at 25 m/s stopped in 3 s: inputs `{"mass_kg":1200,"velocity_m_s":25,"stop_time_s":3}` → `{"momentum_kg_m_s":30000,"kinetic_energy_j":375000,"average_stopping_force_n":10000}`
- 57 g tennis ball at 50 m/s: inputs `{"mass_kg":0.057,"velocity_m_s":50}` → `{"momentum_kg_m_s":2.85,"kinetic_energy_j":71.25}`

```
GET https://tttkmbb.com/api/v1/calculate/momentum?mass_kg=1200&velocity_m_s=25&stop_time_s=3
```

## Limitations

You need the outcome of a two-body collision (conservation of momentum between two objects is not implemented), or only the energy of motion (use kinetic-energy). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the unit of momentum?**

Kilogram-metres per second (kg·m/s), equivalent to newton-seconds (N·s), the unit of impulse.

**Why does a longer stopping time reduce the force?**

The impulse (force × time) needed equals the momentum change, so spreading it over more time (crumple zones, airbags, bending the knees) lowers the average force.

## Related

- [Kinetic Energy Calculator](https://tttkmbb.com/physics/kinetic-energy.md) — Energy of the same moving object.
- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Force from mass and acceleration.


---

# Free Fall Calculator

> Computes the time to fall a given height from rest, or the height fallen in a given time, together with the final (impact) velocity, using h = ½·g·t² with no air resistance.

- Calculator id: `free-fall` · Category: Physics (`physics`) · Tool name: `calculate_free_fall`
- Canonical page: https://tttkmbb.com/physics/free-fall · This document: https://tttkmbb.com/physics/free-fall.md · JSON definition: https://tttkmbb.com/physics/free-fall.json

## Purpose

Computes the time to fall a given height from rest, or the height fallen in a given time, together with the final (impact) velocity, using h = ½·g·t² with no air resistance.

**Use when:** An object is dropped from rest near a planet's surface and you need how long it falls, how far, or how fast it lands (a dropped tool, a stone in a well).

**Do not use when:** Air drag matters (light or fast objects, skydivers, long falls near terminal velocity), the object has an initial velocity or launch angle (use projectile-motion), or heights are comparable to the planet's radius.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `height_m` | number | m | optional | Height fallen in metres. Give either height_m or time_s. (min 0) |
| `time_s` | number | s | optional | Fall duration in seconds. Give either height_m or time_s. (min 0) |
| `gravity_m_s2` | number | m/s² | optional, default 9.80665 | Local gravitational acceleration. Default is standard gravity g_n = 9.80665 m/s² (Moon ≈ 1.62, Mars ≈ 3.72, Jupiter ≈ 24.8). (> 0, max 10000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `fall_time_s` | number | s | Time to fall the height from rest: √(2h / g). |
| `height_m` | number | m | Distance fallen: ½ × g × t². |
| `final_velocity_m_s` | number | m/s | Velocity at the end of the fall: g × t = √(2gh). |
| `final_velocity_km_h` | number | km/h | Impact velocity in kilometres per hour. |
| `average_velocity_m_s` | number | m/s | Mean velocity over the fall, half the final velocity. |

## Formula

`fall_time_s = √(2 × height_m / g); height_m = ½ × g × time_s²; final_velocity_m_s = g × fall_time_s = √(2 × g × height_m)`

Object released from rest in a vacuum (no drag), constant g. In air, drag becomes noticeable for a human after roughly 2–3 s of fall and dominates for light objects.

## Data Sources

- Wikipedia – Equations for a falling body — https://en.wikipedia.org/wiki/Equations_for_a_falling_body (reference, retrieved 2026-09-23)
- HyperPhysics – Trajectories — http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/free-fall?`
- `POST https://tttkmbb.com/api/v1/calculate/free-fall` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/free-fall · OpenAPI operationId `calculate_free_fall` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "free-fall", "inputs": {…}}`

## Example

- Dropped from 20 m: inputs `{"height_m":20}` → `{"fall_time_s":2.0196,"height_m":20,"final_velocity_m_s":19.8057,"final_velocity_km_h":71.3005,"average_velocity_m_s":9.9029}`
- Falling for 3 s: inputs `{"time_s":3}` → `{"height_m":44.1299,"fall_time_s":3,"final_velocity_m_s":29.42}`

```
GET https://tttkmbb.com/api/v1/calculate/free-fall?height_m=20
```

## Limitations

Air drag matters (light or fast objects, skydivers, long falls near terminal velocity), the object has an initial velocity or launch angle (use projectile-motion), or heights are comparable to the planet's radius. Object released from rest in a vacuum (no drag), constant g. In air, drag becomes noticeable for a human after roughly 2–3 s of fall and dominates for light objects. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does the object's mass matter?**

Not without air resistance: all masses fall with the same acceleration g. With air, heavier and denser objects are affected less by drag.

**What if I know both the height and the time?**

Provide only one; the other is computed. Giving both returns an INVALID_PARAMETER error because they cannot be independent.

## Related

- [Projectile Motion Calculator](https://tttkmbb.com/physics/projectile-motion.md) — Launched objects with initial speed and angle.
- [Potential Energy Calculator](https://tttkmbb.com/physics/potential-energy.md) — Energy released by the fall.
- [Acceleration Calculator](https://tttkmbb.com/physics/acceleration.md) — General constant-acceleration kinematics.


---

# Projectile Motion Calculator

> Computes time of flight, horizontal range, maximum height and impact speed for a projectile launched at a given speed and angle from an optional initial height, ignoring air resistance (closed-form kinematics).

- Calculator id: `projectile-motion` · Category: Physics (`physics`) · Tool name: `calculate_projectile_motion`
- Canonical page: https://tttkmbb.com/physics/projectile-motion · This document: https://tttkmbb.com/physics/projectile-motion.md · JSON definition: https://tttkmbb.com/physics/projectile-motion.json

## Purpose

Computes time of flight, horizontal range, maximum height and impact speed for a projectile launched at a given speed and angle from an optional initial height, ignoring air resistance (closed-form kinematics).

**Use when:** You need where and when a thrown, kicked or fired object lands on level ground, or its peak height, from launch speed and angle (and launch height).

**Do not use when:** Air drag is significant (golf balls, bullets, shuttlecocks), the landing point is higher than the launch point, or the object is simply dropped (use free-fall).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `initial_speed_m_s` | number | m/s | required | Initial speed in metres per second. (min 0) |
| `angle_degrees` | number | ° | required | Angle above the horizontal in degrees (0 = horizontal, 90 = straight up). (min 0, max 90) |
| `initial_height_m` | number | m | optional, default 0 | Height of the launch point above the landing level, in metres. (min 0) |
| `gravity_m_s2` | number | m/s² | optional, default 9.80665 | Local gravitational acceleration. Default is standard gravity g_n = 9.80665 m/s² (Moon ≈ 1.62, Mars ≈ 3.72, Jupiter ≈ 24.8). (> 0, max 10000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `time_of_flight_s` | number | s | Time until the projectile returns to the landing level. |
| `range_m` | number | m | Horizontal distance travelled at landing. |
| `max_height_m` | number | m | Peak height above the landing level (includes the launch height). |
| `time_to_max_height_s` | number | s | Time at which the vertical velocity is zero: v·sin θ / g. |
| `horizontal_velocity_m_s` | number | m/s | Constant horizontal component v·cos θ. |
| `initial_vertical_velocity_m_s` | number | m/s | Vertical component at launch v·sin θ. |
| `impact_speed_m_s` | number | m/s | Speed at landing: √(v² + 2·g·h0). |

## Formula

`vx = v·cos θ, vy = v·sin θ; time_of_flight = (vy + √(vy² + 2·g·h0)) / g; range = vx × time_of_flight; max_height = h0 + vy² / (2g); time_to_max_height = vy / g; impact_speed = √(v² + 2·g·h0)`

Point projectile, no drag, uniform g, level landing surface; the time of flight is the positive root of h0 + vy·t − ½·g·t² = 0.

## Data Sources

- HyperPhysics – Trajectories — http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html (reference, retrieved 2026-09-23)
- Wikipedia – Projectile motion — https://en.wikipedia.org/wiki/Projectile_motion (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/projectile-motion?initial_speed_m_s=…&angle_degrees=…`
- `POST https://tttkmbb.com/api/v1/calculate/projectile-motion` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/projectile-motion · OpenAPI operationId `calculate_projectile_motion` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "projectile-motion", "inputs": {…}}`

## Example

- 20 m/s at 45° from ground level: inputs `{"initial_speed_m_s":20,"angle_degrees":45}` → `{"time_of_flight_s":2.8842,"range_m":40.7886,"max_height_m":10.1972,"time_to_max_height_s":1.4421,"horizontal_velocity_m_s":14.1421,"impact_speed_m_s":20}`
- 30 m/s at 30° from 10 m height: inputs `{"initial_speed_m_s":30,"angle_degrees":30,"initial_height_m":10}` → `{"time_of_flight_s":3.6222,"range_m":94.1072,"max_height_m":21.4718,"impact_speed_m_s":33.1079}`

```
GET https://tttkmbb.com/api/v1/calculate/projectile-motion?initial_speed_m_s=20&angle_degrees=45
```

## Limitations

Air drag is significant (golf balls, bullets, shuttlecocks), the landing point is higher than the launch point, or the object is simply dropped (use free-fall). Point projectile, no drag, uniform g, level landing surface; the time of flight is the positive root of h0 + vy·t − ½·g·t² = 0. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which angle gives the maximum range?**

45° when launching from ground level; the optimum is lower than 45° when launching from a height and higher when the target is above the launch point.

**How realistic is the no-drag result?**

Good for dense, slow objects (shot put, thrown stones). For a golf ball or bullet the real range can be far shorter than the calculated value.

## Related

- [Free Fall Calculator](https://tttkmbb.com/physics/free-fall.md) — The special case of a dropped object.
- [Quadratic Equation Solver](https://tttkmbb.com/math/quadratic-equation.md) — Solve the flight-time quadratic for other landing heights.
- [Speed, Distance & Time Calculator](https://tttkmbb.com/physics/speed-distance-time.md) — Horizontal motion is uniform.


---

# Ohm's Law Calculator

> Solves Ohm's law V = I·R for whichever of voltage, current or resistance is omitted and reports the electrical power dissipated (P = V·I).

- Calculator id: `ohms-law` · Category: Physics (`physics`) · Tool name: `solve_ohms_law`
- Canonical page: https://tttkmbb.com/physics/ohms-law · This document: https://tttkmbb.com/physics/ohms-law.md · JSON definition: https://tttkmbb.com/physics/ohms-law.json

## Purpose

Solves Ohm's law V = I·R for whichever of voltage, current or resistance is omitted and reports the electrical power dissipated (P = V·I).

**Use when:** You know two of voltage, current and resistance in a DC or purely resistive circuit and need the third and the power.

**Do not use when:** The load is reactive (inductors or capacitors require impedance, not resistance), you want energy cost over time (use electric-power), or you need the equivalent resistance of several resistors (use resistors-series-parallel).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `voltage_v` | number | V | optional | Potential difference across the component in volts. Omit to solve for it. (min 0) |
| `current_a` | number | A | optional | Current through the component in amperes (1 mA = 0.001 A). Omit to solve for it. (min 0) |
| `resistance_ohm` | number | Ω | optional | Resistance in ohms (1 kΩ = 1000 Ω). Omit to solve for it. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `solved_for` | string |  | Which quantity was computed: voltage_v, current_a or resistance_ohm. |
| `voltage_v` | number | V | V = I × R. |
| `current_a` | number | A | I = V / R. |
| `current_ma` | number | mA | Current in milliamperes. |
| `resistance_ohm` | number | Ω | R = V / I. |
| `power_w` | number | W | Power dissipated P = V × I. |

## Formula

`V = I × R; I = V / R; R = V / I; P = V × I = I² × R = V² / R`

## Data Sources

- HyperPhysics – Ohm's law — http://hyperphysics.phy-astr.gsu.edu/hbase/electric/ohmlaw.html (reference, retrieved 2026-09-23)
- Wikipedia – Ohm's law — https://en.wikipedia.org/wiki/Ohm%27s_law (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ohms-law?`
- `POST https://tttkmbb.com/api/v1/calculate/ohms-law` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ohms-law · OpenAPI operationId `solve_ohms_law` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `solve_ohms_law` (dedicated) or `run_calculator` with `{"calculator_id": "ohms-law", "inputs": {…}}`

## Example

- 12 V across 220 Ω: inputs `{"voltage_v":12,"resistance_ohm":220}` → `{"solved_for":"current_a","current_a":0.054545,"current_ma":54.545,"power_w":0.6545}`
- 2 A through 50 Ω: inputs `{"current_a":2,"resistance_ohm":50}` → `{"solved_for":"voltage_v","voltage_v":100,"power_w":200}`

```
GET https://tttkmbb.com/api/v1/calculate/ohms-law?voltage_v=12&resistance_ohm=220
```

## Limitations

The load is reactive (inductors or capacitors require impedance, not resistance), you want energy cost over time (use electric-power), or you need the equivalent resistance of several resistors (use resistors-series-parallel). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does Ohm's law apply to AC circuits?**

Only for purely resistive loads. With inductance or capacitance the relation becomes V = I·Z with complex impedance Z, and the power depends on the phase angle.

**Why does the power matter?**

A resistor must be rated above the dissipated power (e.g. 0.65 W needs at least a 1 W resistor) or it overheats.

## Related

- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Power, energy and running cost of an appliance.
- [Resistors in Series and Parallel Calculator](https://tttkmbb.com/physics/resistors-series-parallel.md) — Equivalent resistance of several resistors.


---

# Electric Power Calculator

> Computes electrical power from voltage and current (or the current drawn by a known power at a given voltage), the equivalent resistance, and, with hours of use and a tariff, the energy in kWh and its cost.

- Calculator id: `electric-power` · Category: Physics (`physics`) · Tool name: `calculate_electric_power`
- Canonical page: https://tttkmbb.com/physics/electric-power · This document: https://tttkmbb.com/physics/electric-power.md · JSON definition: https://tttkmbb.com/physics/electric-power.json

## Purpose

Computes electrical power from voltage and current (or the current drawn by a known power at a given voltage), the equivalent resistance, and, with hours of use and a tariff, the energy in kWh and its cost.

**Use when:** You need the wattage or amperage of an appliance, whether it fits a circuit rating, or how much energy and money it uses over a period.

**Do not use when:** The load has a power factor below 1 (motors, some electronics: P = V·I·cos φ), you only need V, I and R relations (use ohms-law), or you want a multi-appliance bill (use electricity-cost).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `voltage_v` | number | V | required | Supply voltage in volts (e.g. 230 in Europe, 120 in North America, 12 for automotive). (> 0) |
| `current_a` | number | A | optional | Current drawn in amperes. Give either current_a or power_w. (min 0) |
| `power_w` | number | W | optional | Rated power in watts. Give either current_a or power_w. (min 0) |
| `usage_hours` | number | h | optional | Optional operating time; enables the energy output. (min 0) |
| `price_per_kwh` | number | per kWh | optional | Optional tariff in your currency per kilowatt-hour; enables the cost output. (min 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `power_w` | number | W | P = V × I. |
| `power_kw` | number | kW | Power in kilowatts. |
| `current_a` | number | A | I = P / V. |
| `resistance_ohm` | number | Ω | R = V / I for a purely resistive load. |
| `energy_kwh` | number | kWh | P × usage_hours / 1000 (only when usage_hours is given). |
| `energy_cost` | number |  | energy_kwh × price_per_kwh (only when usage_hours and price_per_kwh are given). |

## Formula

`power_w = voltage_v × current_a (or current_a = power_w / voltage_v); resistance_ohm = voltage_v / current_a; energy_kwh = power_w × usage_hours / 1000; energy_cost = energy_kwh × price_per_kwh`

## Data Sources

- HyperPhysics – Electric power — http://hyperphysics.phy-astr.gsu.edu/hbase/electric/elepow.html (reference, retrieved 2026-09-23)
- Wikipedia – Electric power — https://en.wikipedia.org/wiki/Electric_power (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/electric-power?voltage_v=…`
- `POST https://tttkmbb.com/api/v1/calculate/electric-power` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/electric-power · OpenAPI operationId `calculate_electric_power` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "electric-power", "inputs": {…}}`

## Example

- 230 V, 6.5 A for 2 h at 0.30 per kWh: inputs `{"voltage_v":230,"current_a":6.5,"usage_hours":2,"price_per_kwh":0.3}` → `{"power_w":1495,"power_kw":1.495,"current_a":6.5,"resistance_ohm":35.3846,"energy_kwh":2.99,"energy_cost":0.9}`
- 1500 W heater on 120 V: inputs `{"voltage_v":120,"power_w":1500}` → `{"power_w":1500,"current_a":12.5,"resistance_ohm":9.6}`

```
GET https://tttkmbb.com/api/v1/calculate/electric-power?voltage_v=230&current_a=6.5&usage_hours=2&price_per_kwh=0.3
```

## Limitations

The load has a power factor below 1 (motors, some electronics: P = V·I·cos φ), you only need V, I and R relations (use ohms-law), or you want a multi-appliance bill (use electricity-cost). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is the nameplate wattage the actual consumption?**

It is the maximum rating. Thermostat-controlled appliances (heaters, fridges) draw it only part of the time, so real energy use is lower.

**What about three-phase or AC loads?**

For single-phase AC the formula gives apparent power (VA); real power is V·I·cos φ. Three-phase power is √3 × V_line × I × cos φ and is not covered here.

## Related

- [Ohm's Law Calculator](https://tttkmbb.com/physics/ohms-law.md) — Voltage, current and resistance relations.
- [Electricity Cost Calculator](https://tttkmbb.com/everyday/electricity-cost.md) — Running cost of several appliances over a period.
- [Work & Power Calculator](https://tttkmbb.com/physics/work-power.md) — Mechanical power from work and time.


---

# Density Calculator

> Solves ρ = m / V for whichever of density, mass or volume is omitted, and reports density in kg/m³ and g/cm³, volume in litres and cm³, and the specific gravity relative to water.

- Calculator id: `density-mass-volume` · Category: Physics (`physics`) · Tool name: `solve_density`
- Canonical page: https://tttkmbb.com/physics/density-mass-volume · This document: https://tttkmbb.com/physics/density-mass-volume.md · JSON definition: https://tttkmbb.com/physics/density-mass-volume.json

## Purpose

Solves ρ = m / V for whichever of density, mass or volume is omitted, and reports density in kg/m³ and g/cm³, volume in litres and cm³, and the specific gravity relative to water.

**Use when:** You know two of mass, volume and density of an object or substance and need the third, e.g. the mass of a steel block, the volume of a litre of oil, or whether an object floats.

**Do not use when:** The substance is a gas whose density depends strongly on pressure and temperature (use ideal-gas-law), or you need the volume of a shape first (use sphere, cylinder or rectangular-prism).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | optional | Mass in kilograms (1 g = 0.001 kg). Omit to solve for it. (min 0) |
| `volume_m3` | number | m³ | optional | Volume in cubic metres (1 L = 0.001 m³, 1 cm³ = 1e-6 m³). Omit to solve for it. (> 0) |
| `density_kg_m3` | number | kg/m³ | optional | Density in kg/m³ (1 g/cm³ = 1000 kg/m³; water ≈ 1000, steel ≈ 7850, aluminium ≈ 2700). Omit to solve for it. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `solved_for` | string |  | Which quantity was computed: density_kg_m3, mass_kg or volume_m3. |
| `density_kg_m3` | number | kg/m³ | ρ = m / V. |
| `density_g_cm3` | number | g/cm³ | Density in grams per cubic centimetre (= kg/L). |
| `mass_kg` | number | kg | Mass in kilograms. |
| `mass_g` | number | g | Mass in grams. |
| `volume_m3` | number | m³ | Volume in cubic metres. |
| `volume_l` | number | L | Volume in litres. |
| `volume_cm3` | number | cm³ | Volume in cubic centimetres. |
| `specific_gravity` | number |  | Density relative to water at 1000 kg/m³; below 1 the object floats in water. |
| `floats_in_water` | boolean |  | True when the density is below 1000 kg/m³. |

## Formula

`density_kg_m3 = mass_kg / volume_m3; mass_kg = density_kg_m3 × volume_m3; volume_m3 = mass_kg / density_kg_m3; density_g_cm3 = density_kg_m3 / 1000; specific_gravity = density_kg_m3 / 1000`

## Data Sources

- Wikipedia – Density — https://en.wikipedia.org/wiki/Density (reference, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/density-mass-volume?`
- `POST https://tttkmbb.com/api/v1/calculate/density-mass-volume` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/density-mass-volume · OpenAPI operationId `solve_density` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "density-mass-volume", "inputs": {…}}`

## Example

- 2 kg in 2.5 L: inputs `{"mass_kg":2,"volume_m3":0.0025}` → `{"solved_for":"density_kg_m3","density_kg_m3":800,"density_g_cm3":0.8,"volume_l":2.5,"specific_gravity":0.8,"floats_in_water":true}`
- 1 L of steel (7850 kg/m³): inputs `{"density_kg_m3":7850,"volume_m3":0.001}` → `{"solved_for":"mass_kg","mass_kg":7.85,"mass_g":7850,"floats_in_water":false}`

```
GET https://tttkmbb.com/api/v1/calculate/density-mass-volume?mass_kg=2&volume_m3=0.0025
```

## Limitations

The substance is a gas whose density depends strongly on pressure and temperature (use ideal-gas-law), or you need the volume of a shape first (use sphere, cylinder or rectangular-prism). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I enter volume in litres or cm³?**

Convert to m³ first: litres ÷ 1000, cm³ ÷ 1,000,000. The outputs report the volume in L and cm³ as well.

**Is specific gravity the same as density in g/cm³?**

Numerically almost: specific gravity is density divided by that of water (about 1000 kg/m³ at 4 °C), so it is dimensionless while g/cm³ has units.

## Related

- [Pressure Calculator](https://tttkmbb.com/physics/pressure-force-area.md) — Force and pressure exerted by a mass.
- [Sphere Calculator](https://tttkmbb.com/geometry/sphere.md) — Volume of a sphere for the density formula.
- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Volume of a cylinder for the density formula.


---

# Pressure Calculator

> Computes pressure as force divided by the area it acts on, and reports it in pascals, kilopascals, bar, pounds per square inch and standard atmospheres.

- Calculator id: `pressure-force-area` · Category: Physics (`physics`) · Tool name: `calculate_pressure`
- Canonical page: https://tttkmbb.com/physics/pressure-force-area · This document: https://tttkmbb.com/physics/pressure-force-area.md · JSON definition: https://tttkmbb.com/physics/pressure-force-area.json

## Purpose

Computes pressure as force divided by the area it acts on, and reports it in pascals, kilopascals, bar, pounds per square inch and standard atmospheres.

**Use when:** You know a force (or a weight in newtons) and the contact area and need the pressure: a load on a footing, a hydraulic piston, a heel on a floor.

**Do not use when:** You need fluid pressure at depth (P = ρ·g·h is not implemented), gas pressure from temperature and amount (use ideal-gas-law), or the force from a mass first (use force).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `force_n` | number | N | required | Force acting perpendicular to the surface, in newtons (weight = mass × 9.80665). (min 0) |
| `area_m2` | number | m² | required | Contact area in square metres (1 cm² = 0.0001 m²). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pressure_pa` | number | Pa | P = F / A in pascals (N/m²). |
| `pressure_kpa` | number | kPa | Pressure in kilopascals. |
| `pressure_bar` | number | bar | Pressure in bar (1 bar = 100,000 Pa). |
| `pressure_psi` | number | psi | Pressure in pounds-force per square inch (1 psi = 6894.757 Pa). |
| `pressure_atm` | number | atm | Pressure in standard atmospheres (1 atm = 101,325 Pa). |

## Formula

`pressure_pa = force_n / area_m2; kPa = Pa / 1000; bar = Pa / 100000; psi = Pa / 6894.757293; atm = Pa / 101325`

## Data Sources

- HyperPhysics – Pressure — http://hyperphysics.phy-astr.gsu.edu/hbase/pres.html (reference, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pressure-force-area?force_n=…&area_m2=…`
- `POST https://tttkmbb.com/api/v1/calculate/pressure-force-area` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pressure-force-area · OpenAPI operationId `calculate_pressure` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pressure-force-area", "inputs": {…}}`

## Example

- 500 N on 0.02 m²: inputs `{"force_n":500,"area_m2":0.02}` → `{"pressure_pa":25000,"pressure_kpa":25,"pressure_bar":0.25,"pressure_psi":3.6259,"pressure_atm":0.2467}`
- 700 N (71 kg person) on 0.05 m² (two feet): inputs `{"force_n":700,"area_m2":0.05}` → `{"pressure_pa":14000,"pressure_kpa":14,"pressure_psi":2.0305,"pressure_atm":0.1382}`

```
GET https://tttkmbb.com/api/v1/calculate/pressure-force-area?force_n=500&area_m2=0.02
```

## Limitations

You need fluid pressure at depth (P = ρ·g·h is not implemented), gas pressure from temperature and amount (use ideal-gas-law), or the force from a mass first (use force). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is this absolute or gauge pressure?**

Neither in particular: it is simply force over area. Gauge readings on tyres or vessels are relative to atmospheric pressure (add 101.325 kPa for absolute).

**Why does a small area give a huge pressure?**

Pressure is inversely proportional to area: the same weight on a stiletto heel (about 1 cm²) exerts hundreds of times the pressure of a flat shoe.

## Related

- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Compute the force from mass and acceleration or weight.
- [Density Calculator](https://tttkmbb.com/physics/density-mass-volume.md) — Density of the material exerting the load.
- [Ideal Gas Law Calculator](https://tttkmbb.com/chemistry/ideal-gas-law.md) — Gas pressure from volume, temperature and amount.


---

# Wavelength & Frequency Calculator

> Converts between wavelength and frequency for a wave of known propagation speed (default: the speed of light in vacuum) and, for electromagnetic waves in vacuum, reports the photon energy E = h·f in joules and electronvolts.

- Calculator id: `wavelength-frequency` · Category: Physics (`physics`) · Tool name: `convert_wavelength_frequency`
- Canonical page: https://tttkmbb.com/physics/wavelength-frequency · This document: https://tttkmbb.com/physics/wavelength-frequency.md · JSON definition: https://tttkmbb.com/physics/wavelength-frequency.json

## Purpose

Converts between wavelength and frequency for a wave of known propagation speed (default: the speed of light in vacuum) and, for electromagnetic waves in vacuum, reports the photon energy E = h·f in joules and electronvolts.

**Use when:** You know either the wavelength or the frequency of a light, radio or sound wave and need the other, or you need the photon energy of light of a given wavelength.

**Do not use when:** The wave travels in a dispersive medium (glass, water) unless you supply the correct phase speed, or you need Doppler shifts or refraction.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `wavelength_m` | number | m | optional | Wavelength in metres (1 nm = 1e-9 m, so 500 nm = 5e-7). Give either wavelength_m or frequency_hz. (> 0) |
| `frequency_hz` | number | Hz | optional | Frequency in hertz (1 MHz = 1e6 Hz, 1 GHz = 1e9 Hz). Give either wavelength_m or frequency_hz. (> 0) |
| `wave_speed_m_s` | number | m/s | optional, default 299792458 | Propagation speed in the medium. Default c = 299,792,458 m/s (light in vacuum); use about 343 for sound in air at 20 °C, 1480 for sound in water. (> 0, max 299792458) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `solved_for` | string |  | Which quantity was computed: wavelength_m or frequency_hz. |
| `wavelength_m` | number | m | λ = v / f. |
| `wavelength_nm` | number | nm | Wavelength in nanometres (visible light ≈ 380–750 nm). |
| `frequency_hz` | number | Hz | f = v / λ. |
| `wave_speed_m_s` | number | m/s | Propagation speed used. |
| `photon_energy_ev` | number | eV | E = h × f in electronvolts (only for electromagnetic waves in vacuum, i.e. wave_speed_m_s = c). |
| `photon_energy_j` | string | J | Photon energy in joules as a scientific-notation string with 5 significant figures, e.g. "3.9729e-19" (only when wave_speed_m_s = c). |

## Formula

`wavelength_m = wave_speed_m_s / frequency_hz; frequency_hz = wave_speed_m_s / wavelength_m; photon_energy_j = h × frequency_hz with h = 6.62607015e-34 J·s; photon_energy_ev = photon_energy_j / 1.602176634e-19`

## Data Sources

- Wikipedia – Wavelength — https://en.wikipedia.org/wiki/Wavelength (reference, retrieved 2026-09-23)
- Wikipedia – Photon energy — https://en.wikipedia.org/wiki/Photon_energy (reference, retrieved 2026-09-23)
- NIST CODATA 2018 – Fundamental Physical Constants — https://physics.nist.gov/cuu/Constants/ (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/wavelength-frequency?`
- `POST https://tttkmbb.com/api/v1/calculate/wavelength-frequency` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/wavelength-frequency · OpenAPI operationId `convert_wavelength_frequency` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "wavelength-frequency", "inputs": {…}}`

## Example

- Green light, 500 nm in vacuum: inputs `{"wavelength_m":5e-7}` → `{"solved_for":"frequency_hz","frequency_hz":599584916000000,"wavelength_nm":500,"photon_energy_ev":2.479684,"photon_energy_j":"3.9729e-19"}`
- 440 Hz sound in air (343 m/s): inputs `{"frequency_hz":440,"wave_speed_m_s":343}` → `{"solved_for":"wavelength_m","wavelength_m":0.779545,"wavelength_nm":779545454.5455}`

```
GET https://tttkmbb.com/api/v1/calculate/wavelength-frequency?wavelength_m=5e-7
```

## Limitations

The wave travels in a dispersive medium (glass, water) unless you supply the correct phase speed, or you need Doppler shifts or refraction. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is there no photon energy for my sound wave?**

Photon energy E = h·f applies to electromagnetic radiation only; it is reported when the wave speed equals c (vacuum). Sound is a mechanical wave.

**What speed should I use for light in glass or water?**

c divided by the refractive index (about 1.5 for glass, 1.33 for water); the frequency stays the same while the wavelength shortens.

## Related

- [Pendulum Period Calculator](https://tttkmbb.com/physics/pendulum.md) — Another periodic system: period and frequency of a pendulum.
- [Frequency Converter](https://tttkmbb.com/conversion/frequency.md) — Convert frequencies between Hz, kHz, MHz and GHz.


---

# Pendulum Period Calculator

> Computes the period, frequency and angular frequency of a simple pendulum from its length with the small-angle formula T = 2π√(L/g); when an amplitude is given it also returns the exact period from the arithmetic–geometric mean.

- Calculator id: `pendulum` · Category: Physics (`physics`) · Tool name: `calculate_pendulum_period`
- Canonical page: https://tttkmbb.com/physics/pendulum · This document: https://tttkmbb.com/physics/pendulum.md · JSON definition: https://tttkmbb.com/physics/pendulum.json

## Purpose

Computes the period, frequency and angular frequency of a simple pendulum from its length with the small-angle formula T = 2π√(L/g); when an amplitude is given it also returns the exact period from the arithmetic–geometric mean.

**Use when:** You need how long a pendulum of known length takes to swing on Earth or another body, or how much a large swing angle lengthens the period.

**Do not use when:** The bob's size or the rod's mass is not negligible (physical pendulum, T = 2π√(I / (m·g·d))), or the oscillator is a mass on a spring (use hookes-law).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `length_m` | number | m | required | Distance from the pivot to the centre of mass of the bob, in metres. (> 0) |
| `gravity_m_s2` | number | m/s² | optional, default 9.80665 | Local gravitational acceleration. Default is standard gravity g_n = 9.80665 m/s² (Moon ≈ 1.62, Mars ≈ 3.72, Jupiter ≈ 24.8). (> 0, max 10000) |
| `amplitude_degrees` | number | ° | optional | Optional maximum swing angle from vertical; enables the exact (large-amplitude) period. (min 0, max 170) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `period_s` | number | s | T = 2π√(L/g), one full back-and-forth swing. |
| `frequency_hz` | number | Hz | f = 1 / T. |
| `angular_frequency_rad_s` | number | rad/s | ω = √(g / L). |
| `period_at_amplitude_s` | number | s | Exact period T / agm(1, cos(θ0/2)) (only when amplitude_degrees is given). |
| `amplitude_correction_percent` | number | % | How much longer the exact period is than the small-angle value (only when amplitude_degrees is given). |

## Formula

`T = 2π × √(length_m / gravity_m_s2); f = 1 / T; ω = √(gravity_m_s2 / length_m); exact period for amplitude θ0: T_exact = T / agm(1, cos(θ0 / 2)) (arithmetic–geometric mean)`

The small-angle formula is within 0.1 % up to about 7° amplitude, 1.7 % low at 30° and 18 % low at 90°; the AGM result is exact for a point mass on a massless rod without friction.

## Data Sources

- HyperPhysics – Simple pendulum — http://hyperphysics.phy-astr.gsu.edu/hbase/pend.html (reference, retrieved 2026-09-23)
- Wikipedia – Pendulum (mechanics) — https://en.wikipedia.org/wiki/Pendulum_(mechanics) (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pendulum?length_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/pendulum` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pendulum · OpenAPI operationId `calculate_pendulum_period` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pendulum", "inputs": {…}}`

## Example

- 1 m pendulum, 30° amplitude: inputs `{"length_m":1,"amplitude_degrees":30}` → `{"period_s":2.0064,"frequency_hz":0.4984,"angular_frequency_rad_s":3.1316,"period_at_amplitude_s":2.0413,"amplitude_correction_percent":1.7409}`
- 0.25 m pendulum: inputs `{"length_m":0.25}` → `{"period_s":1.0032,"frequency_hz":0.9968}`

```
GET https://tttkmbb.com/api/v1/calculate/pendulum?length_m=1&amplitude_degrees=30
```

## Limitations

The bob's size or the rod's mass is not negligible (physical pendulum, T = 2π√(I / (m·g·d))), or the oscillator is a mass on a spring (use hookes-law). The small-angle formula is within 0.1 % up to about 7° amplitude, 1.7 % low at 30° and 18 % low at 90°; the AGM result is exact for a point mass on a massless rod without friction. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does the mass of the bob change the period?**

No. For a simple pendulum the period depends only on length and gravity; mass cancels out.

**What length gives a period of exactly 2 s?**

About 0.994 m at g = 9.80665 m/s² (L = g·T² / 4π²), the classic 'seconds pendulum' with a one-second half swing.

## Related

- [Hooke's Law Calculator](https://tttkmbb.com/physics/hookes-law.md) — Spring–mass oscillator period.
- [Free Fall Calculator](https://tttkmbb.com/physics/free-fall.md) — Another way to measure g.
- [Wavelength & Frequency Calculator](https://tttkmbb.com/physics/wavelength-frequency.md) — Frequency and period of waves.


---

# Hooke's Law Calculator

> Computes the restoring force of a linear spring and the elastic potential energy stored at a given displacement, plus the natural period and frequency of a mass on that spring when a mass is supplied.

- Calculator id: `hookes-law` · Category: Physics (`physics`) · Tool name: `calculate_hookes_law`
- Canonical page: https://tttkmbb.com/physics/hookes-law · This document: https://tttkmbb.com/physics/hookes-law.md · JSON definition: https://tttkmbb.com/physics/hookes-law.json

## Purpose

Computes the restoring force of a linear spring and the elastic potential energy stored at a given displacement, plus the natural period and frequency of a mass on that spring when a mass is supplied.

**Use when:** You know a spring constant and how far the spring is stretched or compressed and need the force or stored energy, or the oscillation period of a spring–mass system.

**Do not use when:** The spring is loaded beyond its elastic (linear) limit, or you need gravitational energy (use potential-energy) or a pendulum's period (use pendulum).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `spring_constant_n_m` | number | N/m | required | Stiffness k in newtons per metre. (> 0) |
| `displacement_m` | number | m | required | Extension (positive) or compression (negative) from the natural length, in metres (1 cm = 0.01 m). |
| `mass_kg` | number | kg | optional | Optional mass on the spring; enables the oscillation period and frequency outputs. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `force_n` | number | N | Magnitude of the restoring force \|k × x\|, directed back toward the natural length. |
| `elastic_potential_energy_j` | number | J | U = ½ × k × x². |
| `period_s` | number | s | T = 2π√(m / k) (only when mass_kg is given). |
| `frequency_hz` | number | Hz | f = 1 / T (only when mass_kg is given). |

## Formula

`force_n = spring_constant_n_m × |displacement_m|; U = ½ × spring_constant_n_m × displacement_m²; T = 2π × √(mass_kg / spring_constant_n_m); f = 1 / T`

Ideal massless linear spring (Hooke's law holds only within the elastic limit); the period formula ignores damping and the spring's own mass.

## Data Sources

- HyperPhysics – Elastic potential energy — http://hyperphysics.phy-astr.gsu.edu/hbase/pespr.html (reference, retrieved 2026-09-23)
- Wikipedia – Hooke's law — https://en.wikipedia.org/wiki/Hooke%27s_law (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/hookes-law?spring_constant_n_m=…&displacement_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/hookes-law` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/hookes-law · OpenAPI operationId `calculate_hookes_law` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "hookes-law", "inputs": {…}}`

## Example

- k = 200 N/m stretched 5 cm with 0.5 kg: inputs `{"spring_constant_n_m":200,"displacement_m":0.05,"mass_kg":0.5}` → `{"force_n":10,"elastic_potential_energy_j":0.25,"period_s":0.3142,"frequency_hz":3.1831}`
- k = 5000 N/m compressed 12 cm: inputs `{"spring_constant_n_m":5000,"displacement_m":-0.12}` → `{"force_n":600,"elastic_potential_energy_j":36}`

```
GET https://tttkmbb.com/api/v1/calculate/hookes-law?spring_constant_n_m=200&displacement_m=0.05&mass_kg=0.5
```

## Limitations

The spring is loaded beyond its elastic (linear) limit, or you need gravitational energy (use potential-energy) or a pendulum's period (use pendulum). Ideal massless linear spring (Hooke's law holds only within the elastic limit); the period formula ignores damping and the spring's own mass. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I find the spring constant?**

Hang a known mass and measure the extension: k = m·g / x. For example 0.5 kg stretching a spring 2.45 cm gives k = 0.5 × 9.80665 / 0.0245 ≈ 200 N/m.

**Does the sign of the displacement matter?**

Only for direction; the force magnitude and the stored energy are the same for equal stretch or compression.

## Related

- [Pendulum Period Calculator](https://tttkmbb.com/physics/pendulum.md) — Period of a pendulum oscillator.
- [Potential Energy Calculator](https://tttkmbb.com/physics/potential-energy.md) — Gravitational rather than elastic stored energy.
- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Force from mass and acceleration.


---

# Gravitational Force Calculator

> Computes the attractive gravitational force between two point or spherically symmetric masses at a given centre-to-centre distance with Newton's law and the CODATA 2018 value of G, plus the acceleration each mass experiences.

- Calculator id: `gravitational-force` · Category: Physics (`physics`) · Tool name: `calculate_gravitational_force`
- Canonical page: https://tttkmbb.com/physics/gravitational-force · This document: https://tttkmbb.com/physics/gravitational-force.md · JSON definition: https://tttkmbb.com/physics/gravitational-force.json

## Purpose

Computes the attractive gravitational force between two point or spherically symmetric masses at a given centre-to-centre distance with Newton's law and the CODATA 2018 value of G, plus the acceleration each mass experiences.

**Use when:** You need the gravitational pull between two bodies (planet and satellite, star and planet, two laboratory masses) or the surface gravity of a body from its mass and radius.

**Do not use when:** You only need weight near Earth's surface (use force with 9.80665 m/s²), or relativistic effects matter (near black holes, precision orbits).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass1_kg` | number | kg | required | First mass in kilograms (Earth = 5.972e24, Sun = 1.989e30). (> 0) |
| `mass2_kg` | number | kg | required | Second mass in kilograms (Moon = 7.342e22). (> 0) |
| `distance_m` | number | m | required | Centre-to-centre separation in metres (Earth's mean radius = 6.371e6, Earth–Moon = 3.844e8). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `force_n` | number | N | F = G × m1 × m2 / r², attractive along the line joining the centres (rounded to 1e-15 N). |
| `force_micronewton` | number | µN | Same force in micronewtons, convenient for laboratory-scale masses. |
| `acceleration_of_mass2_m_s2` | number | m/s² | F / m2 = G × m1 / r²: the gravitational field of mass 1 at that distance (surface gravity when r is the radius). |
| `acceleration_of_mass1_m_s2` | number | m/s² | F / m1 = G × m2 / r² (rounded to 1e-15 m/s²; negligible for planet-sized mass 1). |

## Formula

`force_n = G × mass1_kg × mass2_kg / distance_m² with G = 6.67430e-11 m³ kg⁻¹ s⁻²; acceleration_of_mass2 = force_n / mass2_kg; acceleration_of_mass1 = force_n / mass1_kg`

Point masses or uniform spheres (shell theorem); inside a body or for irregular shapes the inverse-square law does not apply directly.

## Data Sources

- NIST CODATA 2018 – Newtonian constant of gravitation G — https://physics.nist.gov/cgi-bin/cuu/Value?bg (standard, retrieved 2026-09-23)
- HyperPhysics – Gravity — http://hyperphysics.phy-astr.gsu.edu/hbase/grav.html (reference, retrieved 2026-09-23)
- Wikipedia – Newton's law of universal gravitation — https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/gravitational-force?mass1_kg=…&mass2_kg=…&distance_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/gravitational-force` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/gravitational-force · OpenAPI operationId `calculate_gravitational_force` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "gravitational-force", "inputs": {…}}`

## Example

- Earth and 1 kg at Earth's mean radius: inputs `{"mass1_kg":5.972e+24,"mass2_kg":1,"distance_m":6371000}` → `{"force_n":9.82,"force_micronewton":9819973,"acceleration_of_mass2_m_s2":9.82}`
- Two 1000 kg masses 1 m apart: inputs `{"mass1_kg":1000,"mass2_kg":1000,"distance_m":1}` → `{"force_n":0.000066743,"force_micronewton":66.743,"acceleration_of_mass1_m_s2":6.6743e-8}`

```
GET https://tttkmbb.com/api/v1/calculate/gravitational-force?mass1_kg=5.972e%2B24&mass2_kg=1&distance_m=6371000
```

## Limitations

You only need weight near Earth's surface (use force with 9.80665 m/s²), or relativistic effects matter (near black holes, precision orbits). Point masses or uniform spheres (shell theorem); inside a body or for irregular shapes the inverse-square law does not apply directly. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the result 9.82 and not 9.81 m/s² for Earth?**

The mean radius and mass give the field of a non-rotating uniform sphere; the measured surface value (about 9.80 average) is lowered by Earth's rotation and flattening.

**Which distance do I use for planets?**

The distance between the centres of mass, not between the surfaces: for surface gravity use the planet's radius.

## Related

- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Weight from mass and local g.
- [Potential Energy Calculator](https://tttkmbb.com/physics/potential-energy.md) — Energy of a mass at a height near the surface.
- [Centripetal Force Calculator](https://tttkmbb.com/physics/centripetal-force.md) — Force required to keep a satellite in circular orbit.


---

# Centripetal Force Calculator

> Computes the centripetal (centre-seeking) force and acceleration needed to keep a mass moving in a circle of given radius at a given speed, plus the angular velocity, rotation period and rpm.

- Calculator id: `centripetal-force` · Category: Physics (`physics`) · Tool name: `calculate_centripetal_force`
- Canonical page: https://tttkmbb.com/physics/centripetal-force · This document: https://tttkmbb.com/physics/centripetal-force.md · JSON definition: https://tttkmbb.com/physics/centripetal-force.json

## Purpose

Computes the centripetal (centre-seeking) force and acceleration needed to keep a mass moving in a circle of given radius at a given speed, plus the angular velocity, rotation period and rpm.

**Use when:** You need the force on a car in a bend, a mass on a string, a satellite or a centrifuge sample from mass, tangential speed and radius, or the g-load of circular motion.

**Do not use when:** You know the angular speed (rpm) rather than the tangential speed (compute v = ω·r first), or the motion is not circular at constant speed.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | required | Mass of the moving object in kilograms. (> 0) |
| `velocity_m_s` | number | m/s | required | Speed along the circular path in metres per second. (> 0) |
| `radius_m` | number | m | required | Radius of the circular path in metres. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `centripetal_force_n` | number | N | F = m × v² / r, directed toward the centre. |
| `centripetal_acceleration_m_s2` | number | m/s² | a = v² / r. |
| `acceleration_g` | number | g | Centripetal acceleration in multiples of 9.80665 m/s². |
| `angular_velocity_rad_s` | number | rad/s | ω = v / r. |
| `period_s` | number | s | Time for one revolution, 2π r / v. |
| `rpm` | number | rpm | 60 / period. |

## Formula

`centripetal_acceleration = velocity_m_s² / radius_m; centripetal_force_n = mass_kg × velocity_m_s² / radius_m; ω = velocity_m_s / radius_m; period_s = 2π × radius_m / velocity_m_s; rpm = 60 / period_s`

## Data Sources

- HyperPhysics – Centripetal force — http://hyperphysics.phy-astr.gsu.edu/hbase/cf.html (reference, retrieved 2026-09-23)
- Wikipedia – Centripetal force — https://en.wikipedia.org/wiki/Centripetal_force (reference, retrieved 2026-09-23)
- NIST CODATA – standard acceleration of gravity g_n = 9.80665 m/s² — https://physics.nist.gov/cgi-bin/cuu/Value?gn (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/centripetal-force?mass_kg=…&velocity_m_s=…&radius_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/centripetal-force` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/centripetal-force · OpenAPI operationId `calculate_centripetal_force` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "centripetal-force", "inputs": {…}}`

## Example

- 1200 kg car at 20 m/s in a 50 m bend: inputs `{"mass_kg":1200,"velocity_m_s":20,"radius_m":50}` → `{"centripetal_force_n":9600,"centripetal_acceleration_m_s2":8,"acceleration_g":0.8158,"angular_velocity_rad_s":0.4,"period_s":15.708,"rpm":3.8197}`
- 0.5 kg on a 0.75 m string at 3 m/s: inputs `{"mass_kg":0.5,"velocity_m_s":3,"radius_m":0.75}` → `{"centripetal_force_n":6,"centripetal_acceleration_m_s2":12,"angular_velocity_rad_s":4,"period_s":1.5708,"rpm":38.1972}`

```
GET https://tttkmbb.com/api/v1/calculate/centripetal-force?mass_kg=1200&velocity_m_s=20&radius_m=50
```

## Limitations

You know the angular speed (rpm) rather than the tangential speed (compute v = ω·r first), or the motion is not circular at constant speed. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What provides the centripetal force?**

Whatever real force points toward the centre: friction for a car in a bend, tension for a string, gravity for a satellite. If that force cannot reach the required value the object leaves the circle.

**Is centrifugal force the same thing?**

Centrifugal force is the apparent outward force felt in the rotating frame; it has the same magnitude as the centripetal force but is not a real force in an inertial frame.

## Related

- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Newton's second law in general.
- [Acceleration Calculator](https://tttkmbb.com/physics/acceleration.md) — Linear acceleration from velocity change.
- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — Circumference of the circular path.


---

# Specific Heat Calculator

> Computes the heat energy needed to change the temperature of a mass of material by a given amount from Q = m·c·ΔT, using the specific heat capacity of liquid water (4186 J/(kg·K)) by default.

- Calculator id: `specific-heat` · Category: Physics (`physics`) · Tool name: `calculate_specific_heat_energy`
- Canonical page: https://tttkmbb.com/physics/specific-heat · This document: https://tttkmbb.com/physics/specific-heat.md · JSON definition: https://tttkmbb.com/physics/specific-heat.json

## Purpose

Computes the heat energy needed to change the temperature of a mass of material by a given amount from Q = m·c·ΔT, using the specific heat capacity of liquid water (4186 J/(kg·K)) by default.

**Use when:** You need how much energy heats or cools a known mass of water, metal or another substance by a given number of degrees, without a phase change.

**Do not use when:** The substance melts, boils or freezes within the range (latent heat is not included), or you need the final temperature when two bodies are mixed (calorimetry is not implemented).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass_kg` | number | kg | required | Mass of the substance in kilograms (1 L of water ≈ 1 kg). (> 0) |
| `specific_heat_j_kg_k` | number | J/(kg·K) | optional, default 4186 | Specific heat capacity: water 4186, ice 2090, steam 2010, aluminium 897, iron 449, copper 385, air ≈ 1005, ethanol 2440. (> 0) |
| `temperature_change_k` | number | K | required | Temperature rise in kelvin (identical to the °C difference); negative when the substance cools and releases heat. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `heat_j` | number | J | Q = m × c × ΔT; negative means heat released. |
| `heat_kj` | number | kJ | Heat in kilojoules. |
| `heat_kcal` | number | kcal | Heat in kilocalories (thermochemical calorie, 4184 J). |
| `heat_kwh` | number | kWh | Heat in kilowatt-hours (J ÷ 3,600,000). |

## Formula

`heat_j = mass_kg × specific_heat_j_kg_k × temperature_change_k; kJ = J / 1000; kcal = J / 4184; kWh = J / 3,600,000`

Assumes a constant specific heat over the temperature range and no phase change; water's value varies by under 1 % between 0 and 100 °C.

## Data Sources

- HyperPhysics – Specific heat — http://hyperphysics.phy-astr.gsu.edu/hbase/thermo/spht.html (reference, retrieved 2026-09-23)
- Wikipedia – Table of specific heat capacities — https://en.wikipedia.org/wiki/Table_of_specific_heat_capacities (reference, retrieved 2026-09-23)
- NIST Special Publication 811 – Guide for the Use of the SI, Appendix B (conversion factors) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/specific-heat?mass_kg=…&temperature_change_k=…`
- `POST https://tttkmbb.com/api/v1/calculate/specific-heat` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/specific-heat · OpenAPI operationId `calculate_specific_heat_energy` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "specific-heat", "inputs": {…}}`

## Example

- Heat 2 kg of water by 30 K: inputs `{"mass_kg":2,"temperature_change_k":30}` → `{"heat_j":251160,"heat_kj":251.16,"heat_kcal":60.0287,"heat_kwh":0.069767}`
- Heat 0.5 kg of aluminium (897) by 50 K: inputs `{"mass_kg":0.5,"specific_heat_j_kg_k":897,"temperature_change_k":50}` → `{"heat_j":22425,"heat_kj":22.425,"heat_kcal":5.3597}`

```
GET https://tttkmbb.com/api/v1/calculate/specific-heat?mass_kg=2&temperature_change_k=30
```

## Limitations

The substance melts, boils or freezes within the range (latent heat is not included), or you need the final temperature when two bodies are mixed (calorimetry is not implemented). Assumes a constant specific heat over the temperature range and no phase change; water's value varies by under 1 % between 0 and 100 °C. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is a temperature change in °C the same as in K?**

Yes. A difference of 30 °C is a difference of 30 K, so ΔT can be entered from Celsius readings directly.

**How long does heating take with a given heater?**

Divide the heat in joules by the heater power in watts: 251,160 J with a 2000 W kettle takes about 126 s at 100 % efficiency.

## Related

- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Energy delivered by an electric heater over time.
- [Energy Converter](https://tttkmbb.com/conversion/energy.md) — Convert the result between J, kcal, kWh and BTU.
- [Temperature Converter](https://tttkmbb.com/conversion/temperature.md) — Convert temperatures between °C, °F and K.


---

# Resistors in Series and Parallel Calculator

> Computes the equivalent resistance of a list of resistors connected all in series (sum) and all in parallel (reciprocal of the sum of reciprocals), plus the parallel conductance.

- Calculator id: `resistors-series-parallel` · Category: Physics (`physics`) · Tool name: `calculate_resistors_series_parallel`
- Canonical page: https://tttkmbb.com/physics/resistors-series-parallel · This document: https://tttkmbb.com/physics/resistors-series-parallel.md · JSON definition: https://tttkmbb.com/physics/resistors-series-parallel.json

## Purpose

Computes the equivalent resistance of a list of resistors connected all in series (sum) and all in parallel (reciprocal of the sum of reciprocals), plus the parallel conductance.

**Use when:** You have two or more resistor values and need the total resistance if they are wired in series or in parallel, or want to check a parallel combination against a target value.

**Do not use when:** The network mixes series and parallel branches (reduce it group by group with repeated calls), the components are capacitors or inductors, or you need voltage, current or power for one resistor (use ohms-law).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `resistances_ohm` | number_list | Ω | required | Resistor values in ohms, comma-separated (1 kΩ = 1000). All values must be positive. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `resistor_count` | integer |  | How many values were combined. |
| `series_total_ohm` | number | Ω | R1 + R2 + … (always larger than the largest resistor). |
| `parallel_total_ohm` | number | Ω | 1 / (1/R1 + 1/R2 + …) (always smaller than the smallest resistor). |
| `parallel_conductance_s` | number | S | Sum of conductances 1/R1 + 1/R2 + … in siemens. |

## Formula

`series_total_ohm = R1 + R2 + …; 1 / parallel_total_ohm = 1/R1 + 1/R2 + …`

## Data Sources

- HyperPhysics – Resistance and resistor combinations — http://hyperphysics.phy-astr.gsu.edu/hbase/electric/resis.html (reference, retrieved 2026-09-23)
- Wikipedia – Series and parallel circuits — https://en.wikipedia.org/wiki/Series_and_parallel_circuits (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/resistors-series-parallel?resistances_ohm=…`
- `POST https://tttkmbb.com/api/v1/calculate/resistors-series-parallel` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/resistors-series-parallel · OpenAPI operationId `calculate_resistors_series_parallel` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "resistors-series-parallel", "inputs": {…}}`

## Example

- 100, 220 and 470 Ω: inputs `{"resistances_ohm":[100,220,470]}` → `{"resistor_count":3,"series_total_ohm":790,"parallel_total_ohm":59.9768,"parallel_conductance_s":0.016673}`
- Two 10 Ω resistors: inputs `{"resistances_ohm":[10,10]}` → `{"resistor_count":2,"series_total_ohm":20,"parallel_total_ohm":5}`

```
GET https://tttkmbb.com/api/v1/calculate/resistors-series-parallel?resistances_ohm=100%2C220%2C470
```

## Limitations

The network mixes series and parallel branches (reduce it group by group with repeated calls), the components are capacitors or inductors, or you need voltage, current or power for one resistor (use ohms-law). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I handle a mixed circuit?**

Reduce it step by step: combine each purely parallel or purely series group into one equivalent resistor, then combine the results, calling this calculator for each group.

**Why is the parallel total less than the smallest resistor?**

Each added parallel path lets more current flow at the same voltage, increasing total conductance; n equal resistors R in parallel give R / n.

## Related

- [Ohm's Law Calculator](https://tttkmbb.com/physics/ohms-law.md) — Voltage, current and power for the equivalent resistance.
- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Power and energy drawn by the circuit.


---

# Molar Mass Calculator

> Parses a chemical formula (including brackets, nested groups and hydrates) and sums IUPAC 2021 standard atomic weights to give the molar mass in g/mol, plus the atom count and mass-percent composition of each element.

- Calculator id: `molar-mass` · Category: Chemistry (`chemistry`) · Tool name: `calculate_molar_mass`
- Canonical page: https://tttkmbb.com/chemistry/molar-mass · This document: https://tttkmbb.com/chemistry/molar-mass.md · JSON definition: https://tttkmbb.com/chemistry/molar-mass.json

## Purpose

Parses a chemical formula (including brackets, nested groups and hydrates) and sums IUPAC 2021 standard atomic weights to give the molar mass in g/mol, plus the atom count and mass-percent composition of each element.

**Use when:** You have a chemical formula and need its molar mass (molecular weight), the number of atoms of each element, or its elemental mass-percent composition.

**Do not use when:** You already know the molar mass and want to convert between grams and moles (use moles-mass) or need a solution concentration (use molarity).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `formula` | string |  | required | Chemical formula with case-sensitive element symbols, integer subscripts, brackets and optional hydrate dot, e.g. C6H12O6, Ca(OH)2, Fe2(SO4)3, CuSO4·5H2O. A trailing charge (NH4+, SO4^2-) or state (aq) is ignored. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `molar_mass_g_mol` | number | g/mol | Sum of atomic weight × atom count over all elements. |
| `molecular_mass_da` | number | Da | Same value expressed in daltons (unified atomic mass units) per molecule or formula unit. |
| `atom_count` | integer |  | Total number of atoms in one formula unit. |
| `element_count` | integer |  | Number of distinct elements in the formula. |
| `composition` | list |  | Per element: symbol, atom count, atomic weight, contributed mass (g/mol) and mass fraction in percent. |

## Formula

`molar_mass = Σ (atomic_weight_i × count_i); mass_fraction_percent_i = 100 × atomic_weight_i × count_i / molar_mass`

Atomic weights are the IUPAC 2021 abridged standard values (conventional values for elements whose weight is given as an interval, e.g. H 1.008, C 12.011, O 15.999, S 32.06, Cl 35.45); the result is therefore reproducible to 3 decimals but not identical to tables using more digits. Radioactive elements without a standard atomic weight use the mass number of their longest-lived isotope.

## Data Sources

- IUPAC – Atomic Weights of the Elements (2021 table with 2023 revisions, Queen Mary University of London mirror) — https://iupac.qmul.ac.uk/AtWt/ (standard, retrieved 2026-09-23)
- CIAAW – Standard atomic weights (current values) — https://www.ciaaw.org/atomic-weights.htm (standard, retrieved 2026-09-23)
- OpenStax Chemistry 2e – 3.1 Formula Mass and the Mole Concept — https://openstax.org/books/chemistry-2e/pages/3-1-formula-mass-and-the-mole-concept (textbook, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/molar-mass?formula=…`
- `POST https://tttkmbb.com/api/v1/calculate/molar-mass` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/molar-mass · OpenAPI operationId `calculate_molar_mass` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_molar_mass` (dedicated) or `run_calculator` with `{"calculator_id": "molar-mass", "inputs": {…}}`

## Example

- Glucose C6H12O6: inputs `{"formula":"C6H12O6"}` → `{"molar_mass_g_mol":180.156,"atom_count":24,"element_count":3,"composition":[{"element":"C","count":6,"mass_fraction_percent":40.002},{"element":"H","count":12,"mass_fraction_percent":6.714},{"element":"O","count":6,"mass_fraction_percent":53.284}]}`
- Copper(II) sulfate pentahydrate CuSO4·5H2O: inputs `{"formula":"CuSO4·5H2O"}` → `{"molar_mass_g_mol":249.677,"atom_count":21,"element_count":4}`

```
GET https://tttkmbb.com/api/v1/calculate/molar-mass?formula=C6H12O6
```

## Limitations

You already know the molar mass and want to convert between grams and moles (use moles-mass) or need a solution concentration (use molarity). Atomic weights are the IUPAC 2021 abridged standard values (conventional values for elements whose weight is given as an interval, e.g. H 1.008, C 12.011, O 15.999, S 32.06, Cl 35.45); the result is therefore reproducible to 3 decimals but not identical to tables using more digits. Radioactive elements without a standard atomic weight use the mass number of their longest-lived isotope. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which atomic weights are used?**

IUPAC 2021 standard atomic weights abridged to five significant figures (H 1.008, C 12.011, N 14.007, O 15.999, Na 22.990, Cl 35.45, Fe 55.845). Textbooks using more digits or older tables may differ in the third decimal.

**Can I enter ions, hydrates or states?**

Yes: NH4+, NO3-, SO4^2- or 'CO3 2-' drop the charge (electron mass is negligible), CuSO4·5H2O (also written CuSO4.5H2O or CuSO4*5H2O) adds five waters, and (aq)/(s)/(l)/(g) is ignored. Write multi-digit charges as Fe^3+ or 'Fe 3+', because Fe3+ is read as three iron atoms.

**Why is my formula rejected?**

Element symbols are case-sensitive (Co ≠ CO, nacl is invalid), subscripts must be positive integers, and every opening bracket needs a closing one. Structural notation such as CH3-CH2-OH is not parsed; write C2H6O instead.

## Related

- [Moles to Grams Calculator](https://tttkmbb.com/chemistry/moles-mass.md) — Convert grams of this substance to moles and number of molecules.
- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Turn a mass of this compound into a solution concentration.
- [Mass Percent Calculator](https://tttkmbb.com/chemistry/mass-percent.md) — Mass percent of a solute in a solution rather than of an element in a compound.


---

# Moles to Grams Calculator

> Converts between mass in grams and amount in moles using the molar mass (from a formula or given directly), and reports the number of molecules or formula units from the Avogadro constant. Any two of molar mass, mass and moles give the third.

- Calculator id: `moles-mass` · Category: Chemistry (`chemistry`) · Tool name: `convert_moles_and_mass`
- Canonical page: https://tttkmbb.com/chemistry/moles-mass · This document: https://tttkmbb.com/chemistry/moles-mass.md · JSON definition: https://tttkmbb.com/chemistry/moles-mass.json

## Purpose

Converts between mass in grams and amount in moles using the molar mass (from a formula or given directly), and reports the number of molecules or formula units from the Avogadro constant. Any two of molar mass, mass and moles give the third.

**Use when:** You need to convert grams to moles or moles to grams for a substance, count the molecules in a sample, or back out a molar mass from a measured mass and amount.

**Do not use when:** You only need the molar mass of a formula (use molar-mass), or you want a concentration in mol/L (use molarity).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `formula` | string |  | optional | Chemical formula, e.g. NaCl, C6H12O6, Ca(OH)2 or CuSO4·5H2O (case-sensitive element symbols). Alternative to molar_mass_g_mol. |
| `molar_mass_g_mol` | number | g/mol | optional | Molar mass of the substance; use instead of formula when it is already known. (> 0, max 10000000) |
| `mass_g` | number | g | optional | Mass of the sample in grams. Leave empty to solve for it. (> 0) |
| `moles` | number | mol | optional | Amount in moles. Leave empty to solve for it. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `molar_mass_g_mol` | number | g/mol | Molar mass used or derived (mass_g / moles). |
| `mass_g` | number | g | Mass of the sample. |
| `moles` | number | mol | Amount of substance. |
| `millimoles` | number | mmol | Amount in millimoles. |
| `molecules` | number |  | moles × 6.02214076×10²³ (molecules for molecular substances, formula units for ionic compounds, atoms for elements). |
| `molecules_scientific` | string |  | The same count in scientific notation. |
| `solved_for` | string |  | Which quantity was computed: mass_g, moles or molar_mass_g_mol. |

## Formula

`moles = mass_g / molar_mass_g_mol; mass_g = moles × molar_mass_g_mol; molecules = moles × N_A (N_A = 6.02214076×10²³ mol⁻¹)`

## Data Sources

- NIST – CODATA internationally recommended values of the fundamental physical constants (Avogadro constant N_A = 6.02214076×10²³ mol⁻¹, exact) — https://physics.nist.gov/cuu/Constants/index.html (standard, retrieved 2026-09-23)
- IUPAC – Atomic Weights of the Elements (2021 table with 2023 revisions, Queen Mary University of London mirror) — https://iupac.qmul.ac.uk/AtWt/ (standard, retrieved 2026-09-23)
- OpenStax Chemistry 2e – 3.1 Formula Mass and the Mole Concept — https://openstax.org/books/chemistry-2e/pages/3-1-formula-mass-and-the-mole-concept (textbook, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/moles-mass?`
- `POST https://tttkmbb.com/api/v1/calculate/moles-mass` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/moles-mass · OpenAPI operationId `convert_moles_and_mass` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "moles-mass", "inputs": {…}}`

## Example

- 36.03 g of water: inputs `{"formula":"H2O","mass_g":36.03}` → `{"molar_mass_g_mol":18.015,"moles":2,"millimoles":2000,"molecules":1.204428152e+24,"solved_for":"moles"}`
- 0.5 mol of CO2: inputs `{"formula":"CO2","moles":0.5}` → `{"molar_mass_g_mol":44.009,"mass_g":22.0045,"molecules":3.01107038e+23,"solved_for":"mass_g"}`

```
GET https://tttkmbb.com/api/v1/calculate/moles-mass?formula=H2O&mass_g=36.03
```

## Limitations

You only need the molar mass of a formula (use molar-mass), or you want a concentration in mol/L (use molarity). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I get the molar mass without a formula?**

Give molar_mass_g_mol directly, or give both mass_g and moles and the calculator returns molar_mass_g_mol = mass_g / moles (useful for identifying an unknown).

**Does 'molecules' apply to ionic compounds?**

For NaCl or CaCO3 the count is formula units rather than discrete molecules; for a monatomic element it is the number of atoms.

## Related

- [Molar Mass Calculator](https://tttkmbb.com/chemistry/molar-mass.md) — Look up or check the molar mass and composition of the formula.
- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Use the moles to compute a solution concentration.
- [Ideal Gas Law Calculator](https://tttkmbb.com/chemistry/ideal-gas-law.md) — Relate moles of a gas to its pressure, volume and temperature.


---

# Molarity Calculator

> Computes molar concentration (mol/L) of a solution from the amount of solute (moles, or mass with a formula or molar mass) and the solution volume, or the moles and mass of solute needed to prepare a target molarity.

- Calculator id: `molarity` · Category: Chemistry (`chemistry`) · Tool name: `calculate_molarity`
- Canonical page: https://tttkmbb.com/chemistry/molarity · This document: https://tttkmbb.com/chemistry/molarity.md · JSON definition: https://tttkmbb.com/chemistry/molarity.json

## Purpose

Computes molar concentration (mol/L) of a solution from the amount of solute (moles, or mass with a formula or molar mass) and the solution volume, or the moles and mass of solute needed to prepare a target molarity.

**Use when:** You need the molarity of a solution from what was dissolved, or the grams of solute required for a given volume and target concentration.

**Do not use when:** You are diluting an existing stock solution (use dilution), or you need a mass-based concentration such as % w/w, ppm or ppb (use mass-percent).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `volume_l` | number | L | required | Total volume of the solution in litres (250 mL = 0.25). (> 0) |
| `moles` | number | mol | optional | Amount of solute in moles. Takes precedence over mass_g. (> 0) |
| `mass_g` | number | g | optional | Mass of solute in grams; requires formula or molar_mass_g_mol. (> 0) |
| `formula` | string |  | optional | Chemical formula, e.g. NaCl, C6H12O6, Ca(OH)2 or CuSO4·5H2O (case-sensitive element symbols). Alternative to molar_mass_g_mol. |
| `molar_mass_g_mol` | number | g/mol | optional | Molar mass of the substance; use instead of formula when it is already known. (> 0, max 10000000) |
| `target_molarity_mol_per_l` | number | mol/L | optional | Desired concentration; when given, the calculator returns the moles and mass of solute needed for volume_l instead (moles and mass_g are ignored). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `molarity_mol_per_l` | number | mol/L | Moles of solute per litre of solution (M). |
| `millimolar` | number | mmol/L | Same concentration in millimoles per litre (mM). |
| `moles` | number | mol | Amount of solute in the solution. |
| `mass_g` | number | g | Mass of solute (only when the molar mass is known). |
| `molar_mass_g_mol` | number | g/mol | Molar mass used (only when formula or molar_mass_g_mol was given). |
| `mass_concentration_g_per_l` | number | g/L | Grams of solute per litre of solution (only when the molar mass is known). |
| `volume_ml` | number | mL | Solution volume in millilitres. |
| `solved_for` | string |  | molarity_mol_per_l when computing a concentration, mass_g when computing what to weigh for a target molarity. |

## Formula

`molarity = moles / volume_l, with moles = mass_g / molar_mass_g_mol; for a target: moles = target_molarity × volume_l and mass_g = moles × molar_mass_g_mol`

Molarity refers to the final volume of solution, not the volume of solvent added; volume changes with temperature, so molarity is usually stated at 20–25 °C.

## Data Sources

- OpenStax Chemistry 2e – 3.3 Molarity — https://openstax.org/books/chemistry-2e/pages/3-3-molarity (textbook, retrieved 2026-09-23)
- Wikipedia – Molar concentration — https://en.wikipedia.org/wiki/Molar_concentration (reference, retrieved 2026-09-23)
- IUPAC – Atomic Weights of the Elements (2021 table with 2023 revisions, Queen Mary University of London mirror) — https://iupac.qmul.ac.uk/AtWt/ (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/molarity?volume_l=…`
- `POST https://tttkmbb.com/api/v1/calculate/molarity` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/molarity · OpenAPI operationId `calculate_molarity` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "molarity", "inputs": {…}}`

## Example

- 5.844 g NaCl in 0.5 L: inputs `{"volume_l":0.5,"mass_g":5.844,"formula":"NaCl"}` → `{"molarity_mol_per_l":0.2,"millimolar":200,"moles":0.1,"molar_mass_g_mol":58.44,"mass_concentration_g_per_l":11.688,"solved_for":"molarity_mol_per_l"}`
- Prepare 250 mL of 0.1 M NaOH: inputs `{"volume_l":0.25,"target_molarity_mol_per_l":0.1,"formula":"NaOH"}` → `{"moles":0.025,"mass_g":0.9999,"molar_mass_g_mol":39.997,"molarity_mol_per_l":0.1,"solved_for":"mass_g"}`

```
GET https://tttkmbb.com/api/v1/calculate/molarity?volume_l=0.5&mass_g=5.844&formula=NaCl
```

## Limitations

You are diluting an existing stock solution (use dilution), or you need a mass-based concentration such as % w/w, ppm or ppb (use mass-percent). Molarity refers to the final volume of solution, not the volume of solvent added; volume changes with temperature, so molarity is usually stated at 20–25 °C. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is the volume the water added or the final solution?**

The final solution volume. Dissolve the solute in less solvent than needed, then make up to the mark in a volumetric flask.

**What if I know the mass but not the formula?**

Enter molar_mass_g_mol instead of formula. Without either, only moles can be used to compute molarity.

## Related

- [Dilution Calculator](https://tttkmbb.com/chemistry/dilution.md) — Dilute the resulting stock to a lower concentration with C1V1 = C2V2.
- [Molar Mass Calculator](https://tttkmbb.com/chemistry/molar-mass.md) — Check the molar mass used for the mass-to-moles conversion.
- [Moles to Grams Calculator](https://tttkmbb.com/chemistry/moles-mass.md) — Plain gram/mole conversion without a volume.


---

# Dilution Calculator

> Applies the dilution equation C1·V1 = C2·V2 to find the missing one of stock concentration, stock volume, final concentration or final volume, plus the solvent to add and the dilution factor.

- Calculator id: `dilution` · Category: Chemistry (`chemistry`) · Tool name: `calculate_dilution`
- Canonical page: https://tttkmbb.com/chemistry/dilution · This document: https://tttkmbb.com/chemistry/dilution.md · JSON definition: https://tttkmbb.com/chemistry/dilution.json

## Purpose

Applies the dilution equation C1·V1 = C2·V2 to find the missing one of stock concentration, stock volume, final concentration or final volume, plus the solvent to add and the dilution factor.

**Use when:** You are diluting a stock solution and need how much stock to take, the final volume to make up, or the concentration that results.

**Do not use when:** You are preparing a solution from solid solute (use molarity) or the concentrations are in mass percent with very different densities (C1V1 = C2V2 assumes volumes are additive and the unit is amount per volume).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `stock_concentration` | number |  | optional | Concentration of the stock solution in any unit (M, mM, mg/mL, %, X); all concentrations share the unit. (> 0) |
| `stock_volume` | number |  | optional | Volume of stock solution taken, in any unit shared with final_volume (mL, L, µL). (> 0) |
| `final_concentration` | number |  | optional | Concentration after dilution, same unit as stock_concentration. (> 0) |
| `final_volume` | number |  | optional | Total volume after dilution, same unit as stock_volume. Leave empty to solve for it. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `stock_concentration` | number |  | C1, given or solved. |
| `stock_volume` | number |  | V1, given or solved. |
| `final_concentration` | number |  | C2, given or solved. |
| `final_volume` | number |  | V2, given or solved. |
| `solvent_volume_to_add` | number |  | V2 − V1: diluent (water, buffer) to add to the stock volume. |
| `dilution_factor` | number |  | C1 / C2 = V2 / V1, e.g. 4 means a 1:4 (4×) dilution. |
| `solved_for` | string |  | Name of the quantity that was left empty and computed. |

## Formula

`C1 × V1 = C2 × V2; solvent_volume_to_add = V2 − V1; dilution_factor = C1 / C2`

Exactly three of the four quantities must be given. The relation assumes the amount of solute is conserved and volumes are additive, which holds well for dilute aqueous solutions.

## Data Sources

- OpenStax Chemistry 2e – 3.3 Molarity – Dilution of Solutions — https://openstax.org/books/chemistry-2e/pages/3-3-molarity (textbook, retrieved 2026-09-23)
- Wikipedia – Dilution — https://en.wikipedia.org/wiki/Dilution (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/dilution?`
- `POST https://tttkmbb.com/api/v1/calculate/dilution` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/dilution · OpenAPI operationId `calculate_dilution` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "dilution", "inputs": {…}}`

## Example

- 2 M stock, 25 mL, to 0.5 M: inputs `{"stock_concentration":2,"stock_volume":25,"final_concentration":0.5}` → `{"final_volume":100,"solvent_volume_to_add":75,"dilution_factor":4,"solved_for":"final_volume"}`
- 10 mL of 0.1 M made up to 250 mL: inputs `{"stock_concentration":0.1,"stock_volume":10,"final_volume":250}` → `{"final_concentration":0.004,"solvent_volume_to_add":240,"dilution_factor":25,"solved_for":"final_concentration"}`

```
GET https://tttkmbb.com/api/v1/calculate/dilution?stock_concentration=2&stock_volume=25&final_concentration=0.5
```

## Limitations

You are preparing a solution from solid solute (use molarity) or the concentrations are in mass percent with very different densities (C1V1 = C2V2 assumes volumes are additive and the unit is amount per volume). Exactly three of the four quantities must be given. The relation assumes the amount of solute is conserved and volumes are additive, which holds well for dilute aqueous solutions. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which units can I use?**

Any, as long as both concentrations share one unit and both volumes share one unit; the result comes out in the same units (e.g. mM and µL).

**What is the difference between a 1:4 dilution and a 1-in-4 dilution?**

Both conventions exist; here dilution_factor = 4 means 1 part stock brought to 4 parts total (3 parts solvent added), which is the C1V1 = C2V2 interpretation.

## Related

- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Prepare the stock solution from solid solute first.
- [Mass Percent Calculator](https://tttkmbb.com/chemistry/mass-percent.md) — Mass-based concentration units (%, ppm, ppb).


---

# Ideal Gas Law Calculator

> Solves the ideal gas equation PV = nRT for whichever of pressure, volume, amount or temperature is left empty, with pressure in atm, kPa, bar, mmHg or psi and temperature in °C, K or °F.

- Calculator id: `ideal-gas-law` · Category: Chemistry (`chemistry`) · Tool name: `solve_ideal_gas_law`
- Canonical page: https://tttkmbb.com/chemistry/ideal-gas-law · This document: https://tttkmbb.com/chemistry/ideal-gas-law.md · JSON definition: https://tttkmbb.com/chemistry/ideal-gas-law.json

## Purpose

Solves the ideal gas equation PV = nRT for whichever of pressure, volume, amount or temperature is left empty, with pressure in atm, kPa, bar, mmHg or psi and temperature in °C, K or °F.

**Use when:** You know three of pressure, volume, moles and temperature of a gas and need the fourth, or the molar volume at given conditions.

**Do not use when:** The gas is near condensation or at very high pressure (use a real-gas equation such as van der Waals), or you need the mass of gas without knowing its molar mass (combine with moles-mass).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `pressure` | number |  | optional | Gas pressure in the unit given by pressure_unit. Leave empty to solve for it. (> 0) |
| `pressure_unit` | enum: atm \| kpa \| bar \| mmhg \| psi |  | optional, default "atm" | Unit of the pressure input (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi). |
| `volume_l` | number | L | optional | Gas volume in litres. Leave empty to solve for it. (> 0) |
| `moles` | number | mol | optional | Amount of gas in moles. Leave empty to solve for it. (> 0) |
| `temperature` | number |  | optional | Gas temperature in the unit given by temperature_unit (must be above absolute zero). Leave empty to solve for it. (min -459.67, max 10000000) |
| `temperature_unit` | enum: celsius \| kelvin \| fahrenheit |  | optional, default "celsius" | Unit of the temperature input; the calculation uses kelvin. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `solved_for` | string |  | pressure, volume_l, moles or temperature. |
| `pressure_atm` | number | atm | Pressure in standard atmospheres. |
| `pressure_kpa` | number | kPa | Pressure in kilopascals (1 atm = 101.325 kPa). |
| `pressure_bar` | number | bar | Pressure in bar (1 atm = 1.01325 bar). |
| `volume_l` | number | L | Gas volume in litres. |
| `moles` | number | mol | Amount of gas. |
| `temperature_k` | number | K | Absolute temperature. |
| `temperature_c` | number | °C | Temperature in degrees Celsius. |
| `molar_volume_l_per_mol` | number | L/mol | V / n at these conditions (22.414 L/mol at 0 °C and 1 atm). |

## Formula

`P × V = n × R × T with R = 0.082057366 L·atm/(mol·K) (= 8.314462618 J/(mol·K)); P converted to atm, T to kelvin (K = °C + 273.15)`

Ideal-gas behaviour is accurate to about 1% for common gases near room temperature and pressures up to a few atmospheres; deviations grow near the boiling point and above roughly 10 atm.

## Data Sources

- NIST – CODATA internationally recommended values of the fundamental physical constants (molar gas constant R = 8.314462618 J/(mol·K), exact) — https://physics.nist.gov/cuu/Constants/index.html (standard, retrieved 2026-09-23)
- OpenStax Chemistry 2e – 9.2 Relating Pressure, Volume, Amount, and Temperature: The Ideal Gas Law — https://openstax.org/books/chemistry-2e/pages/9-2-relating-pressure-volume-amount-and-temperature-the-ideal-gas-law (textbook, retrieved 2026-09-23)
- Wikipedia – Ideal gas law — https://en.wikipedia.org/wiki/Ideal_gas_law (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ideal-gas-law?`
- `POST https://tttkmbb.com/api/v1/calculate/ideal-gas-law` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ideal-gas-law · OpenAPI operationId `solve_ideal_gas_law` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ideal-gas-law", "inputs": {…}}`

## Example

- Molar volume at 0 °C and 1 atm: inputs `{"pressure":1,"pressure_unit":"atm","moles":1,"temperature":0,"temperature_unit":"celsius"}` → `{"solved_for":"volume_l","volume_l":22.414,"molar_volume_l_per_mol":22.414,"temperature_k":273.15,"pressure_kpa":101.325}`
- Moles in 5 L at 101.325 kPa and 25 °C: inputs `{"pressure":101.325,"pressure_unit":"kpa","volume_l":5,"temperature":25}` → `{"solved_for":"moles","moles":0.20437,"pressure_atm":1,"temperature_k":298.15,"molar_volume_l_per_mol":24.4654}`

```
GET https://tttkmbb.com/api/v1/calculate/ideal-gas-law?pressure=1&pressure_unit=atm&moles=1&temperature=0&temperature_unit=celsius
```

## Limitations

The gas is near condensation or at very high pressure (use a real-gas equation such as van der Waals), or you need the mass of gas without knowing its molar mass (combine with moles-mass). Ideal-gas behaviour is accurate to about 1% for common gases near room temperature and pressures up to a few atmospheres; deviations grow near the boiling point and above roughly 10 atm. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the molar volume 22.414 L and not 22.7 L?**

22.414 L/mol applies at 0 °C and 1 atm (101.325 kPa). IUPAC's current STP is 0 °C and 1 bar (100 kPa), which gives 22.711 L/mol; enter pressure 1 bar to reproduce it.

**Can I enter temperature in Celsius?**

Yes, temperature_unit defaults to celsius and the value is converted to kelvin internally; temperatures at or below absolute zero are rejected.

## Related

- [Moles to Grams Calculator](https://tttkmbb.com/chemistry/moles-mass.md) — Convert the moles of gas to mass or number of molecules.
- [Pressure Converter](https://tttkmbb.com/conversion/pressure.md) — Pressure expressed in Pa, kPa, bar, psi and atm (or from force and area).
- [Temperature Converter](https://tttkmbb.com/conversion/temperature.md) — Convert between Celsius, Fahrenheit and kelvin.


---

# pH Calculator

> Converts between pH, pOH, hydrogen-ion concentration and hydroxide-ion concentration at 25 °C (Kw = 1.0×10⁻¹⁴) from any one of them, and classifies the solution as acidic, neutral or basic.

- Calculator id: `ph` · Category: Chemistry (`chemistry`) · Tool name: `calculate_ph`
- Canonical page: https://tttkmbb.com/chemistry/ph · This document: https://tttkmbb.com/chemistry/ph.md · JSON definition: https://tttkmbb.com/chemistry/ph.json

## Purpose

Converts between pH, pOH, hydrogen-ion concentration and hydroxide-ion concentration at 25 °C (Kw = 1.0×10⁻¹⁴) from any one of them, and classifies the solution as acidic, neutral or basic.

**Use when:** You know one of pH, pOH, [H⁺] or [OH⁻] for an aqueous solution (for example the concentration of a fully dissociated strong acid or base) and need the others.

**Do not use when:** The solution contains a weak acid or base or a buffer, where [H⁺] is not equal to the nominal concentration (use henderson-hasselbalch for buffers), or the temperature differs a lot from 25 °C.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `h_concentration_mol_per_l` | number | mol/L | optional | Hydrogen-ion (hydronium) concentration, e.g. the molarity of a strong monoprotic acid such as HCl. (> 0, max 100) |
| `oh_concentration_mol_per_l` | number | mol/L | optional | Hydroxide-ion concentration, e.g. the molarity of NaOH. Used when [H⁺] is not given. (> 0, max 100) |
| `ph` | number |  | optional | Known pH; when given it takes precedence over the other inputs. (min -2, max 16) |
| `poh` | number |  | optional | Known pOH; used when pH is not given. (min -2, max 16) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ph` | number |  | −log10[H⁺]. |
| `poh` | number |  | −log10[OH⁻] = 14 − pH at 25 °C. |
| `h_concentration_mol_per_l` | number | mol/L | Hydrogen-ion concentration = 10^(−pH). |
| `oh_concentration_mol_per_l` | number | mol/L | Hydroxide-ion concentration = 10^(−pOH) = Kw / [H⁺]. |
| `h_concentration_scientific` | string |  | [H⁺] in scientific notation, mol/L. |
| `oh_concentration_scientific` | string |  | [OH⁻] in scientific notation, mol/L. |
| `classification` | string |  | Acidic (pH < 7), Neutral (pH = 7) or Basic (pH > 7) at 25 °C. |

## Formula

`pH = −log10[H⁺]; pOH = −log10[OH⁻]; pH + pOH = pKw = 14.00 at 25 °C; [H⁺] × [OH⁻] = Kw = 1.0×10⁻¹⁴`

Assumes an aqueous solution at 25 °C and that a strong acid or base is completely dissociated, so [H⁺] (or [OH⁻]) equals its nominal molarity; activity effects at high concentration and the autoionisation contribution below about 10⁻⁶ mol/L are ignored.

## Data Sources

- OpenStax Chemistry 2e – 14.2 pH and pOH — https://openstax.org/books/chemistry-2e/pages/14-2-ph-and-poh (textbook, retrieved 2026-09-23)
- Wikipedia – pH — https://en.wikipedia.org/wiki/PH (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/ph?`
- `POST https://tttkmbb.com/api/v1/calculate/ph` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/ph · OpenAPI operationId `calculate_ph` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "ph", "inputs": {…}}`

## Example

- 0.001 M HCl: inputs `{"h_concentration_mol_per_l":0.001}` → `{"ph":3,"poh":11,"oh_concentration_mol_per_l":1e-11,"h_concentration_scientific":"1.000e-3","classification":"Acidic"}`
- pH 8.5 solution: inputs `{"ph":8.5}` → `{"poh":5.5,"h_concentration_mol_per_l":3.1623e-9,"oh_concentration_mol_per_l":0.0000031623,"h_concentration_scientific":"3.162e-9","classification":"Basic (alkaline)"}`

```
GET https://tttkmbb.com/api/v1/calculate/ph?h_concentration_mol_per_l=0.001
```

## Limitations

The solution contains a weak acid or base or a buffer, where [H⁺] is not equal to the nominal concentration (use henderson-hasselbalch for buffers), or the temperature differs a lot from 25 °C. Assumes an aqueous solution at 25 °C and that a strong acid or base is completely dissociated, so [H⁺] (or [OH⁻]) equals its nominal molarity; activity effects at high concentration and the autoionisation contribution below about 10⁻⁶ mol/L are ignored. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the pH of a 10⁻⁸ M HCl solution not 8?**

Below about 10⁻⁶ mol/L the H⁺ from water's autoionisation matters and the real pH stays just under 7; this calculator ignores that contribution and reports the formal value.

**Does the neutral point change with temperature?**

Yes. Kw rises with temperature, so neutral water has pH 7.00 only at 25 °C (about 6.63 at 50 °C); all results here use pKw = 14.00.

## Related

- [Henderson–Hasselbalch Calculator](https://tttkmbb.com/chemistry/henderson-hasselbalch.md) — pH of a buffer from pKa and the acid/base ratio.
- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Get the acid or base molarity that sets [H⁺] or [OH⁻].
- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — General log10 calculations.


---

# Half-Life Calculator

> Computes first-order exponential decay: given two of half-life, elapsed time and remaining amount (with an initial amount) it solves the third and reports the remaining fraction, number of half-lives, decay constant and mean lifetime.

- Calculator id: `half-life` · Category: Chemistry (`chemistry`) · Tool name: `calculate_half_life_decay`
- Canonical page: https://tttkmbb.com/chemistry/half-life · This document: https://tttkmbb.com/chemistry/half-life.md · JSON definition: https://tttkmbb.com/chemistry/half-life.json

## Purpose

Computes first-order exponential decay: given two of half-life, elapsed time and remaining amount (with an initial amount) it solves the third and reports the remaining fraction, number of half-lives, decay constant and mean lifetime.

**Use when:** You need how much of a radioactive isotope, drug or other first-order decaying quantity remains after a time, or the half-life or elapsed time implied by a measured remaining amount.

**Do not use when:** The process is not first-order (e.g. zero-order elimination, growth, or compound interest – use compound-interest for money) or several isotopes decay in a chain.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `initial_amount` | number |  | optional, default 100 | Starting quantity in any unit (g, Bq, atoms, mg/L). Default 100 makes remaining_amount a percentage. (> 0) |
| `half_life` | number |  | optional | Half-life in any time unit (same unit as elapsed_time). Leave empty to solve for it. (> 0) |
| `elapsed_time` | number |  | optional | Time elapsed, same unit as half_life. Leave empty to solve for it. (min 0) |
| `remaining_amount` | number |  | optional | Quantity left after elapsed_time, same unit as initial_amount. Leave empty to solve for it. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `remaining_amount` | number |  | N(t) = N0 × (1/2)^(t / half_life). |
| `remaining_fraction` | number |  | N(t) / N0. |
| `remaining_percent` | number | % | 100 × N(t) / N0. |
| `decayed_amount` | number |  | N0 − N(t). |
| `number_of_half_lives` | number |  | elapsed_time / half_life. |
| `half_life` | number |  | Half-life, given or solved (time unit of the inputs). |
| `elapsed_time` | number |  | Elapsed time, given or solved (time unit of the inputs). |
| `decay_constant` | number |  | ln 2 / half_life, per time unit of the inputs. |
| `mean_lifetime` | number |  | 1 / λ = half_life / ln 2. |
| `solved_for` | string |  | remaining_amount, half_life or elapsed_time. |

## Formula

`N(t) = N0 × (1/2)^(t / t½) = N0 × e^(−λt); λ = ln 2 / t½; τ = 1 / λ; t½ = t / log2(N0 / N); t = t½ × log2(N0 / N)`

First-order kinetics: the decay rate is proportional to the amount present, so the same fraction decays in every half-life regardless of the starting amount.

## Data Sources

- OpenStax Chemistry 2e – 21.3 Radioactive Decay — https://openstax.org/books/chemistry-2e/pages/21-3-radioactive-decay (textbook, retrieved 2026-09-23)
- Wikipedia – Half-life — https://en.wikipedia.org/wiki/Half-life (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/half-life?`
- `POST https://tttkmbb.com/api/v1/calculate/half-life` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/half-life · OpenAPI operationId `calculate_half_life_decay` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "half-life", "inputs": {…}}`

## Example

- Carbon-14 after 11,460 years: inputs `{"initial_amount":100,"half_life":5730,"elapsed_time":11460}` → `{"remaining_amount":25,"remaining_fraction":0.25,"number_of_half_lives":2,"decay_constant":0.00012097,"mean_lifetime":8266.6,"solved_for":"remaining_amount"}`
- 80 mg of iodine-131 falls to 10 mg in 24.06 days: inputs `{"initial_amount":80,"remaining_amount":10,"elapsed_time":24.06}` → `{"half_life":8.02,"number_of_half_lives":3,"remaining_percent":12.5,"decay_constant":0.086427,"solved_for":"half_life"}`

```
GET https://tttkmbb.com/api/v1/calculate/half-life?initial_amount=100&half_life=5730&elapsed_time=11460
```

## Limitations

The process is not first-order (e.g. zero-order elimination, growth, or compound interest – use compound-interest for money) or several isotopes decay in a chain. First-order kinetics: the decay rate is proportional to the amount present, so the same fraction decays in every half-life regardless of the starting amount. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which time unit should I use?**

Any, as long as half_life and elapsed_time share it; the decay constant and mean lifetime are then per that unit (e.g. per year for a half-life in years).

**Does this work for drug elimination?**

Yes for drugs with first-order (linear) elimination, using the plasma half-life; about 97% is eliminated after 5 half-lives. Zero-order elimination (e.g. ethanol at high doses) is not modelled.

## Related

- [Moles to Grams Calculator](https://tttkmbb.com/chemistry/moles-mass.md) — Convert the remaining mass of an isotope to a number of atoms.
- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — Log2 and natural log arithmetic used in solving for time.


---

# Percent Yield Calculator

> Divides the actual (experimental) yield by the theoretical yield to give percent yield, plus the amount and percentage of product lost.

- Calculator id: `percent-yield` · Category: Chemistry (`chemistry`) · Tool name: `calculate_percent_yield`
- Canonical page: https://tttkmbb.com/chemistry/percent-yield · This document: https://tttkmbb.com/chemistry/percent-yield.md · JSON definition: https://tttkmbb.com/chemistry/percent-yield.json

## Purpose

Divides the actual (experimental) yield by the theoretical yield to give percent yield, plus the amount and percentage of product lost.

**Use when:** You have the theoretical yield from stoichiometry and the mass or moles actually isolated, and want the reaction's percent yield.

**Do not use when:** You still need the theoretical yield itself (compute moles of product from the limiting reagent with moles-mass first), or you want atom economy, which compares molar masses of reagents and product rather than isolated yield.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `actual_yield` | number |  | required | Amount of product actually obtained, in grams or moles (same unit as theoretical_yield). (min 0) |
| `theoretical_yield` | number |  | required | Maximum amount of product predicted by stoichiometry from the limiting reagent, same unit as actual_yield. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `percent_yield` | number | % | 100 × actual / theoretical. |
| `yield_fraction` | number |  | actual / theoretical. |
| `product_lost` | number |  | theoretical − actual, in the input unit. |
| `percent_lost` | number | % | 100 − percent_yield. |

## Formula

`percent_yield = 100 × actual_yield / theoretical_yield; product_lost = theoretical_yield − actual_yield`

## Data Sources

- OpenStax Chemistry 2e – 4.4 Reaction Yields — https://openstax.org/books/chemistry-2e/pages/4-4-reaction-yields (textbook, retrieved 2026-09-23)
- Wikipedia – Yield (chemistry) — https://en.wikipedia.org/wiki/Yield_(chemistry) (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/percent-yield?actual_yield=…&theoretical_yield=…`
- `POST https://tttkmbb.com/api/v1/calculate/percent-yield` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/percent-yield · OpenAPI operationId `calculate_percent_yield` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "percent-yield", "inputs": {…}}`

## Example

- 4.5 g obtained of 5.0 g theoretical: inputs `{"actual_yield":4.5,"theoretical_yield":5}` → `{"percent_yield":90,"yield_fraction":0.9,"product_lost":0.5,"percent_lost":10}`
- 12.3 g obtained of 15.0 g theoretical: inputs `{"actual_yield":12.3,"theoretical_yield":15}` → `{"percent_yield":82,"product_lost":2.7}`

```
GET https://tttkmbb.com/api/v1/calculate/percent-yield?actual_yield=4.5&theoretical_yield=5
```

## Limitations

You still need the theoretical yield itself (compute moles of product from the limiting reagent with moles-mass first), or you want atom economy, which compares molar masses of reagents and product rather than isolated yield. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Can percent yield exceed 100%?**

Not for a pure, dry product. A value above 100% indicates residual solvent, impurities or a weighing error; the calculator reports it with a note.

**Should I use grams or moles?**

Either, as long as both yields use the same unit for the same product; the ratio is identical.

## Related

- [Moles to Grams Calculator](https://tttkmbb.com/chemistry/moles-mass.md) — Convert moles of product from stoichiometry into the theoretical mass.
- [Molar Mass Calculator](https://tttkmbb.com/chemistry/molar-mass.md) — Molar mass of the product for the mass conversion.
- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — General percentage arithmetic.


---

# Mass Percent Calculator

> Computes the mass percent (% w/w) of a solute from the solute mass and either the total solution mass or the solvent mass, and expresses the same concentration as mass fraction, parts per million and parts per billion.

- Calculator id: `mass-percent` · Category: Chemistry (`chemistry`) · Tool name: `calculate_mass_percent`
- Canonical page: https://tttkmbb.com/chemistry/mass-percent · This document: https://tttkmbb.com/chemistry/mass-percent.md · JSON definition: https://tttkmbb.com/chemistry/mass-percent.json

## Purpose

Computes the mass percent (% w/w) of a solute from the solute mass and either the total solution mass or the solvent mass, and expresses the same concentration as mass fraction, parts per million and parts per billion.

**Use when:** You need the % w/w, ppm or ppb concentration of a solute in a solution or mixture from masses.

**Do not use when:** You need molarity (mol/L, use molarity), the percent composition of an element within a compound (use molar-mass), or volume-based units such as % v/v.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `solute_mass` | number |  | required | Mass of the solute in any unit shared by all masses (g, kg, mg). (> 0) |
| `solvent_mass` | number |  | optional | Mass of the solvent; solution mass = solute + solvent. Ignored when solution_mass is given. (min 0) |
| `solution_mass` | number |  | optional | Total mass of the solution (solute + solvent). Use this when the total, not the solvent, is known. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `mass_percent` | number | % w/w | 100 × solute_mass / solution_mass. |
| `mass_fraction` | number |  | solute_mass / solution_mass. |
| `ppm` | number | ppm | 10⁶ × mass fraction (mg per kg of solution). |
| `ppb` | number | ppb | 10⁹ × mass fraction (µg per kg of solution). |
| `solution_mass` | number |  | Total mass of the solution, in the input unit. |
| `solvent_mass` | number |  | solution_mass − solute_mass, in the input unit. |

## Formula

`mass_percent = 100 × solute_mass / solution_mass, where solution_mass = solute_mass + solvent_mass; ppm = 10⁶ × solute_mass / solution_mass; ppb = 10⁹ × solute_mass / solution_mass`

## Data Sources

- OpenStax Chemistry 2e – 3.4 Other Units for Solution Concentrations — https://openstax.org/books/chemistry-2e/pages/3-4-other-units-for-solution-concentrations (textbook, retrieved 2026-09-23)
- Wikipedia – Mass fraction (chemistry) — https://en.wikipedia.org/wiki/Mass_fraction_(chemistry) (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/mass-percent?solute_mass=…`
- `POST https://tttkmbb.com/api/v1/calculate/mass-percent` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/mass-percent · OpenAPI operationId `calculate_mass_percent` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "mass-percent", "inputs": {…}}`

## Example

- 5 g NaCl in 95 g water: inputs `{"solute_mass":5,"solvent_mass":95}` → `{"mass_percent":5,"mass_fraction":0.05,"ppm":50000,"ppb":50000000,"solution_mass":100,"solvent_mass":95}`
- 2 mg of lead in 1 kg of solution: inputs `{"solute_mass":0.002,"solution_mass":1000}` → `{"mass_percent":0.0002,"ppm":2,"ppb":2000,"solvent_mass":999.998}`

```
GET https://tttkmbb.com/api/v1/calculate/mass-percent?solute_mass=5&solvent_mass=95
```

## Limitations

You need molarity (mol/L, use molarity), the percent composition of an element within a compound (use molar-mass), or volume-based units such as % v/v. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is the denominator the solvent or the whole solution?**

The whole solution (solute + solvent). 5 g of salt in 95 g of water is 5% w/w, not 5.26%.

**Is 1 ppm the same as 1 mg/L?**

Only for dilute aqueous solutions whose density is about 1 kg/L; ppm here is strictly mass-based (mg of solute per kg of solution).

## Related

- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Molar concentration instead of mass-based concentration.
- [Dilution Calculator](https://tttkmbb.com/chemistry/dilution.md) — Dilute the solution to a lower concentration.
- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — General percentage arithmetic.


---

# Henderson–Hasselbalch Calculator

> Computes the pH of a buffer from the acid's pKa and the concentrations (or ratio) of conjugate base and weak acid with the Henderson–Hasselbalch equation, or the base/acid ratio required for a target pH.

- Calculator id: `henderson-hasselbalch` · Category: Chemistry (`chemistry`) · Tool name: `calculate_henderson_hasselbalch_ph`
- Canonical page: https://tttkmbb.com/chemistry/henderson-hasselbalch · This document: https://tttkmbb.com/chemistry/henderson-hasselbalch.md · JSON definition: https://tttkmbb.com/chemistry/henderson-hasselbalch.json

## Purpose

Computes the pH of a buffer from the acid's pKa and the concentrations (or ratio) of conjugate base and weak acid with the Henderson–Hasselbalch equation, or the base/acid ratio required for a target pH.

**Use when:** You are preparing or analysing a buffer and need its pH from pKa and composition, or the acid-to-base ratio that gives a chosen pH.

**Do not use when:** The solution is a strong acid or base (use ph), the buffer is very dilute (below about 1 mM) or the pH is more than about 1.5 units from pKa, where the approximation breaks down.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `pka` | number |  | required | Acid dissociation constant exponent of the weak acid (e.g. acetic acid 4.76, H2PO4⁻ 7.21, NH4⁺ 9.25, carbonic acid in blood 6.1). (min -10, max 25) |
| `base_concentration` | number |  | optional | Concentration of the conjugate base (e.g. acetate), in any unit shared with acid_concentration. (> 0) |
| `acid_concentration` | number |  | optional | Concentration of the weak acid (e.g. acetic acid), same unit as base_concentration. (> 0) |
| `ratio_base_to_acid` | number |  | optional | Base-to-acid ratio; alternative to giving both concentrations. (> 0) |
| `ph` | number |  | optional | When given, the calculator solves for the [A⁻]/[HA] ratio that produces this pH instead of computing pH. (min -2, max 16) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ph` | number |  | Buffer pH = pKa + log10([A⁻]/[HA]). |
| `ratio_base_to_acid` | number |  | Conjugate base to weak acid ratio, given or solved. |
| `log_ratio` | number |  | pH − pKa. |
| `base_percent` | number | % | Share of the pair present as conjugate base: 100 × ratio / (1 + ratio). |
| `acid_percent` | number | % | Share present as undissociated acid. |
| `base_concentration` | number |  | Conjugate base concentration (when known or derivable from acid_concentration and the ratio). |
| `acid_concentration` | number |  | Weak acid concentration (when known or derivable from base_concentration and the ratio). |
| `buffer_range` | string |  | pKa ± 1, the range in which the buffer resists pH change effectively. |
| `solved_for` | string |  | ph or ratio_base_to_acid. |

## Formula

`pH = pKa + log10([A⁻] / [HA]); ratio = [A⁻]/[HA] = 10^(pH − pKa); base_percent = 100 × ratio / (1 + ratio)`

Valid when both buffer components are much more concentrated than [H⁺] and [OH⁻] and activity coefficients are close to 1; for accurate work use the pKa at the working temperature and ionic strength.

## Data Sources

- OpenStax Chemistry 2e – 14.6 Buffers — https://openstax.org/books/chemistry-2e/pages/14-6-buffers (textbook, retrieved 2026-09-23)
- Wikipedia – Henderson–Hasselbalch equation — https://en.wikipedia.org/wiki/Henderson%E2%80%93Hasselbalch_equation (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/henderson-hasselbalch?pka=…`
- `POST https://tttkmbb.com/api/v1/calculate/henderson-hasselbalch` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/henderson-hasselbalch · OpenAPI operationId `calculate_henderson_hasselbalch_ph` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "henderson-hasselbalch", "inputs": {…}}`

## Example

- Acetate buffer 0.2 M acetate / 0.1 M acetic acid: inputs `{"pka":4.76,"base_concentration":0.2,"acid_concentration":0.1}` → `{"ph":5.061,"ratio_base_to_acid":2,"log_ratio":0.301,"base_percent":66.67,"buffer_range":"3.76 – 5.76","solved_for":"ph"}`
- Bicarbonate ratio at blood pH 7.4: inputs `{"pka":6.1,"ph":7.4}` → `{"ratio_base_to_acid":19.953,"log_ratio":1.3,"base_percent":95.23,"acid_percent":4.77,"solved_for":"ratio_base_to_acid"}`

```
GET https://tttkmbb.com/api/v1/calculate/henderson-hasselbalch?pka=4.76&base_concentration=0.2&acid_concentration=0.1
```

## Limitations

The solution is a strong acid or base (use ph), the buffer is very dilute (below about 1 mM) or the pH is more than about 1.5 units from pKa, where the approximation breaks down. Valid when both buffer components are much more concentrated than [H⁺] and [OH⁻] and activity coefficients are close to 1; for accurate work use the pKa at the working temperature and ionic strength. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do I need molar concentrations?**

No. Only the ratio matters, so moles, mmol or any concentration unit work as long as both components use the same unit.

**Why does my measured pH differ from the calculated value?**

pKa shifts with temperature and ionic strength, and the equation ignores activity coefficients; deviations of 0.1–0.2 pH units are common in concentrated buffers.

## Related

- [pH Calculator](https://tttkmbb.com/chemistry/ph.md) — pH of strong acids and bases without a buffer.
- [Molarity Calculator](https://tttkmbb.com/chemistry/molarity.md) — Prepare the acid and base components at the required concentrations.
- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — log10 arithmetic used in the equation.


---

# Age Calculator

> Computes the exact age on a given date as years, months and days by Gregorian calendar arithmetic, plus total days and weeks, the weekday of birth, and the date of and days until the next birthday.

- Calculator id: `age` · Category: Everyday Life (`everyday`) · Tool name: `calculate_age`
- Canonical page: https://tttkmbb.com/everyday/age · This document: https://tttkmbb.com/everyday/age.md · JSON definition: https://tttkmbb.com/everyday/age.json

## Purpose

Computes the exact age on a given date as years, months and days by Gregorian calendar arithmetic, plus total days and weeks, the weekday of birth, and the date of and days until the next birthday.

**Use when:** You need someone's exact age on a date, the total number of days lived, the weekday they were born on, or how many days remain until their next birthday.

**Do not use when:** You need the difference between two arbitrary dates with a business-day count (use date-difference) or a countdown to an event (use days-until).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `birth_date` | date |  | required | Date of birth (ISO 8601, YYYY-MM-DD). |
| `as_of_date` | date |  | optional, default "today" | Date on which to evaluate the age; defaults to the current UTC date. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `years` | integer |  | Completed years. |
| `months` | integer |  | Completed months beyond the years (0–11). |
| `days` | integer |  | Days beyond the completed months. |
| `age_text` | string |  | Age written as years, months and days (zero parts omitted). |
| `total_days` | integer | days | Days from birth_date to as_of_date. |
| `total_weeks` | number | weeks | total_days / 7. |
| `age_decimal_years` | number | years | total_days / 365.2425 (mean Gregorian year). |
| `next_birthday_date` | date |  | First birthday anniversary on or after as_of_date (a 29 February birthday falls on 1 March in non-leap years). |
| `days_until_next_birthday` | integer | days | 0 on the birthday itself. |
| `day_of_week_born` | string |  | Day of the week of birth_date. |

## Formula

`years, months, days = calendar difference birth_date → as_of_date (when the day-of-month is smaller, days are borrowed from the month before as_of_date); total_days = as_of_date − birth_date; total_weeks = total_days / 7; age_decimal_years = total_days / 365.2425; next_birthday = first (month, day) of birth on or after as_of_date`

Uses the proleptic Gregorian calendar in UTC; no time zones or times of day are considered. A person born on 29 February is treated as having their birthday on 1 March in common years.

## Data Sources

- Gregorian calendar – leap-year rule and month lengths (Wikipedia) — https://en.wikipedia.org/wiki/Gregorian_calendar (reference, retrieved 2026-09-23)
- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-23)

Data freshness: `daily` (max_age_seconds 86400). Depends on the current date unless the date is supplied.

## API

- `GET https://tttkmbb.com/api/v1/calculate/age?birth_date=…`
- `POST https://tttkmbb.com/api/v1/calculate/age` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/age · OpenAPI operationId `calculate_age` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_age` (dedicated) or `run_calculator` with `{"calculator_id": "age", "inputs": {…}}`

## Example

- Born 1990-05-17, as of 2026-09-23: inputs `{"birth_date":"1990-05-17","as_of_date":"2026-09-23"}` → `{"years":36,"months":4,"days":6,"age_text":"36 years 4 months 6 days","total_days":13278,"total_weeks":1896.9,"age_decimal_years":36.35,"next_birthday_date":"2027-05-17","days_until_next_birthday":236,"day_of_week_born":"Thursday"}`
- Born 1985-12-25, as of 2026-01-10: inputs `{"birth_date":"1985-12-25","as_of_date":"2026-01-10"}` → `{"years":40,"months":0,"days":16,"age_text":"40 years 16 days","total_days":14626,"next_birthday_date":"2026-12-25","days_until_next_birthday":349,"day_of_week_born":"Wednesday"}`

```
GET https://tttkmbb.com/api/v1/calculate/age?birth_date=1990-05-17&as_of_date=2026-09-23
```

## Limitations

You need the difference between two arbitrary dates with a business-day count (use date-difference) or a countdown to an event (use days-until). Uses the proleptic Gregorian calendar in UTC; no time zones or times of day are considered. A person born on 29 February is treated as having their birthday on 1 March in common years. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How are months counted when the day of the month does not fit?**

Whole months are counted first; the leftover days are borrowed from the month preceding as_of_date. Born 31 January, on 1 March the age is 1 month 1 day (February has 28 or 29 days).

**What happens with a 29 February birthday?**

In common years the birthday is taken as 1 March, so days_until_next_birthday counts to 1 March; in leap years it counts to 29 February.

## Related

- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Difference between any two dates, including business days.
- [Days Until Calculator](https://tttkmbb.com/everyday/days-until.md) — Countdown to any date, e.g. the next birthday.
- [Day of the Week Calculator](https://tttkmbb.com/everyday/day-of-week.md) — Weekday and ISO week of any date.


---

# Date Difference Calculator

> Counts the days between two ISO dates and expresses the gap as weeks and days, as a calendar breakdown in years, months and days, and as business days (Monday–Friday, public holidays not excluded).

- Calculator id: `date-difference` · Category: Everyday Life (`everyday`) · Tool name: `calculate_date_difference`
- Canonical page: https://tttkmbb.com/everyday/date-difference · This document: https://tttkmbb.com/everyday/date-difference.md · JSON definition: https://tttkmbb.com/everyday/date-difference.json

## Purpose

Counts the days between two ISO dates and expresses the gap as weeks and days, as a calendar breakdown in years, months and days, and as business days (Monday–Friday, public holidays not excluded).

**Use when:** You need the number of days, weeks or working days between two dates, or a calendar-style 'x years y months z days' difference.

**Do not use when:** You want to add or subtract a number of days from a date (use add-days), or you need an age with the next birthday (use age).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `start_date` | date |  | required | First date (ISO 8601, YYYY-MM-DD). |
| `end_date` | date |  | required | Second date (YYYY-MM-DD). If it is earlier than start_date the dates are swapped and a note is returned. |
| `include_end_date` | boolean |  | optional, default false | true counts both endpoints (adds one day to days, weeks/days and business_days), e.g. for inclusive rental or leave periods. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `days` | integer | days | end_date − start_date in days (+1 when include_end_date is true). |
| `weeks` | integer | weeks | floor(days / 7). |
| `remaining_days` | integer | days | days − 7 × weeks. |
| `weeks_and_days` | string |  | Same gap written as weeks and days. |
| `calendar_years` | integer |  | Whole years between the two dates (not affected by include_end_date). |
| `calendar_months` | integer |  | Whole months beyond the years. |
| `calendar_days` | integer |  | Days beyond the whole months. |
| `calendar_text` | string |  | Years, months and days written out (zero parts omitted). |
| `business_days` | integer | days | Mondays to Fridays among the counted days (public holidays are not excluded). |

## Formula

`days = end_date − start_date (+1 if include_end_date); weeks = floor(days / 7); remaining_days = days mod 7; business_days = number of Mon–Fri dates in [start_date, end_date) or [start_date, end_date] when inclusive; calendar breakdown = whole years, months, then days borrowed from the month before end_date`

Counts calendar days in UTC without times of day. By default the count is exclusive of end_date, so Monday to Friday of one week is 4 days and 4 business days; set include_end_date for 5.

## Data Sources

- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-23)
- Business day (Wikipedia) — https://en.wikipedia.org/wiki/Business_day (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/date-difference?start_date=…&end_date=…`
- `POST https://tttkmbb.com/api/v1/calculate/date-difference` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/date-difference · OpenAPI operationId `calculate_date_difference` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `calculate_date_difference` (dedicated) or `run_calculator` with `{"calculator_id": "date-difference", "inputs": {…}}`

## Example

- 2026-01-01 to 2026-12-25: inputs `{"start_date":"2026-01-01","end_date":"2026-12-25"}` → `{"days":358,"weeks":51,"remaining_days":1,"weeks_and_days":"51 weeks 1 day","calendar_years":0,"calendar_months":11,"calendar_days":24,"calendar_text":"11 months 24 days","business_days":256}`
- 2025-11-05 to 2026-03-15 inclusive: inputs `{"start_date":"2025-11-05","end_date":"2026-03-15","include_end_date":true}` → `{"days":131,"weeks":18,"remaining_days":5,"weeks_and_days":"18 weeks 5 days","calendar_months":4,"calendar_days":10,"calendar_text":"4 months 10 days","business_days":93}`

```
GET https://tttkmbb.com/api/v1/calculate/date-difference?start_date=2026-01-01&end_date=2026-12-25
```

## Limitations

You want to add or subtract a number of days from a date (use add-days), or you need an age with the next birthday (use age). Counts calendar days in UTC without times of day. By default the count is exclusive of end_date, so Monday to Friday of one week is 4 days and 4 business days; set include_end_date for 5. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does business_days exclude public holidays?**

No. It only excludes Saturdays and Sundays; subtract the holidays of your jurisdiction yourself.

**Why does the calendar breakdown not add up to the day count?**

Months have different lengths, so 'x months y days' is a calendar convention: whole months are counted first and the leftover days are borrowed from the month preceding end_date.

## Related

- [Add or Subtract Days Calculator](https://tttkmbb.com/everyday/add-days.md) — Add or subtract days from a date.
- [Age Calculator](https://tttkmbb.com/everyday/age.md) — Exact age with next-birthday countdown.
- [Days Until Calculator](https://tttkmbb.com/everyday/days-until.md) — Countdown from today to a target date.


---

# Add or Subtract Days Calculator

> Adds a signed number of days to an ISO date and returns the resulting date and its weekday, using Gregorian calendar arithmetic in UTC.

- Calculator id: `add-days` · Category: Everyday Life (`everyday`) · Tool name: `calculate_date_plus_days`
- Canonical page: https://tttkmbb.com/everyday/add-days · This document: https://tttkmbb.com/everyday/add-days.md · JSON definition: https://tttkmbb.com/everyday/add-days.json

## Purpose

Adds a signed number of days to an ISO date and returns the resulting date and its weekday, using Gregorian calendar arithmetic in UTC.

**Use when:** You need the date that is N days after (or before) a given date, e.g. a deadline 90 days from today or a return date 14 days after departure.

**Do not use when:** You need the number of days between two known dates (use date-difference) or want to skip weekends when counting (not supported here).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `start_date` | date |  | optional, default "today" | Date to start from (YYYY-MM-DD); defaults to the current UTC date. |
| `days` | integer | days | required | Number of days to add; negative values subtract. (min -1000000, max 1000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result_date` | date |  | start_date + days. |
| `weekday` | string |  | Day of the week of the result date. |
| `offset_text` | string |  | The offset written as days and as weeks and days, before or after start_date. |

## Formula

`result_date = start_date + days (calendar days, no weekend skipping); weekday = day of week of result_date`

## Data Sources

- Gregorian calendar – leap-year rule and month lengths (Wikipedia) — https://en.wikipedia.org/wiki/Gregorian_calendar (reference, retrieved 2026-09-23)
- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-23)

Data freshness: `daily` (max_age_seconds 86400). Depends on the current date unless the date is supplied.

## API

- `GET https://tttkmbb.com/api/v1/calculate/add-days?days=…`
- `POST https://tttkmbb.com/api/v1/calculate/add-days` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/add-days · OpenAPI operationId `calculate_date_plus_days` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "add-days", "inputs": {…}}`

## Example

- 2026-09-23 + 90 days: inputs `{"start_date":"2026-09-23","days":90}` → `{"result_date":"2026-12-22","weekday":"Tuesday","offset_text":"90 days (12 weeks 6 days) after 2026-09-23"}`
- 2026-03-01 − 30 days: inputs `{"start_date":"2026-03-01","days":-30}` → `{"result_date":"2026-01-30","weekday":"Friday","offset_text":"30 days (4 weeks 2 days) before 2026-03-01"}`

```
GET https://tttkmbb.com/api/v1/calculate/add-days?start_date=2026-09-23&days=90
```

## Limitations

You need the number of days between two known dates (use date-difference) or want to skip weekends when counting (not supported here). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Are weekends or holidays skipped?**

No. Every calendar day counts. For business-day counting between two dates see date-difference.

**Is the start date day 0 or day 1?**

Day 0: adding 1 day to Monday gives Tuesday. For an inclusive convention (start date counts as day 1) add one day fewer.

## Related

- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Inverse operation: days between two dates.
- [Days Until Calculator](https://tttkmbb.com/everyday/days-until.md) — Countdown from today to a target date.


---

# Days Until Calculator

> Counts the days from a reference date (default today) to a target date and reports the countdown as weeks and days, approximate months, a calendar breakdown and the target's weekday.

- Calculator id: `days-until` · Category: Everyday Life (`everyday`) · Tool name: `calculate_days_until`
- Canonical page: https://tttkmbb.com/everyday/days-until · This document: https://tttkmbb.com/everyday/days-until.md · JSON definition: https://tttkmbb.com/everyday/days-until.json

## Purpose

Counts the days from a reference date (default today) to a target date and reports the countdown as weeks and days, approximate months, a calendar breakdown and the target's weekday.

**Use when:** You need a countdown to an event, deadline or holiday, or how many days ago a date was.

**Do not use when:** You need business days or an inclusive count between two dates (use date-difference), or an age (use age).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `target_date` | date |  | required | The event date (YYYY-MM-DD). |
| `from_date` | date |  | optional, default "today" | Reference date; defaults to the current UTC date. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `days` | integer | days | target_date − from_date; negative when the target is in the past. |
| `weeks` | integer | weeks | floor(\|days\| / 7). |
| `remaining_days` | integer | days | \|days\| mod 7. |
| `months_approx` | number | months | \|days\| / 30.4375 (average Gregorian month). |
| `calendar_text` | string |  | Whole years, months and days between the two dates. |
| `target_weekday` | string |  | Day of the week of target_date. |
| `is_past` | boolean |  | true when target_date is before from_date. |
| `countdown_text` | string |  | Days and weeks/days until (or since) the target. |

## Formula

`days = target_date − from_date; weeks = floor(|days| / 7); remaining_days = |days| mod 7; months_approx = |days| / 30.4375`

## Data Sources

- Gregorian calendar – leap-year rule and month lengths (Wikipedia) — https://en.wikipedia.org/wiki/Gregorian_calendar (reference, retrieved 2026-09-23)
- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-23)

Data freshness: `daily` (max_age_seconds 86400). Depends on the current date unless the date is supplied.

## API

- `GET https://tttkmbb.com/api/v1/calculate/days-until?target_date=…`
- `POST https://tttkmbb.com/api/v1/calculate/days-until` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/days-until · OpenAPI operationId `calculate_days_until` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "days-until", "inputs": {…}}`

## Example

- From 2026-09-23 to 2026-12-25: inputs `{"target_date":"2026-12-25","from_date":"2026-09-23"}` → `{"days":93,"weeks":13,"remaining_days":2,"months_approx":3.1,"calendar_text":"3 months 2 days","target_weekday":"Friday","is_past":false,"countdown_text":"93 days (13 weeks 2 days) until 2026-12-25"}`
- From 2026-01-01 to 2027-01-01: inputs `{"target_date":"2027-01-01","from_date":"2026-01-01"}` → `{"days":365,"weeks":52,"remaining_days":1,"months_approx":12,"calendar_text":"1 year","target_weekday":"Friday","is_past":false}`

```
GET https://tttkmbb.com/api/v1/calculate/days-until?target_date=2026-12-25&from_date=2026-09-23
```

## Limitations

You need business days or an inclusive count between two dates (use date-difference), or an age (use age). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is the target day itself counted?**

No. From Monday to the following Friday is 4 days; the countdown reaches 0 on the target date.

**Which time zone is 'today'?**

UTC. Near midnight, users in other zones may see a one-day difference; pass from_date explicitly to avoid it.

## Related

- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Full difference between two dates including business days.
- [Add or Subtract Days Calculator](https://tttkmbb.com/everyday/add-days.md) — Find the date N days from now.


---

# Day of the Week Calculator

> Returns the weekday of any Gregorian date together with its day-of-year number, the ISO 8601 week number and week-based year, and whether it falls on a weekend.

- Calculator id: `day-of-week` · Category: Everyday Life (`everyday`) · Tool name: `calculate_day_of_week`
- Canonical page: https://tttkmbb.com/everyday/day-of-week · This document: https://tttkmbb.com/everyday/day-of-week.md · JSON definition: https://tttkmbb.com/everyday/day-of-week.json

## Purpose

Returns the weekday of any Gregorian date together with its day-of-year number, the ISO 8601 week number and week-based year, and whether it falls on a weekend.

**Use when:** You need to know what weekday a date falls on, its ISO week number, or its ordinal day in the year.

**Do not use when:** You need to count days between dates (use date-difference) or determine leap years (use leap-year).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `date` | date |  | optional, default "today" | Any date in the proleptic Gregorian calendar (YYYY-MM-DD); defaults to the current UTC date. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `weekday` | string |  | Day of the week. |
| `day_of_year` | integer |  | Ordinal day number, 1 January = 1. |
| `days_remaining_in_year` | integer | days | Days after this date until 31 December. |
| `iso_week` | integer |  | ISO 8601 week number (1–53); weeks start on Monday and week 1 contains the year's first Thursday. |
| `iso_week_year` | integer |  | Year the ISO week belongs to (can differ from the calendar year around New Year). |
| `iso_week_date` | string |  | Date in ISO week-date notation YYYY-Www-D (D: 1 = Monday … 7 = Sunday). |
| `is_weekend` | boolean |  | true for Saturday or Sunday. |
| `days_in_year` | integer |  | 365 or 366. |

## Formula

`day_of_year = date − 1 January + 1; ISO week: take the Thursday of the same Monday-based week, iso_week = floor((day_of_year(Thursday) − 1) / 7) + 1 and iso_week_year = year of that Thursday`

## Data Sources

- ISO week date (Wikipedia) — https://en.wikipedia.org/wiki/ISO_week_date (reference, retrieved 2026-09-23)
- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-23)

Data freshness: `daily` (max_age_seconds 86400). Depends on the current date unless the date is supplied.

## API

- `GET https://tttkmbb.com/api/v1/calculate/day-of-week?`
- `POST https://tttkmbb.com/api/v1/calculate/day-of-week` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/day-of-week · OpenAPI operationId `calculate_day_of_week` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "day-of-week", "inputs": {…}}`

## Example

- 2026-09-23: inputs `{"date":"2026-09-23"}` → `{"weekday":"Wednesday","day_of_year":266,"days_remaining_in_year":99,"iso_week":39,"iso_week_year":2026,"iso_week_date":"2026-W39-3","is_weekend":false,"days_in_year":365}`
- 2021-01-01 (belongs to ISO week 53 of 2020): inputs `{"date":"2021-01-01"}` → `{"weekday":"Friday","day_of_year":1,"days_remaining_in_year":364,"iso_week":53,"iso_week_year":2020,"iso_week_date":"2020-W53-5","is_weekend":false}`

```
GET https://tttkmbb.com/api/v1/calculate/day-of-week?date=2026-09-23
```

## Limitations

You need to count days between dates (use date-difference) or determine leap years (use leap-year). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why can the ISO week year differ from the calendar year?**

ISO weeks run Monday–Sunday and week 1 is the week containing the first Thursday of January, so 29–31 December can belong to week 1 of the next year and 1–3 January to week 52/53 of the previous year.

**Are US-style week numbers (weeks starting Sunday) supported?**

No. Only the ISO 8601 definition is returned; US calendars that start weeks on Sunday and call 1 January week 1 can differ by one.

## Related

- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Days and business days between two dates.
- [Leap Year Calculator](https://tttkmbb.com/everyday/leap-year.md) — Check whether the year has 366 days.


---

# Time Duration Calculator

> Computes the elapsed time between a start and an end clock time (24-hour HH:MM), optionally minus a break, handling intervals that cross midnight, and reports it as hours and minutes and as decimal hours.

- Calculator id: `time-duration` · Category: Everyday Life (`everyday`) · Tool name: `calculate_time_duration`
- Canonical page: https://tttkmbb.com/everyday/time-duration · This document: https://tttkmbb.com/everyday/time-duration.md · JSON definition: https://tttkmbb.com/everyday/time-duration.json

## Purpose

Computes the elapsed time between a start and an end clock time (24-hour HH:MM), optionally minus a break, handling intervals that cross midnight, and reports it as hours and minutes and as decimal hours.

**Use when:** You need the length of a shift, meeting, trip or any interval given two clock times on the same or consecutive days.

**Do not use when:** The interval spans more than 24 hours or several days (use date-difference), or you need weekly hours and pay (use work-hours).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `start_time` | string |  | required | Start clock time in 24-hour HH:MM format. |
| `end_time` | string |  | required | End clock time in 24-hour HH:MM format. An end time earlier than the start time is taken as the next day. |
| `break_minutes` | integer | min | optional, default 0 | Unpaid or excluded minutes to subtract from the interval. (min 0, max 1440) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `total_minutes` | integer | min | Elapsed minutes after subtracting the break. |
| `hours` | integer | h | Whole hours of the duration. |
| `minutes` | integer | min | Minutes beyond the whole hours. |
| `decimal_hours` | number | h | total_minutes / 60, e.g. for timesheets. |
| `duration_text` | string |  | Duration as 'h h m min'. |
| `gross_minutes` | integer | min | Minutes from start_time to end_time before subtracting the break. |
| `crosses_midnight` | boolean |  | true when end_time is earlier than start_time and was taken as the next day. |

## Formula

`gross_minutes = end − start (+ 1440 if end < start); total_minutes = gross_minutes − break_minutes; decimal_hours = total_minutes / 60`

Identical start and end times give 0 minutes, not 24 hours. Daylight-saving transitions are ignored.

## Data Sources

- ISO 8601 – Date and time format (Wikipedia) — https://en.wikipedia.org/wiki/ISO_8601 (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/time-duration?start_time=…&end_time=…`
- `POST https://tttkmbb.com/api/v1/calculate/time-duration` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/time-duration · OpenAPI operationId `calculate_time_duration` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "time-duration", "inputs": {…}}`

## Example

- 09:30 to 17:45 with a 30-minute break: inputs `{"start_time":"09:30","end_time":"17:45","break_minutes":30}` → `{"total_minutes":465,"hours":7,"minutes":45,"decimal_hours":7.75,"duration_text":"7 h 45 min","gross_minutes":495,"crosses_midnight":false}`
- Night shift 22:00 to 06:30: inputs `{"start_time":"22:00","end_time":"06:30"}` → `{"total_minutes":510,"hours":8,"minutes":30,"decimal_hours":8.5,"duration_text":"8 h 30 min","crosses_midnight":true}`

```
GET https://tttkmbb.com/api/v1/calculate/time-duration?start_time=09%3A30&end_time=17%3A45&break_minutes=30
```

## Limitations

The interval spans more than 24 hours or several days (use date-difference), or you need weekly hours and pay (use work-hours). Identical start and end times give 0 minutes, not 24 hours. Daylight-saving transitions are ignored. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I enter 12-hour times?**

Convert to 24-hour clock first: 5:45 PM is 17:45, 12:30 AM is 00:30.

**What if the break is longer than the interval?**

The calculator returns a CALCULATION_ERROR; check the times or the break length.

## Related

- [Work Hours Calculator](https://tttkmbb.com/everyday/work-hours.md) — Weekly and monthly hours and pay from the same shift times.
- [Date Difference Calculator](https://tttkmbb.com/everyday/date-difference.md) — Intervals spanning several days.


---

# Fuel Cost Calculator

> Estimates the fuel needed for a trip and its cost from distance, fuel consumption in litres per 100 km and the price per litre, with the cost per person when it is shared.

- Calculator id: `fuel-cost` · Category: Everyday Life (`everyday`) · Tool name: `calculate_fuel_cost`
- Canonical page: https://tttkmbb.com/everyday/fuel-cost · This document: https://tttkmbb.com/everyday/fuel-cost.md · JSON definition: https://tttkmbb.com/everyday/fuel-cost.json

## Purpose

Estimates the fuel needed for a trip and its cost from distance, fuel consumption in litres per 100 km and the price per litre, with the cost per person when it is shared.

**Use when:** You want to budget a road trip or commute, or split fuel money between passengers, and know the car's consumption in L/100 km.

**Do not use when:** Your consumption is in mpg or km/L (convert it first with fuel-economy), or you need total ownership costs such as tolls, wear or depreciation.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `distance_km` | number | km | required | Trip distance in kilometres (enter the round-trip distance for a return journey). (> 0, max 100000) |
| `fuel_consumption_l_per_100km` | number | L/100 km | required | Average consumption in litres per 100 km. (> 0, max 100) |
| `fuel_price_per_liter` | number | per L | required | Price per litre in your currency. (min 0, max 100) |
| `passengers` | integer |  | optional, default 1 | Number of people sharing the fuel cost, driver included. (min 1, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `fuel_liters` | number | L | distance × consumption / 100. |
| `total_cost` | number |  | fuel_liters × price per litre. |
| `cost_per_person` | number |  | total_cost / passengers. |
| `cost_per_km` | number | per km | total_cost / distance_km. |
| `equivalent_mpg_us` | number | mpg (US) | 235.215 / (L/100 km), for reference. |

## Formula

`fuel_liters = distance_km × fuel_consumption_l_per_100km / 100; total_cost = fuel_liters × fuel_price_per_liter; cost_per_person = total_cost / passengers; cost_per_km = total_cost / distance_km; mpg_us = 235.215 / L_per_100km`

## Data Sources

- US DOE / EPA – fueleconomy.gov Trip Calculator — https://www.fueleconomy.gov/trip/ (government, retrieved 2026-09-23)
- Fuel economy in automobiles – unit conversions (Wikipedia) — https://en.wikipedia.org/wiki/Fuel_economy_in_automobiles (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/fuel-cost?distance_km=…&fuel_consumption_l_per_100km=…&fuel_price_per_liter=…`
- `POST https://tttkmbb.com/api/v1/calculate/fuel-cost` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/fuel-cost · OpenAPI operationId `calculate_fuel_cost` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "fuel-cost", "inputs": {…}}`

## Example

- 350 km at 7.5 L/100 km, 1.85 per litre, 2 people: inputs `{"distance_km":350,"fuel_consumption_l_per_100km":7.5,"fuel_price_per_liter":1.85,"passengers":2}` → `{"fuel_liters":26.25,"total_cost":48.56,"cost_per_person":24.28,"cost_per_km":0.139,"equivalent_mpg_us":31.4}`
- 1200 km at 6.2 L/100 km, 1.60 per litre: inputs `{"distance_km":1200,"fuel_consumption_l_per_100km":6.2,"fuel_price_per_liter":1.6}` → `{"fuel_liters":74.4,"total_cost":119.04,"cost_per_person":119.04,"cost_per_km":0.0992,"equivalent_mpg_us":37.9}`

```
GET https://tttkmbb.com/api/v1/calculate/fuel-cost?distance_km=350&fuel_consumption_l_per_100km=7.5&fuel_price_per_liter=1.85&passengers=2
```

## Limitations

Your consumption is in mpg or km/L (convert it first with fuel-economy), or you need total ownership costs such as tolls, wear or depreciation. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**I know my car's mpg, not L/100 km. What do I enter?**

L/100 km = 235.215 / mpg (US gallons) or 282.481 / mpg (UK imperial gallons). 30 US mpg is about 7.84 L/100 km.

**Does real consumption match the manufacturer figure?**

Usually not; highway driving, load, speed and air conditioning change consumption by 10–30%. Use a measured average from recent fill-ups if you have one.

## Related

- [Fuel Economy Converter](https://tttkmbb.com/conversion/fuel-economy.md) — Convert mpg or km/L to L/100 km first.
- [Bill Split Calculator](https://tttkmbb.com/everyday/bill-split.md) — Split any shared cost, with an optional tip.


---

# Electricity Cost Calculator

> Converts an appliance's power draw and daily usage into kilowatt-hours and the running cost per day, over a chosen number of days, per 30-day month and per 365-day year, using the US DOE energy-use formula.

- Calculator id: `electricity-cost` · Category: Everyday Life (`everyday`) · Tool name: `calculate_electricity_cost`
- Canonical page: https://tttkmbb.com/everyday/electricity-cost · This document: https://tttkmbb.com/everyday/electricity-cost.md · JSON definition: https://tttkmbb.com/everyday/electricity-cost.json

## Purpose

Converts an appliance's power draw and daily usage into kilowatt-hours and the running cost per day, over a chosen number of days, per 30-day month and per 365-day year, using the US DOE energy-use formula.

**Use when:** You want to know what a heater, fridge, computer, light or EV charger costs to run, or compare two appliances by energy cost.

**Do not use when:** The appliance cycles or has standby modes with unknown duty cycle (use a measured kWh figure or plug-in meter), or you need to convert energy units (use energy).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `power_watts` | number | W | required | Power draw in watts while running (1 kW = 1000 W). (> 0, max 1000000) |
| `hours_per_day` | number | h/day | required | Hours the appliance actually draws that power each day. (min 0, max 24) |
| `price_per_kwh` | number | per kWh | required | Tariff per kilowatt-hour in your currency (from your bill). (min 0, max 100) |
| `days` | integer | days | optional, default 30 | Length of the billing period to report. (min 1, max 3660) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `kwh_per_day` | number | kWh/day | power_watts × hours_per_day / 1000. |
| `cost_per_day` | number |  | kwh_per_day × price_per_kwh. |
| `kwh_for_period` | number | kWh | kwh_per_day × days. |
| `cost_for_period` | number |  | cost_per_day × days. |
| `cost_per_month` | number |  | cost_per_day × 30. |
| `cost_per_year` | number |  | cost_per_day × 365. |

## Formula

`kWh/day = power_watts × hours_per_day / 1000; cost/day = kWh/day × price_per_kwh; period = × days; month = × 30; year = × 365`

Assumes constant power while running. Appliances with thermostats or motors (fridges, heaters, pumps) run only part of the time, so use their measured average draw or reduce hours_per_day accordingly.

## Data Sources

- US DOE – Estimating Appliance and Home Electronic Energy Use — https://www.energy.gov/energysaver/estimating-appliance-and-home-electronic-energy-use (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/electricity-cost?power_watts=…&hours_per_day=…&price_per_kwh=…`
- `POST https://tttkmbb.com/api/v1/calculate/electricity-cost` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/electricity-cost · OpenAPI operationId `calculate_electricity_cost` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "electricity-cost", "inputs": {…}}`

## Example

- 100 W for 5 h/day at 0.15/kWh, 30 days: inputs `{"power_watts":100,"hours_per_day":5,"price_per_kwh":0.15,"days":30}` → `{"kwh_per_day":0.5,"cost_per_day":0.075,"kwh_for_period":15,"cost_for_period":2.25,"cost_per_month":2.25,"cost_per_year":27.38}`
- 1500 W heater 8 h/day at 0.30/kWh, 90 days: inputs `{"power_watts":1500,"hours_per_day":8,"price_per_kwh":0.3,"days":90}` → `{"kwh_per_day":12,"cost_per_day":3.6,"kwh_for_period":1080,"cost_for_period":324,"cost_per_month":108,"cost_per_year":1314}`

```
GET https://tttkmbb.com/api/v1/calculate/electricity-cost?power_watts=100&hours_per_day=5&price_per_kwh=0.15&days=30
```

## Limitations

The appliance cycles or has standby modes with unknown duty cycle (use a measured kWh figure or plug-in meter), or you need to convert energy units (use energy). Assumes constant power while running. Appliances with thermostats or motors (fridges, heaters, pumps) run only part of the time, so use their measured average draw or reduce hours_per_day accordingly. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Where do I find the wattage?**

On the appliance label or in its manual; if only amps are given, watts = volts × amps (e.g. 230 V × 0.5 A = 115 W). A plug-in power meter gives the real average draw.

**Does the price include taxes and standing charges?**

Use the all-in price per kWh from your bill (energy price plus per-kWh levies); fixed daily standing charges are not per-kWh and are not included.

## Related

- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Compute watts from volts and amps or resistance.
- [Energy Converter](https://tttkmbb.com/conversion/energy.md) — Convert kWh to joules, BTU or calories.


---

# Bill Split Calculator

> Adds an optional tip percentage to a bill and divides the total equally among a number of people, reporting the tip, the total and each person's share.

- Calculator id: `bill-split` · Category: Everyday Life (`everyday`) · Tool name: `calculate_bill_split`
- Canonical page: https://tttkmbb.com/everyday/bill-split · This document: https://tttkmbb.com/everyday/bill-split.md · JSON definition: https://tttkmbb.com/everyday/bill-split.json

## Purpose

Adds an optional tip percentage to a bill and divides the total equally among a number of people, reporting the tip, the total and each person's share.

**Use when:** A restaurant bill, taxi fare or shared purchase must be divided equally among several people, with or without a tip.

**Do not use when:** Shares are unequal (itemised bills), you only need the tip amount for one payer (use tip), or the cost is a trip's fuel (use fuel-cost).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `total_bill` | number |  | required | Bill total before tip, in your currency. (min 0, max 100000000) |
| `people` | integer |  | required | How many people share the bill equally. (min 1, max 1000) |
| `tip_percent` | number | % | optional, default 0 | Tip as a percentage of the bill (15 means 15 %). (min 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `tip_amount` | number |  | total_bill × tip_percent / 100. |
| `total_with_tip` | number |  | total_bill + tip_amount. |
| `per_person` | number |  | total_with_tip / people. |
| `bill_per_person` | number |  | total_bill / people. |
| `tip_per_person` | number |  | tip_amount / people. |

## Formula

`tip_amount = total_bill × tip_percent / 100; total_with_tip = total_bill + tip_amount; per_person = total_with_tip / people`

## Data Sources

- Gratuity – customary tipping rates by country (Wikipedia) — https://en.wikipedia.org/wiki/Gratuity (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/bill-split?total_bill=…&people=…`
- `POST https://tttkmbb.com/api/v1/calculate/bill-split` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/bill-split · OpenAPI operationId `calculate_bill_split` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "bill-split", "inputs": {…}}`

## Example

- 120 bill, 4 people, 15 % tip: inputs `{"total_bill":120,"people":4,"tip_percent":15}` → `{"tip_amount":18,"total_with_tip":138,"per_person":34.5,"bill_per_person":30,"tip_per_person":4.5}`
- 87.50 bill, 3 people, no tip: inputs `{"total_bill":87.5,"people":3}` → `{"tip_amount":0,"total_with_tip":87.5,"per_person":29.17,"bill_per_person":29.17,"tip_per_person":0}`

```
GET https://tttkmbb.com/api/v1/calculate/bill-split?total_bill=120&people=4&tip_percent=15
```

## Limitations

Shares are unequal (itemised bills), you only need the tip amount for one payer (use tip), or the cost is a trip's fuel (use fuel-cost). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should the tip be calculated before or after sales tax?**

Customs vary; in the US the tip is commonly computed on the pre-tax amount. Enter whichever base you want as total_bill.

**The per-person amount does not multiply back exactly to the total.**

Shares are rounded to 2 decimals; a difference of a few cents is rounding and one person can cover it.

## Related

- [Tip Calculator](https://tttkmbb.com/finance/tip.md) — Tip amount and total for a single payer.
- [Fuel Cost Calculator](https://tttkmbb.com/everyday/fuel-cost.md) — Share a trip's fuel cost between passengers.


---

# Unit Price Comparison Calculator

> Divides each price by its quantity to get the price per unit, tells which of two options is cheaper per unit and by what percentage.

- Calculator id: `unit-price` · Category: Everyday Life (`everyday`) · Tool name: `calculate_unit_price`
- Canonical page: https://tttkmbb.com/everyday/unit-price · This document: https://tttkmbb.com/everyday/unit-price.md · JSON definition: https://tttkmbb.com/everyday/unit-price.json

## Purpose

Divides each price by its quantity to get the price per unit, tells which of two options is cheaper per unit and by what percentage.

**Use when:** You are comparing two package sizes or brands of the same product (e.g. 500 g for 3.49 vs 1 kg for 5.99) and want the better value per unit.

**Do not use when:** The two quantities are in different units (convert them to the same unit first, e.g. with mass or volume), or you need a discount on a single price (use discount).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `price_a` | number |  | required | Total price of option A. (min 0, max 100000000) |
| `quantity_a` | number |  | required | Quantity in option A (grams, kilograms, litres, pieces …). (> 0, max 1000000000) |
| `price_b` | number |  | required | Total price of option B. (min 0, max 100000000) |
| `quantity_b` | number |  | required | Quantity in option B, in the same unit as quantity_a. (> 0, max 1000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `unit_price_a` | number |  | price_a / quantity_a, per one unit of quantity. |
| `unit_price_b` | number |  | price_b / quantity_b. |
| `cheaper_option` | string |  | 'Option A', 'Option B' or 'Same unit price'. |
| `savings_percent` | number | % | How much lower the cheaper unit price is, relative to the more expensive one. |
| `unit_price_difference` | number |  | \|unit_price_a − unit_price_b\|. |

## Formula

`unit_price = price / quantity; savings_percent = (max(unit_price_a, unit_price_b) − min(unit_price_a, unit_price_b)) / max(unit_price_a, unit_price_b) × 100`

## Data Sources

- Unit price (Wikipedia) — https://en.wikipedia.org/wiki/Unit_price (reference, retrieved 2026-09-23)
- EU Directive 98/6/EC on the indication of unit prices — https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:31998L0006 (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/unit-price?price_a=…&quantity_a=…&price_b=…&quantity_b=…`
- `POST https://tttkmbb.com/api/v1/calculate/unit-price` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/unit-price · OpenAPI operationId `calculate_unit_price` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "unit-price", "inputs": {…}}`

## Example

- 0.5 kg for 3.49 vs 1 kg for 5.99: inputs `{"price_a":3.49,"quantity_a":0.5,"price_b":5.99,"quantity_b":1}` → `{"unit_price_a":6.98,"unit_price_b":5.99,"cheaper_option":"Option B","savings_percent":14.18,"unit_price_difference":0.99}`
- 12 eggs for 2.00 vs 18 eggs for 3.30: inputs `{"price_a":2,"quantity_a":12,"price_b":3.3,"quantity_b":18}` → `{"unit_price_a":0.1667,"unit_price_b":0.1833,"cheaper_option":"Option A","savings_percent":9.09,"unit_price_difference":0.0167}`

```
GET https://tttkmbb.com/api/v1/calculate/unit-price?price_a=3.49&quantity_a=0.5&price_b=5.99&quantity_b=1
```

## Limitations

The two quantities are in different units (convert them to the same unit first, e.g. with mass or volume), or you need a discount on a single price (use discount). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which unit should I use for the quantities?**

Any unit, as long as both options use the same one; unit prices are then per that unit. Using kg or L instead of g or ml gives more readable unit prices.

**Is the larger package always cheaper per unit?**

No. Promotions on small sizes frequently undercut bulk packs, which is exactly what this comparison reveals.

## Related

- [Discount Calculator](https://tttkmbb.com/finance/discount.md) — Apply a percentage discount to a price.
- [Percentage Change Calculator](https://tttkmbb.com/math/percentage-change.md) — Percentage difference between two prices.


---

# Reading Time Calculator

> Estimates how long a text takes to read silently from its word count and a reading speed, defaulting to 238 words per minute, the adult mean for non-fiction found in Brysbaert's 2019 meta-analysis; also gives the read-aloud time at 183 wpm.

- Calculator id: `reading-time` · Category: Everyday Life (`everyday`) · Tool name: `estimate_reading_time`
- Canonical page: https://tttkmbb.com/everyday/reading-time · This document: https://tttkmbb.com/everyday/reading-time.md · JSON definition: https://tttkmbb.com/everyday/reading-time.json

## Purpose

Estimates how long a text takes to read silently from its word count and a reading speed, defaulting to 238 words per minute, the adult mean for non-fiction found in Brysbaert's 2019 meta-analysis; also gives the read-aloud time at 183 wpm.

**Use when:** You need an estimated reading time for an article, book, speech or document, or want to convert a word count into minutes.

**Do not use when:** You need typing speed (use typing-speed) or the text is in a language or script with very different reading rates (adjust words_per_minute).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `word_count` | integer | words | required | Number of words in the text. (min 1, max 100000000) |
| `words_per_minute` | number | wpm | optional, default 238 | Silent reading speed. Adult means: 238 wpm non-fiction, 260 wpm fiction (Brysbaert 2019). (min 50, max 2000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `minutes` | number | min | word_count / words_per_minute. |
| `seconds` | integer | s | Same time in seconds (rounded). |
| `reading_time` | string |  | Formatted as hours, minutes and seconds. |
| `read_aloud_minutes` | number | min | word_count / 183 wpm, the adult mean for reading aloud in English. |

## Formula

`minutes = word_count / words_per_minute; read_aloud_minutes = word_count / 183`

Brysbaert (2019) pooled 190 studies: silent reading of English non-fiction averages 238 wpm (fiction 260 wpm); reading aloud averages 183 wpm. Skimming, dense technical text or a second language change the rate considerably.

## Data Sources

- Brysbaert M (2019) How many words do we read per minute? A review and meta-analysis of reading rate, J Mem Lang 109:104047 — https://doi.org/10.1016/j.jml.2019.104047 (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/reading-time?word_count=…`
- `POST https://tttkmbb.com/api/v1/calculate/reading-time` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/reading-time · OpenAPI operationId `estimate_reading_time` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "reading-time", "inputs": {…}}`

## Example

- 1500-word article at 238 wpm: inputs `{"word_count":1500}` → `{"minutes":6.3,"seconds":378,"reading_time":"6 min 18 s","read_aloud_minutes":8.2}`
- 80,000-word novel at 260 wpm: inputs `{"word_count":80000,"words_per_minute":260}` → `{"minutes":307.69,"seconds":18462,"reading_time":"5 h 7 min 42 s","read_aloud_minutes":437.16}`

```
GET https://tttkmbb.com/api/v1/calculate/reading-time?word_count=1500
```

## Limitations

You need typing speed (use typing-speed) or the text is in a language or script with very different reading rates (adjust words_per_minute). Brysbaert (2019) pooled 190 studies: silent reading of English non-fiction averages 238 wpm (fiction 260 wpm); reading aloud averages 183 wpm. Skimming, dense technical text or a second language change the rate considerably. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why 238 words per minute?**

It is the mean silent reading rate for adults reading English non-fiction across 190 studies (Brysbaert 2019); older '200–250 wpm' rules of thumb are consistent with it.

**How do I estimate speaking time for a speech?**

Use read_aloud_minutes (183 wpm) or set words_per_minute to 130–150 for a slow, deliberate presentation pace.

## Related

- [Typing Speed Calculator](https://tttkmbb.com/everyday/typing-speed.md) — Words per minute for typing rather than reading.
- [Time Duration Calculator](https://tttkmbb.com/everyday/time-duration.md) — Add the reading time to a schedule.


---

# Typing Speed Calculator

> Computes gross words per minute from characters typed (one word = 5 characters) or from a word count, then net WPM after penalising uncorrected errors, plus accuracy and characters per minute.

- Calculator id: `typing-speed` · Category: Everyday Life (`everyday`) · Tool name: `calculate_typing_speed`
- Canonical page: https://tttkmbb.com/everyday/typing-speed · This document: https://tttkmbb.com/everyday/typing-speed.md · JSON definition: https://tttkmbb.com/everyday/typing-speed.json

## Purpose

Computes gross words per minute from characters typed (one word = 5 characters) or from a word count, then net WPM after penalising uncorrected errors, plus accuracy and characters per minute.

**Use when:** You timed a typing test and know the characters or words typed, the time and the number of errors, and want standard WPM figures.

**Do not use when:** You need reading speed (use reading-time) or the test software already reports WPM under its own error rules.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `characters_typed` | integer |  | optional | Total characters typed including spaces and punctuation. Takes precedence over words_typed when both are given. (min 1, max 10000000) |
| `words_typed` | number |  | optional | Alternative to characters_typed: number of words (converted at 5 characters per word). (min 0, max 2000000) |
| `minutes` | number | min | required | Duration of the test in minutes (e.g. 0.5 for 30 seconds). (> 0, max 1440) |
| `errors` | integer |  | optional, default 0 | Number of wrong characters left in the final text. (min 0, max 10000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `gross_wpm` | number | wpm | (characters / 5) / minutes, errors ignored. |
| `net_wpm` | number | wpm | gross_wpm − errors / minutes (each error costs one word). |
| `accuracy_percent` | number | % | (characters − errors) / characters × 100. |
| `cpm` | number | cpm | characters / minutes. |
| `words_equivalent` | number | words | characters / 5. |

## Formula

`words = characters / 5; gross_wpm = words / minutes; net_wpm = gross_wpm − errors / minutes; accuracy = (characters − errors) / characters × 100; cpm = characters / minutes`

The 5-character 'standard word' (including spaces and punctuation) is the usual convention in typing tests and text-entry research, so WPM is independent of actual word length.

## Data Sources

- Words per minute – the five-character word convention (Wikipedia) — https://en.wikipedia.org/wiki/Words_per_minute (reference, retrieved 2026-09-23)
- Dhakal V et al. (2018) Observations on Typing from 136 Million Keystrokes, CHI 2018 (Aalto University project page) — https://userinterfaces.aalto.fi/136Mkeystrokes/ (peer_reviewed, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/typing-speed?minutes=…`
- `POST https://tttkmbb.com/api/v1/calculate/typing-speed` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/typing-speed · OpenAPI operationId `calculate_typing_speed` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "typing-speed", "inputs": {…}}`

## Example

- 1500 characters in 5 minutes with 10 errors: inputs `{"characters_typed":1500,"minutes":5,"errors":10}` → `{"gross_wpm":60,"net_wpm":58,"accuracy_percent":99.33,"cpm":300,"words_equivalent":300}`
- 120 words in 3 minutes with 4 errors: inputs `{"words_typed":120,"minutes":3,"errors":4}` → `{"gross_wpm":40,"net_wpm":38.7,"accuracy_percent":99.33,"cpm":200,"words_equivalent":120}`

```
GET https://tttkmbb.com/api/v1/calculate/typing-speed?characters_typed=1500&minutes=5&errors=10
```

## Limitations

You need reading speed (use reading-time) or the test software already reports WPM under its own error rules. The 5-character 'standard word' (including spaces and punctuation) is the usual convention in typing tests and text-entry research, so WPM is independent of actual word length. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is a typical typing speed?**

Around 40 wpm for average computer users and 50–60 wpm in large online samples (Dhakal et al. 2018); professional typists reach 70–100+ wpm.

**Do corrected mistakes count as errors?**

No. Only errors left in the final text are penalised; corrections already cost time and therefore lower the gross speed.

## Related

- [Reading Time Calculator](https://tttkmbb.com/everyday/reading-time.md) — Reading speed in words per minute.


---

# GPA Calculator

> Computes a grade point average as the credit-weighted mean of course grade points (quality points divided by total credits), with an unweighted average when credits are omitted, and the nearest US letter grade on the 4.0 scale.

- Calculator id: `gpa` · Category: Everyday Life (`everyday`) · Tool name: `calculate_gpa`
- Canonical page: https://tttkmbb.com/everyday/gpa · This document: https://tttkmbb.com/everyday/gpa.md · JSON definition: https://tttkmbb.com/everyday/gpa.json

## Purpose

Computes a grade point average as the credit-weighted mean of course grade points (quality points divided by total credits), with an unweighted average when credits are omitted, and the nearest US letter grade on the 4.0 scale.

**Use when:** You have grade points (e.g. A = 4.0, B+ = 3.3) and credit hours for several courses and want the semester or cumulative GPA.

**Do not use when:** You need the score required on a final exam (use final-grade), or a general weighted mean of other quantities (use weighted-average).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `grade_points` | number_list |  | required | Grade points for each course on your scale, e.g. 4.0 for A, 3.7 for A−, 3.3 for B+, 3.0 for B, 2.0 for C, 1.0 for D, 0 for F. |
| `credits` | number_list |  | optional | Credit hours for each course, in the same order. Omit for an unweighted average (every course counts once). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `gpa` | number |  | Σ(grade_points × credits) / Σ credits. |
| `total_credits` | number | credits | Sum of credits (number of courses when credits are omitted). |
| `total_quality_points` | number |  | Σ(grade_points × credits). |
| `courses` | integer |  | Number of courses included. |
| `letter_grade_equivalent` | string |  | Letter whose standard 4.0-scale value (A 4.0, A− 3.7, B+ 3.3 …) is closest to the GPA; only returned when all grade points are ≤ 4.3. |

## Formula

`GPA = Σ(grade_points_i × credits_i) / Σ credits_i; without credits GPA = mean(grade_points)`

Uses the common US 4.0 scale mapping (A 4.0, A− 3.7, B+ 3.3, B 3.0, B− 2.7, C+ 2.3, C 2.0, C− 1.7, D+ 1.3, D 1.0, F 0). Institutions differ on A+ (4.0 or 4.3) and on weighting honours/AP courses; use your school's point values.

## Data Sources

- College Board – How to Convert Your GPA to a 4.0 Scale — https://pages.collegeboard.org/how-to-convert-gpa-4.0-scale (reference, retrieved 2026-09-23)
- Academic grading in the United States (Wikipedia) — https://en.wikipedia.org/wiki/Academic_grading_in_the_United_States (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/gpa?grade_points=…`
- `POST https://tttkmbb.com/api/v1/calculate/gpa` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/gpa · OpenAPI operationId `calculate_gpa` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "gpa", "inputs": {…}}`

## Example

- A, A−, B+, A with 3, 4, 3, 3 credits: inputs `{"grade_points":[4,3.7,3.3,4],"credits":[3,4,3,3]}` → `{"gpa":3.75,"total_credits":13,"total_quality_points":48.7,"courses":4,"letter_grade_equivalent":"A-"}`
- Unweighted: 3.0, 2.7, 4.0, 3.3: inputs `{"grade_points":[3,2.7,4,3.3]}` → `{"gpa":3.25,"total_credits":4,"total_quality_points":13,"courses":4,"letter_grade_equivalent":"B+"}`

```
GET https://tttkmbb.com/api/v1/calculate/gpa?grade_points=4%2C3.7%2C3.3%2C4&credits=3%2C4%2C3%2C3
```

## Limitations

You need the score required on a final exam (use final-grade), or a general weighted mean of other quantities (use weighted-average). Uses the common US 4.0 scale mapping (A 4.0, A− 3.7, B+ 3.3, B 3.0, B− 2.7, C+ 2.3, C 2.0, C− 1.7, D+ 1.3, D 1.0, F 0). Institutions differ on A+ (4.0 or 4.3) and on weighting honours/AP courses; use your school's point values. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I combine a previous cumulative GPA with new courses?**

Enter the old GPA as one 'course' with grade_points = old GPA and credits = total credits already completed, then add the new courses.

**Do pass/fail or withdrawn courses count?**

Usually not: they carry no grade points and are excluded from both quality points and credits. Leave them out.

## Related

- [Final Grade Calculator](https://tttkmbb.com/everyday/final-grade.md) — Score needed on a final exam to reach a target course grade.
- [Weighted Average Calculator](https://tttkmbb.com/statistics/weighted-average.md) — General weighted mean of any values.


---

# Final Grade Calculator

> Solves the weighted-average grade equation for the final exam score required to reach a desired overall grade, given the current grade and the final's weight, and reports whether that score is achievable.

- Calculator id: `final-grade` · Category: Everyday Life (`everyday`) · Tool name: `calculate_required_final_grade`
- Canonical page: https://tttkmbb.com/everyday/final-grade · This document: https://tttkmbb.com/everyday/final-grade.md · JSON definition: https://tttkmbb.com/everyday/final-grade.json

## Purpose

Solves the weighted-average grade equation for the final exam score required to reach a desired overall grade, given the current grade and the final's weight, and reports whether that score is achievable.

**Use when:** You know your current course grade and the final exam's weight and want the minimum final score for a target grade.

**Do not use when:** Grades are combined by points or categories rather than a percentage weight (compute the weighted mean directly with weighted-average), or you need a GPA (use gpa).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `current_grade_percent` | number | % | required | Current weighted grade over all work except the final, in percent. (min 0, max 150) |
| `final_weight_percent` | number | % | required | Share of the overall grade determined by the final exam. (> 0, max 100) |
| `desired_grade_percent` | number | % | required | Overall grade you want to end up with. (min 0, max 150) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `required_final_percent` | number | % | Minimum score on the final; can be below 0 or above 100. |
| `achievable` | boolean |  | true when the required score is at most 100 %. |
| `assessment` | string |  | Plain-language feasibility of the target. |
| `max_possible_grade_percent` | number | % | Overall grade with 100 % on the final. |
| `min_possible_grade_percent` | number | % | Overall grade with 0 % on the final. |

## Formula

`w = final_weight_percent / 100; required = (desired_grade_percent − current_grade_percent × (1 − w)) / w; max = current × (1 − w) + 100 × w; min = current × (1 − w)`

## Data Sources

- Weighted arithmetic mean (Wikipedia) — https://en.wikipedia.org/wiki/Weighted_arithmetic_mean (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/final-grade?current_grade_percent=…&final_weight_percent=…&desired_grade_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/final-grade` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/final-grade · OpenAPI operationId `calculate_required_final_grade` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "final-grade", "inputs": {…}}`

## Example

- 85 % now, final worth 30 %, want 90 %: inputs `{"current_grade_percent":85,"final_weight_percent":30,"desired_grade_percent":90}` → `{"required_final_percent":101.67,"achievable":false,"max_possible_grade_percent":89.5,"min_possible_grade_percent":59.5}`
- 78 % now, final worth 40 %, want 80 %: inputs `{"current_grade_percent":78,"final_weight_percent":40,"desired_grade_percent":80}` → `{"required_final_percent":83,"achievable":true,"max_possible_grade_percent":86.8,"min_possible_grade_percent":46.8}`

```
GET https://tttkmbb.com/api/v1/calculate/final-grade?current_grade_percent=85&final_weight_percent=30&desired_grade_percent=90
```

## Limitations

Grades are combined by points or categories rather than a percentage weight (compute the weighted mean directly with weighted-average), or you need a GPA (use gpa). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is 'current grade'?**

Your weighted average over everything graded so far, expressed as a percentage of the non-final portion; many learning platforms show it as the running course grade.

**The required score is above 100 %. What now?**

The target is out of reach without extra credit; max_possible_grade_percent shows the best you can still achieve.

## Related

- [GPA Calculator](https://tttkmbb.com/everyday/gpa.md) — Combine course grades into a GPA.
- [Weighted Average Calculator](https://tttkmbb.com/statistics/weighted-average.md) — Weighted mean of several assessment categories.


---

# Sleep Cycle Calculator

> Suggests bedtimes for a given wake-up time, or wake-up times for a given bedtime, so that sleep ends at the boundary of a full sleep cycle (default 90 minutes) after a typical time to fall asleep (default 14 minutes).

- Calculator id: `sleep-cycles` · Category: Everyday Life (`everyday`) · Tool name: `calculate_sleep_cycle_times`
- Canonical page: https://tttkmbb.com/everyday/sleep-cycles · This document: https://tttkmbb.com/everyday/sleep-cycles.md · JSON definition: https://tttkmbb.com/everyday/sleep-cycles.json

## Purpose

Suggests bedtimes for a given wake-up time, or wake-up times for a given bedtime, so that sleep ends at the boundary of a full sleep cycle (default 90 minutes) after a typical time to fall asleep (default 14 minutes).

**Use when:** You want to pick a bedtime or alarm time that completes 3–6 whole sleep cycles instead of waking mid-cycle.

**Do not use when:** You have a sleep disorder or shift-work schedule needing clinical advice; cycle length varies between people and through the night, so treat the times as approximations.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | enum: wake_up_at \| go_to_bed_at |  | required | Whether the given time is the wake-up time or the time you go to bed. |
| `time` | string |  | required | The known wake-up time or bedtime, 24-hour HH:MM. |
| `fall_asleep_minutes` | integer | min | optional, default 14 | Average sleep-onset latency; 10–20 minutes is typical for healthy adults. (min 0, max 120) |
| `cycle_minutes` | integer | min | optional, default 90 | Length of one sleep cycle; 90 minutes is the usual average (range about 70–120). (min 60, max 120) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `suggested_times` | string_list |  | Bedtimes (for wake_up_at, earliest first: 6, 5, 4, 3 cycles) or wake-up times (for go_to_bed_at: 3, 4, 5, 6 cycles), HH:MM. |
| `sleep_cycles` | number_list |  | Number of full cycles for each suggested time, in the same order. |
| `sleep_hours` | number_list | h | Hours of actual sleep for each suggested time. |
| `schedule` | list |  | Objects with cycles, time and sleep_hours for each suggestion. |

## Formula

`wake_up_at: bedtime = time − fall_asleep_minutes − n × cycle_minutes; go_to_bed_at: wake time = time + fall_asleep_minutes + n × cycle_minutes; n = 3…6 (4.5–9 h of sleep at 90-minute cycles)`

A night's sleep consists of 4–6 cycles of roughly 90 minutes that progress through light, deep and REM sleep; waking at the end of a cycle tends to feel less groggy. Adults are advised to sleep 7–9 hours, i.e. 5–6 cycles.

## Data Sources

- NIH NINDS – Brain Basics: Understanding Sleep — https://www.ninds.nih.gov/health-information/public-education/brain-basics/brain-basics-understanding-sleep (government, retrieved 2026-09-23)
- Sleep cycle (Wikipedia) — https://en.wikipedia.org/wiki/Sleep_cycle (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sleep-cycles?mode=…&time=…`
- `POST https://tttkmbb.com/api/v1/calculate/sleep-cycles` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sleep-cycles · OpenAPI operationId `calculate_sleep_cycle_times` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sleep-cycles", "inputs": {…}}`

## Example

- Wake up at 06:30: inputs `{"mode":"wake_up_at","time":"06:30"}` → `{"suggested_times":["21:16","22:46","00:16","01:46"],"sleep_cycles":[6,5,4,3],"sleep_hours":[9,7.5,6,4.5]}`
- Go to bed at 23:00: inputs `{"mode":"go_to_bed_at","time":"23:00"}` → `{"suggested_times":["03:44","05:14","06:44","08:14"],"sleep_cycles":[3,4,5,6],"sleep_hours":[4.5,6,7.5,9]}`

```
GET https://tttkmbb.com/api/v1/calculate/sleep-cycles?mode=wake_up_at&time=06%3A30
```

## Limitations

You have a sleep disorder or shift-work schedule needing clinical advice; cycle length varies between people and through the night, so treat the times as approximations. A night's sleep consists of 4–6 cycles of roughly 90 minutes that progress through light, deep and REM sleep; waking at the end of a cycle tends to feel less groggy. Adults are advised to sleep 7–9 hours, i.e. 5–6 cycles. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which suggestion should I choose?**

Prefer 5 or 6 cycles (7.5–9 h); 3–4 cycles is a fallback for a short night, not a healthy routine.

**Are sleep cycles really 90 minutes?**

On average. Individual cycles range from about 70 to 120 minutes and lengthen through the night, so the suggested times are estimates to be fine-tuned by how you feel on waking.

## Related

- [Time Duration Calculator](https://tttkmbb.com/everyday/time-duration.md) — Hours between bedtime and wake-up time.


---

# Aspect Ratio Calculator

> Reduces a width and height to their simplest ratio and decimal value, identifies the closest common ratio (16:9, 4:3, 3:2, 21:9 …) and scales the dimensions to a new width or height while keeping the ratio.

- Calculator id: `aspect-ratio` · Category: Everyday Life (`everyday`) · Tool name: `calculate_aspect_ratio`
- Canonical page: https://tttkmbb.com/everyday/aspect-ratio · This document: https://tttkmbb.com/everyday/aspect-ratio.md · JSON definition: https://tttkmbb.com/everyday/aspect-ratio.json

## Purpose

Reduces a width and height to their simplest ratio and decimal value, identifies the closest common ratio (16:9, 4:3, 3:2, 21:9 …) and scales the dimensions to a new width or height while keeping the ratio.

**Use when:** You need the aspect ratio of an image, screen or video, or the matching height for a new width (or width for a new height) when resizing.

**Do not use when:** You need pixel density, file size or a crop to a different ratio; this only keeps the existing proportions.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `width` | number |  | required | Width in any unit (pixels, cm …). (> 0, max 1000000000) |
| `height` | number |  | required | Height in the same unit. (> 0, max 1000000000) |
| `new_width` | number |  | optional | Optional target width; the matching height is returned as scaled_height. (> 0, max 1000000000) |
| `new_height` | number |  | optional | Optional target height; the matching width is returned as scaled_width. (> 0, max 1000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ratio` | string |  | Simplest integer ratio width:height (values with decimals are scaled to integers first). |
| `ratio_decimal` | number |  | width / height. |
| `closest_common_ratio` | string |  | Nearest of 1:1, 5:4, 4:3, 3:2, 16:10, 16:9, 1.85:1, 2:1, 21:9, 2.39:1 (or their portrait forms), by ratio. |
| `orientation` | string |  | landscape, portrait or square. |
| `scaled_height` | number |  | new_width × height / width (only when new_width is given). |
| `scaled_width` | number |  | new_height × width / height (only when new_height is given). |

## Formula

`ratio = (width / g) : (height / g) with g = gcd(width, height); ratio_decimal = width / height; scaled_height = new_width × height / width; scaled_width = new_height × width / height`

## Data Sources

- Aspect ratio (image) (Wikipedia) — https://en.wikipedia.org/wiki/Aspect_ratio_(image) (reference, retrieved 2026-09-23)
- Display aspect ratio (Wikipedia) — https://en.wikipedia.org/wiki/Display_aspect_ratio (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/aspect-ratio?width=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/aspect-ratio` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/aspect-ratio · OpenAPI operationId `calculate_aspect_ratio` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "aspect-ratio", "inputs": {…}}`

## Example

- 1920 × 1080, resize to width 1280: inputs `{"width":1920,"height":1080,"new_width":1280}` → `{"ratio":"16:9","ratio_decimal":1.7778,"closest_common_ratio":"16:9","orientation":"landscape","scaled_height":720}`
- 1080 × 1350 portrait, resize to height 675: inputs `{"width":1080,"height":1350,"new_height":675}` → `{"ratio":"4:5","ratio_decimal":0.8,"closest_common_ratio":"4:5","orientation":"portrait","scaled_width":540}`

```
GET https://tttkmbb.com/api/v1/calculate/aspect-ratio?width=1920&height=1080&new_width=1280
```

## Limitations

You need pixel density, file size or a crop to a different ratio; this only keeps the existing proportions. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is my 1366 × 768 screen shown as 683:384 and not 16:9?**

683:384 is the exact simplified ratio (1.7786); it is only approximately 16:9 (1.7778), which is why closest_common_ratio is reported separately.

**Scaled dimensions are not whole pixels. What should I do?**

Round to the nearest integer (or to an even number for video codecs); the tiny change in ratio is invisible.

## Related

- [Ratio Calculator](https://tttkmbb.com/math/ratio.md) — General ratio simplification and scaling.
- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Area and diagonal of the frame.


---

# Download Time Calculator

> Computes how long a file transfer takes from the file size (MB, GB, TB) and the connection speed (Mbit/s, MB/s or Gbit/s), converting bytes to bits at 8 bits per byte with decimal (SI) prefixes.

- Calculator id: `download-time` · Category: Everyday Life (`everyday`) · Tool name: `estimate_download_time`
- Canonical page: https://tttkmbb.com/everyday/download-time · This document: https://tttkmbb.com/everyday/download-time.md · JSON definition: https://tttkmbb.com/everyday/download-time.json

## Purpose

Computes how long a file transfer takes from the file size (MB, GB, TB) and the connection speed (Mbit/s, MB/s or Gbit/s), converting bytes to bits at 8 bits per byte with decimal (SI) prefixes.

**Use when:** You want to estimate how long a download, upload or backup will take at a given bandwidth, or compare connection speeds.

**Do not use when:** You need to convert between data-storage units themselves (use data-storage); real transfers are also slowed by protocol overhead, server limits and Wi-Fi conditions.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `file_size` | number |  | required | Size of the file in the chosen unit. (> 0, max 1000000000) |
| `size_unit` | enum: mb \| gb \| tb |  | optional, default "gb" | Unit of file_size (decimal SI prefixes). |
| `speed` | number |  | required | Transfer rate in the chosen unit. (> 0, max 1000000000) |
| `speed_unit` | enum: mbit_per_s \| mbyte_per_s \| gbit_per_s |  | optional, default "mbit_per_s" | Unit of speed. Internet plans are quoted in megabits per second (Mbps); browsers show megabytes per second (MB/s), which is 8 times larger per unit. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `seconds` | number | s | file_size in bits / speed in bits per second. |
| `time_formatted` | string |  | Same time as h:mm:ss. |
| `minutes` | number | min | seconds / 60. |
| `hours` | number | h | seconds / 3600. |
| `speed_mb_per_s` | number | MB/s | Connection speed expressed in megabytes per second. |

## Formula

`bits = file_size × bytes_per_unit × 8 (MB 10⁶, GB 10⁹, TB 10¹² bytes); bits_per_second = speed × (Mbit/s 10⁶, MB/s 8×10⁶, Gbit/s 10⁹); seconds = bits / bits_per_second`

Uses decimal prefixes as network operators and drive makers do. Operating systems often report sizes in binary units (1 GiB = 1.074 GB), and real throughput is typically 5–15% below the nominal line speed.

## Data Sources

- Data-rate units (Wikipedia) — https://en.wikipedia.org/wiki/Data-rate_units (reference, retrieved 2026-09-23)
- NIST – Prefixes for binary multiples — https://physics.nist.gov/cuu/Units/binary.html (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/download-time?file_size=…&speed=…`
- `POST https://tttkmbb.com/api/v1/calculate/download-time` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/download-time · OpenAPI operationId `estimate_download_time` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "download-time", "inputs": {…}}`

## Example

- 4.7 GB at 100 Mbit/s: inputs `{"file_size":4.7,"size_unit":"gb","speed":100,"speed_unit":"mbit_per_s"}` → `{"seconds":376,"time_formatted":"0:06:16","minutes":6.27,"hours":0.104,"speed_mb_per_s":12.5}`
- 1 TB at 1 Gbit/s: inputs `{"file_size":1,"size_unit":"tb","speed":1,"speed_unit":"gbit_per_s"}` → `{"seconds":8000,"time_formatted":"2:13:20","minutes":133.33,"hours":2.222,"speed_mb_per_s":125}`

```
GET https://tttkmbb.com/api/v1/calculate/download-time?file_size=4.7&size_unit=gb&speed=100&speed_unit=mbit_per_s
```

## Limitations

You need to convert between data-storage units themselves (use data-storage); real transfers are also slowed by protocol overhead, server limits and Wi-Fi conditions. Uses decimal prefixes as network operators and drive makers do. Operating systems often report sizes in binary units (1 GiB = 1.074 GB), and real throughput is typically 5–15% below the nominal line speed. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is my download slower than the calculator says?**

The estimate uses the nominal link speed; protocol overhead, the server's upload limit, Wi-Fi signal and other traffic usually cut throughput by 10% or more.

**Mbps or MB/s – which one do I have?**

Internet plans quote megabits per second (Mbps); download managers show megabytes per second (MB/s). 100 Mbps equals 12.5 MB/s.

## Related

- [Data Storage Converter](https://tttkmbb.com/conversion/data-storage.md) — Convert between MB, GiB, TB and other data units.
- [Time Converter](https://tttkmbb.com/conversion/time.md) — Convert seconds to minutes, hours and days.


---

# Leap Year Calculator

> Applies the Gregorian leap-year rule (divisible by 4, except centuries not divisible by 400) to a year and reports the reason, the number of days in the year and in February, and the next and previous leap years.

- Calculator id: `leap-year` · Category: Everyday Life (`everyday`) · Tool name: `classify_leap_year`
- Canonical page: https://tttkmbb.com/everyday/leap-year · This document: https://tttkmbb.com/everyday/leap-year.md · JSON definition: https://tttkmbb.com/everyday/leap-year.json

## Purpose

Applies the Gregorian leap-year rule (divisible by 4, except centuries not divisible by 400) to a year and reports the reason, the number of days in the year and in February, and the next and previous leap years.

**Use when:** You need to know whether a year has 29 February, why, or when the next leap year occurs.

**Do not use when:** You need the weekday or ISO week of a specific date (use day-of-week) or day counts between dates (use date-difference).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `year` | integer |  | required | Year in the (proleptic) Gregorian calendar. (min 1, max 9999) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `is_leap` | boolean |  | true when the year has 366 days. |
| `reason` | string |  | Which part of the rule decided the result. |
| `days_in_year` | integer | days | 365 or 366. |
| `days_in_february` | integer | days | 28 or 29. |
| `next_leap_year` | integer |  | First leap year after the given year. |
| `previous_leap_year` | integer |  | Last leap year before the given year (absent for years before 4). |

## Formula

`is_leap = (year mod 4 = 0 and year mod 100 ≠ 0) or year mod 400 = 0`

The Gregorian rule gives a mean year of 365.2425 days. Years before 1582 (or before a country's adoption date) were actually reckoned in the Julian calendar, where every fourth year is leap; this calculator applies the Gregorian rule proleptically.

## Data Sources

- US Naval Observatory – Leap Years — https://aa.usno.navy.mil/faq/leap_years (government, retrieved 2026-09-23)
- Leap year (Wikipedia) — https://en.wikipedia.org/wiki/Leap_year (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/leap-year?year=…`
- `POST https://tttkmbb.com/api/v1/calculate/leap-year` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/leap-year · OpenAPI operationId `classify_leap_year` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "leap-year", "inputs": {…}}`

## Example

- 2024: inputs `{"year":2024}` → `{"is_leap":true,"reason":"Divisible by 4 and not by 100","days_in_year":366,"days_in_february":29,"next_leap_year":2028,"previous_leap_year":2020}`
- 1900 (century year not divisible by 400): inputs `{"year":1900}` → `{"is_leap":false,"reason":"Divisible by 100 but not by 400","days_in_year":365,"days_in_february":28,"next_leap_year":1904,"previous_leap_year":1896}`

```
GET https://tttkmbb.com/api/v1/calculate/leap-year?year=2024
```

## Limitations

You need the weekday or ISO week of a specific date (use day-of-week) or day counts between dates (use date-difference). The Gregorian rule gives a mean year of 365.2425 days. Years before 1582 (or before a country's adoption date) were actually reckoned in the Julian calendar, where every fourth year is leap; this calculator applies the Gregorian rule proleptically. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Was 2000 a leap year?**

Yes: it is divisible by 400. 1900 and 2100 are not leap years because they are divisible by 100 but not by 400.

**Why does the rule skip some century years?**

A solar year is about 365.2422 days; adding a day every 4 years overshoots, so 3 leap days are dropped every 400 years to keep the calendar aligned with the seasons.

## Related

- [Day of the Week Calculator](https://tttkmbb.com/everyday/day-of-week.md) — Weekday, day of year and ISO week of a date.
- [Age Calculator](https://tttkmbb.com/everyday/age.md) — Ages for people born on 29 February.


---

# Roman Numeral Converter

> Converts an integer from 1 to 3999 into standard (subtractive-notation) Roman numerals, or parses a Roman numeral back into a number, and shows the value of each symbol group.

- Calculator id: `roman-numeral` · Category: Everyday Life (`everyday`) · Tool name: `convert_roman_numeral`
- Canonical page: https://tttkmbb.com/everyday/roman-numeral · This document: https://tttkmbb.com/everyday/roman-numeral.md · JSON definition: https://tttkmbb.com/everyday/roman-numeral.json

## Purpose

Converts an integer from 1 to 3999 into standard (subtractive-notation) Roman numerals, or parses a Roman numeral back into a number, and shows the value of each symbol group.

**Use when:** You need to write a year, chapter or clock number in Roman numerals, or read one such as MCMXCIV.

**Do not use when:** The number is 0, negative, 4000 or larger, or not an integer (standard Roman numerals cannot express these); for other number systems use base-converter.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | enum: to_roman \| from_roman |  | required | Conversion direction. |
| `value` | string |  | required | The integer (1–3999) for to_roman, or the Roman numeral (I, V, X, L, C, D, M; case-insensitive) for from_roman. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `roman` | string |  | The numeral in standard form. |
| `number` | integer |  | The decimal value. |
| `breakdown` | string |  | Symbol groups with their values, e.g. M (1000) + CM (900) + XC (90) + IV (4). |

## Formula

`Greedy decomposition using M 1000, CM 900, D 500, CD 400, C 100, XC 90, L 50, XL 40, X 10, IX 9, V 5, IV 4, I 1; parsing accepts only the standard form M{0,3}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})`

## Data Sources

- Roman numerals (Wikipedia) — https://en.wikipedia.org/wiki/Roman_numerals (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/roman-numeral?mode=…&value=…`
- `POST https://tttkmbb.com/api/v1/calculate/roman-numeral` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/roman-numeral · OpenAPI operationId `convert_roman_numeral` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "roman-numeral", "inputs": {…}}`

## Example

- 1994 to Roman: inputs `{"mode":"to_roman","value":"1994"}` → `{"roman":"MCMXCIV","number":1994,"breakdown":"M (1000) + CM (900) + XC (90) + IV (4)"}`
- MMXXVI to number: inputs `{"mode":"from_roman","value":"MMXXVI"}` → `{"roman":"MMXXVI","number":2026,"breakdown":"M (1000) + M (1000) + X (10) + X (10) + V (5) + I (1)"}`

```
GET https://tttkmbb.com/api/v1/calculate/roman-numeral?mode=to_roman&value=1994
```

## Limitations

The number is 0, negative, 4000 or larger, or not an integer (standard Roman numerals cannot express these); for other number systems use base-converter. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is IIII or VIIII rejected?**

The converter accepts only standard subtractive notation (IV, IX, XL, XC, CD, CM). Additive forms such as IIII on clock faces are historical variants and are not parsed.

**How are numbers above 3999 written?**

With a vinculum (overline) multiplying a group by 1000, e.g. an overlined IV for 4000. This calculator supports 1–3999 only.

## Related

- [Number Base Converter](https://tttkmbb.com/math/base-converter.md) — Convert between binary, octal, decimal and hexadecimal.


---

# Work Hours Calculator

> Derives paid hours per day from shift start and end times minus unpaid breaks, scales them to a week (working days), an average month (52/12 weeks) and a year (52 weeks), and multiplies by an optional hourly rate for pay.

- Calculator id: `work-hours` · Category: Everyday Life (`everyday`) · Tool name: `calculate_work_hours`
- Canonical page: https://tttkmbb.com/everyday/work-hours · This document: https://tttkmbb.com/everyday/work-hours.md · JSON definition: https://tttkmbb.com/everyday/work-hours.json

## Purpose

Derives paid hours per day from shift start and end times minus unpaid breaks, scales them to a week (working days), an average month (52/12 weeks) and a year (52 weeks), and multiplies by an optional hourly rate for pay.

**Use when:** You want to know your working hours per week, month or year from a daily schedule, or the pay they represent at an hourly rate.

**Do not use when:** Shifts vary day by day (sum each with time-duration), or you need salary conversions between periods without shift times (use salary-converter).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `start_time` | string |  | required | Start of the working day, 24-hour HH:MM. |
| `end_time` | string |  | required | End of the working day, 24-hour HH:MM (an end time before the start time means the shift ends the next day). |
| `break_minutes` | integer | min | optional, default 0 | Unpaid break minutes per day. (min 0, max 1440) |
| `days_per_week` | integer | days | optional, default 5 | Number of such working days per week. (min 1, max 7) |
| `hourly_rate` | number |  | optional | Optional gross pay per hour; adds pay outputs. (min 0, max 100000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `hours_per_day` | number | h | (end − start − break) in hours. |
| `hours_per_week` | number | h | hours_per_day × days_per_week. |
| `hours_per_month` | number | h | hours_per_week × 52 / 12 (average month). |
| `hours_per_year` | number | h | hours_per_week × 52 (no holidays or leave deducted). |
| `daily_pay` | number |  | hours_per_day × hourly_rate (only when hourly_rate is given). |
| `weekly_pay` | number |  | hours_per_week × hourly_rate. |
| `monthly_pay` | number |  | hours_per_month × hourly_rate. |
| `annual_pay` | number |  | hours_per_year × hourly_rate (gross, before tax). |

## Formula

`hours_per_day = (end_time − start_time (+24 h if negative) − break_minutes) / 60; week = × days_per_week; month = week × 52 / 12; year = week × 52; pay = hours × hourly_rate`

A year is taken as exactly 52 weeks (2,080 h for a 40-hour week); the US OPM uses 2,087 h to average leap years. Public holidays, sick days and paid leave are not deducted, and overtime premiums are not applied.

## Data Sources

- US OPM – Computing Hourly Rates of Pay Using the 2,087-Hour Divisor — https://www.opm.gov/policy-data-oversight/pay-leave/pay-administration/fact-sheets/computing-hourly-rates-of-pay-using-the-2087-hour-divisor/ (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/work-hours?start_time=…&end_time=…`
- `POST https://tttkmbb.com/api/v1/calculate/work-hours` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/work-hours · OpenAPI operationId `calculate_work_hours` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "work-hours", "inputs": {…}}`

## Example

- 09:00–17:30, 30 min break, 5 days, 25/h: inputs `{"start_time":"09:00","end_time":"17:30","break_minutes":30,"days_per_week":5,"hourly_rate":25}` → `{"hours_per_day":8,"hours_per_week":40,"hours_per_month":173.33,"hours_per_year":2080,"daily_pay":200,"weekly_pay":1000,"monthly_pay":4333.33,"annual_pay":52000}`
- Night shift 22:00–06:00, 45 min break, 4 days: inputs `{"start_time":"22:00","end_time":"06:00","break_minutes":45,"days_per_week":4}` → `{"hours_per_day":7.25,"hours_per_week":29,"hours_per_month":125.67,"hours_per_year":1508}`

```
GET https://tttkmbb.com/api/v1/calculate/work-hours?start_time=09%3A00&end_time=17%3A30&break_minutes=30&days_per_week=5&hourly_rate=25
```

## Limitations

Shifts vary day by day (sum each with time-duration), or you need salary conversions between periods without shift times (use salary-converter). A year is taken as exactly 52 weeks (2,080 h for a 40-hour week); the US OPM uses 2,087 h to average leap years. Public holidays, sick days and paid leave are not deducted, and overtime premiums are not applied. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why 52/12 = 4.333 weeks per month?**

Months have 28–31 days, so payroll conventionally uses the average of 52 weeks divided by 12 months (about 173.33 h for a 40-hour week) rather than exactly 4 weeks.

**Is the break paid?**

break_minutes is subtracted as unpaid time. If your breaks are paid, enter 0.

## Related

- [Time Duration Calculator](https://tttkmbb.com/everyday/time-duration.md) — Length of a single shift.
- [Salary Converter](https://tttkmbb.com/finance/salary-converter.md) — Convert hourly pay to monthly or annual salary.


---

# Recipe Scaler

> Computes the conversion factor between an original and a desired number of servings and multiplies a list of ingredient amounts by it.

- Calculator id: `recipe-scaler` · Category: Food & Cooking (`food`) · Tool name: `scale_recipe`
- Canonical page: https://tttkmbb.com/food/recipe-scaler · This document: https://tttkmbb.com/food/recipe-scaler.md · JSON definition: https://tttkmbb.com/food/recipe-scaler.json

## Purpose

Computes the conversion factor between an original and a desired number of servings and multiplies a list of ingredient amounts by it.

**Use when:** You need to enlarge or reduce a recipe for a different number of servings and want every ingredient quantity scaled consistently.

**Do not use when:** You need to convert between measurement units (use cooking-converter) or to work with baker's percentages for dough (use bakers-percentage).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `original_servings` | number | servings | required | Number of servings (or yield) the original recipe makes. (> 0, max 100000) |
| `desired_servings` | number | servings | required | Number of servings you want to make. (> 0, max 100000) |
| `ingredient_amounts` | number_list |  | optional | Optional list of ingredient quantities from the original recipe, in any units, in order; each is multiplied by the scale factor. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `scale_factor` | number |  | desired_servings / original_servings; multiply every ingredient by this. |
| `scale_percent` | number | % | Scale factor as a percentage of the original recipe. |
| `scaled_amounts` | number_list |  | Each ingredient amount multiplied by the scale factor (same order and units as the input); only when ingredient_amounts is given. |

## Formula

`scale_factor = desired_servings / original_servings; scaled_amount_i = ingredient_amount_i × scale_factor`

Linear scaling is exact for ingredient quantities but not for cooking time, pan size, seasoning or leavening; recipes scaled by more than about 4× usually need adjustment.

## Data Sources

- BC Campus – Basic Kitchen and Food Service Management: Converting and Adjusting Recipes and Formulas — https://opentextbc.ca/basickitchenandfoodservicemanagement/chapter/convert-and-adjust-recipes-and-formulas/ (textbook, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/recipe-scaler?original_servings=…&desired_servings=…`
- `POST https://tttkmbb.com/api/v1/calculate/recipe-scaler` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/recipe-scaler · OpenAPI operationId `scale_recipe` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "recipe-scaler", "inputs": {…}}`

## Example

- 4 → 10 servings, amounts 200, 3, 0.5: inputs `{"original_servings":4,"desired_servings":10,"ingredient_amounts":[200,3,0.5]}` → `{"scale_factor":2.5,"scale_percent":250,"scaled_amounts":[500,7.5,1.25]}`
- 6 → 2 servings: inputs `{"original_servings":6,"desired_servings":2,"ingredient_amounts":[300,2]}` → `{"scale_factor":0.3333,"scaled_amounts":[100,0.667]}`

```
GET https://tttkmbb.com/api/v1/calculate/recipe-scaler?original_servings=4&desired_servings=10&ingredient_amounts=200%2C3%2C0.5
```

## Limitations

You need to convert between measurement units (use cooking-converter) or to work with baker's percentages for dough (use bakers-percentage). Linear scaling is exact for ingredient quantities but not for cooking time, pan size, seasoning or leavening; recipes scaled by more than about 4× usually need adjustment. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do cooking times scale too?**

No. A doubled roast or cake needs more time but far less than double; check doneness by temperature or a skewer test rather than scaling the time.

**What about salt, spices and yeast?**

Scale them linearly as a starting point, then taste: seasoning is often reduced by 10–25 % in large batches, and yeast can be reduced slightly in big doughs because fermentation heat builds up.

## Related

- [Cooking Measurement Converter](https://tttkmbb.com/food/cooking-converter.md) — Convert the scaled quantities between cups, tablespoons and millilitres.
- [Baker's Percentage Calculator](https://tttkmbb.com/food/bakers-percentage.md) — Scale bread and pizza dough by flour weight instead.


---

# Cooking Measurement Converter

> Converts a kitchen volume between US customary units (teaspoon, tablespoon, fluid ounce, cup, pint, quart), the 250 ml metric cup, millilitres and litres using the exact US definitions.

- Calculator id: `cooking-converter` · Category: Food & Cooking (`food`) · Tool name: `convert_cooking_measurement`
- Canonical page: https://tttkmbb.com/food/cooking-converter · This document: https://tttkmbb.com/food/cooking-converter.md · JSON definition: https://tttkmbb.com/food/cooking-converter.json

## Purpose

Converts a kitchen volume between US customary units (teaspoon, tablespoon, fluid ounce, cup, pint, quart), the 250 ml metric cup, millilitres and litres using the exact US definitions.

**Use when:** A recipe uses cups, tablespoons or fluid ounces and you need millilitres (or the reverse), or you need to switch between US and metric cups.

**Do not use when:** You need grams: converting volume to weight requires the ingredient's density (e.g. 1 US cup of flour ≈ 120 g but of water ≈ 237 g), which this calculator does not do.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `value` | number |  | required | Quantity to convert, in from_unit. (min 0, max 1000000) |
| `from_unit` | enum: tsp \| tbsp \| fl_oz_us \| cup_us \| cup_metric \| ml \| l \| pint_us \| quart_us |  | required | Unit of the input amount. |
| `to_unit` | enum: tsp \| tbsp \| fl_oz_us \| cup_us \| cup_metric \| ml \| l \| pint_us \| quart_us |  | required | Unit to convert into. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `result` | number |  | Amount expressed in to_unit. |
| `value_ml` | number | ml | Input amount converted to millilitres (intermediate step). |
| `conversion_factor` | number |  | Number of to_unit in one from_unit. |

## Formula

`result = value × ml_per(from_unit) / ml_per(to_unit); ml per unit: tsp 4.92892, tbsp 14.7868, fl oz 29.5735, US cup 236.588, metric cup 250, US pint 473.176, US quart 946.353, litre 1000`

US customary units follow their legal definitions (1 US gallon = 3.785411784 L exactly, 1 cup = 1/16 gallon). Nutrition labels and many recipe sites use the rounded 5 ml / 15 ml / 30 ml / 240 ml values, which differ by up to 1.5 %.

## Data Sources

- NIST Special Publication 811 – Guide for the Use of the SI (Appendix B: US customary volume units in litres) — https://www.nist.gov/pml/special-publication-811 (standard, retrieved 2026-09-23)
- NIST – Metric Kitchen: cooking measurement equivalencies (rounded 5 / 15 / 30 / 240 ml values) — https://www.nist.gov/pml/owm/metric-si/metric-kitchen/metric-kitchen-cooking-measurement-equivalencies (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/cooking-converter?value=…&from_unit=…&to_unit=…`
- `POST https://tttkmbb.com/api/v1/calculate/cooking-converter` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/cooking-converter · OpenAPI operationId `convert_cooking_measurement` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "cooking-converter", "inputs": {…}}`

## Example

- 2 US cups to ml: inputs `{"value":2,"from_unit":"cup_us","to_unit":"ml"}` → `{"result":473.1765,"value_ml":473.176,"conversion_factor":236.588237}`
- 3 tablespoons to teaspoons: inputs `{"value":3,"from_unit":"tbsp","to_unit":"tsp"}` → `{"result":9,"conversion_factor":3}`

```
GET https://tttkmbb.com/api/v1/calculate/cooking-converter?value=2&from_unit=cup_us&to_unit=ml
```

## Limitations

You need grams: converting volume to weight requires the ingredient's density (e.g. 1 US cup of flour ≈ 120 g but of water ≈ 237 g), which this calculator does not do. US customary units follow their legal definitions (1 US gallon = 3.785411784 L exactly, 1 cup = 1/16 gallon). Nutrition labels and many recipe sites use the rounded 5 ml / 15 ml / 30 ml / 240 ml values, which differ by up to 1.5 %. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is a UK or Australian cup the same?**

No. The metric cup (Australia, NZ, Canada) is 250 ml; the old imperial cup is 284 ml and the imperial fluid ounce 28.41 ml. Use cup_metric for 250 ml cups.

**How do I convert cups to grams?**

Multiply the millilitre amount by the ingredient's density in g/ml (water 1.0, sugar ≈ 0.85, all-purpose flour ≈ 0.51–0.55 depending on how it is scooped).

## Related

- [Recipe Scaler](https://tttkmbb.com/food/recipe-scaler.md) — Scale the recipe before or after converting units.
- [Cooking Measurement Converter](https://tttkmbb.com/conversion/cooking-measurements.md) — Full unit-conversion tool including weights.


---

# Coffee Ratio Calculator

> Computes the grams of ground coffee for a given amount of water (or the water for a given dose) from a brew ratio, using method-specific default ratios (drip and pour-over 1:16, French press 1:15, AeroPress 1:13, cold brew concentrate 1:8, espresso 1:2) or a custom ratio.

- Calculator id: `coffee-ratio` · Category: Food & Cooking (`food`) · Tool name: `calculate_coffee_ratio`
- Canonical page: https://tttkmbb.com/food/coffee-ratio · This document: https://tttkmbb.com/food/coffee-ratio.md · JSON definition: https://tttkmbb.com/food/coffee-ratio.json

## Purpose

Computes the grams of ground coffee for a given amount of water (or the water for a given dose) from a brew ratio, using method-specific default ratios (drip and pour-over 1:16, French press 1:15, AeroPress 1:13, cold brew concentrate 1:8, espresso 1:2) or a custom ratio.

**Use when:** You want to know how much coffee to use for a certain volume of water, how much water a dose of coffee needs, or the ratio implied by amounts you already used.

**Do not use when:** You need caffeine content or extraction/TDS calculations; ratios here are by weight of dry coffee and water only.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `water_ml` | number | ml | optional | Brew water in millilitres (≈ grams). Give this and/or coffee_g. (> 0, max 100000) |
| `coffee_g` | number | g | optional | Ground coffee in grams. If both water_ml and coffee_g are given, the calculator reports the ratio they imply. (> 0, max 10000) |
| `brew_method` | enum: drip \| pour_over \| french_press \| aeropress \| cold_brew \| espresso |  | optional, default "drip" | Sets the default ratio (water parts per 1 part coffee) when no custom ratio is given. |
| `ratio` | number |  | optional | Water parts per 1 part coffee by weight, e.g. 16 for 1:16; overrides the brew-method default. (min 1, max 30) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `coffee_g` | number | g | Ground coffee dose. |
| `water_ml` | number | ml | Brew water (for espresso: beverage weight in grams). |
| `ratio` | number |  | Water parts per 1 part coffee. |
| `ratio_text` | string |  | Ratio written as 1:N. |
| `coffee_g_per_liter` | number | g/L | Grams of coffee per litre of water; the SCA Golden Cup range for filter coffee is 55 g/L ± 10 % (49.5–60.5 g/L). |
| `tablespoons_approx` | number | tbsp | Approximate volume of the dose at ~5.5 g of medium-ground coffee per level tablespoon; a scale is more accurate. |

## Formula

`coffee_g = water_ml / ratio (or water_ml = coffee_g × ratio); coffee_g_per_liter = 1000 / ratio; tablespoons ≈ coffee_g / 5.5`

Ratios are by weight; 1 ml of water weighs 1 g. The SCA Golden Cup Standard (55 g/L ± 10 %) corresponds to about 1:16.5–1:20; espresso ratios describe beverage yield rather than water added.

## Data Sources

- Specialty Coffee Association – Brewing best practices and Golden Cup Standard (55 g/L ± 10 %) — https://sca.coffee/research/protocols-best-practices (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/coffee-ratio?`
- `POST https://tttkmbb.com/api/v1/calculate/coffee-ratio` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/coffee-ratio · OpenAPI operationId `calculate_coffee_ratio` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "coffee-ratio", "inputs": {…}}`

## Example

- 500 ml drip coffee: inputs `{"water_ml":500,"brew_method":"drip"}` → `{"coffee_g":31.3,"water_ml":500,"ratio":16,"ratio_text":"1:16","coffee_g_per_liter":62.5}`
- 18 g espresso dose: inputs `{"coffee_g":18,"brew_method":"espresso"}` → `{"water_ml":36,"coffee_g":18,"ratio":2,"ratio_text":"1:2"}`

```
GET https://tttkmbb.com/api/v1/calculate/coffee-ratio?water_ml=500&brew_method=drip
```

## Limitations

You need caffeine content or extraction/TDS calculations; ratios here are by weight of dry coffee and water only. Ratios are by weight; 1 ml of water weighs 1 g. The SCA Golden Cup Standard (55 g/L ± 10 %) corresponds to about 1:16.5–1:20; espresso ratios describe beverage yield rather than water added. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I measure water in ml or grams?**

They are interchangeable for brewing (1 ml = 1 g). Weighing both coffee and water on a scale is the most repeatable method.

**Why does cold brew use 1:8?**

That is a concentrate ratio; dilute the finished brew roughly 1:1 with water or milk. For ready-to-drink cold brew use about 1:15.

## Related

- [Cooking Measurement Converter](https://tttkmbb.com/food/cooking-converter.md) — Convert cups or fluid ounces of water to millilitres first.


---

# Calories from Macros Calculator

> Converts grams of protein, carbohydrate, fat and alcohol into kilocalories and kilojoules with the Atwater general factors (4 / 4 / 9 / 7 kcal per gram) and reports each macronutrient's share of total energy.

- Calculator id: `calories-from-macros` · Category: Food & Cooking (`food`) · Tool name: `calculate_calories_from_macros`
- Canonical page: https://tttkmbb.com/food/calories-from-macros · This document: https://tttkmbb.com/food/calories-from-macros.md · JSON definition: https://tttkmbb.com/food/calories-from-macros.json

## Purpose

Converts grams of protein, carbohydrate, fat and alcohol into kilocalories and kilojoules with the Atwater general factors (4 / 4 / 9 / 7 kcal per gram) and reports each macronutrient's share of total energy.

**Use when:** You have the macronutrient grams of a food, meal or daily intake and need total calories or the percentage split, e.g. to check a food label or diet plan.

**Do not use when:** You want to go the other way, from a calorie target to gram targets (use macros), or need calorie needs (use tdee).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `protein_g` | number | g | required | Protein in grams. (min 0, max 5000) |
| `carbs_g` | number | g | required | Total carbohydrate in grams, including any fibre. (min 0, max 5000) |
| `fat_g` | number | g | required | Fat in grams. (min 0, max 5000) |
| `alcohol_g` | number | g | optional, default 0 | Ethanol in grams (a 330 ml 5 % beer contains about 13 g). (min 0, max 1000) |
| `fiber_g` | number | g | optional | Optional fibre included in carbs_g; counted at 2 kcal/g (EU labelling factor) instead of 4 kcal/g. (min 0, max 1000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `calories_kcal` | number | kcal | Sum of all macronutrient energy. |
| `energy_kj` | number | kJ | Total energy in kilojoules (× 4.184). |
| `protein_kcal` | number | kcal | protein_g × 4. |
| `carbs_kcal` | number | kcal | (carbs_g − fiber_g) × 4 + fiber_g × 2. |
| `fat_kcal` | number | kcal | fat_g × 9. |
| `alcohol_kcal` | number | kcal | alcohol_g × 7. |
| `protein_percent` | number | % | Protein energy as a percentage of total energy. |
| `carbs_percent` | number | % | Carbohydrate energy as a percentage of total energy. |
| `fat_percent` | number | % | Fat energy as a percentage of total energy. |
| `alcohol_percent` | number | % | Alcohol energy as a percentage of total energy. |

## Formula

`kcal = 4·protein_g + 4·(carbs_g − fiber_g) + 2·fiber_g + 9·fat_g + 7·alcohol_g; percent_x = kcal_x / kcal × 100; kJ = kcal × 4.184`

Atwater general factors are averages of metabolisable energy; label values can differ by a few percent because manufacturers may use specific factors, and US labels may count insoluble fibre at 0 kcal/g.

## Data Sources

- FAO (2003) Food energy – methods of analysis and conversion factors (Atwater general factors) — https://www.fao.org/4/y5022e/y5022e00.htm (standard, retrieved 2026-09-23)
- Regulation (EU) No 1169/2011 Annex XIV – energy conversion factors (fibre 2 kcal/g, alcohol 7 kcal/g) — https://eur-lex.europa.eu/eli/reg/2011/1169/oj (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/calories-from-macros?protein_g=…&carbs_g=…&fat_g=…`
- `POST https://tttkmbb.com/api/v1/calculate/calories-from-macros` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/calories-from-macros · OpenAPI operationId `calculate_calories_from_macros` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "calories-from-macros", "inputs": {…}}`

## Example

- 30 g protein, 40 g carbs, 10 g fat: inputs `{"protein_g":30,"carbs_g":40,"fat_g":10}` → `{"calories_kcal":370,"energy_kj":1548,"protein_kcal":120,"carbs_kcal":160,"fat_kcal":90,"protein_percent":32.4,"carbs_percent":43.2,"fat_percent":24.3,"alcohol_percent":0}`
- 25 / 50 / 15 g plus 14 g alcohol: inputs `{"protein_g":25,"carbs_g":50,"fat_g":15,"alcohol_g":14}` → `{"calories_kcal":533,"alcohol_kcal":98,"alcohol_percent":18.4,"carbs_percent":37.5}`

```
GET https://tttkmbb.com/api/v1/calculate/calories-from-macros?protein_g=30&carbs_g=40&fat_g=10
```

## Limitations

You want to go the other way, from a calorie target to gram targets (use macros), or need calorie needs (use tdee). Atwater general factors are averages of metabolisable energy; label values can differ by a few percent because manufacturers may use specific factors, and US labels may count insoluble fibre at 0 kcal/g. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why does the label show fewer calories than this?**

Labels may subtract insoluble fibre entirely (US) or use specific Atwater factors for the food; rounding rules also allow small differences.

**Does 'net carbs' apply here?**

Only via fiber_g: fibre is counted at 2 kcal/g. Sugar alcohols are not handled separately (they average about 2.4 kcal/g).

## Related

- [Macro Calculator](https://tttkmbb.com/health/macros.md) — Reverse direction: grams of each macro from a calorie target.
- [TDEE Calculator](https://tttkmbb.com/health/tdee.md) — Compare the intake with daily energy needs.


---

# Pizza Dough Calculator

> Computes the flour, water, salt, yeast and oil in grams for a number of pizza dough balls of a given weight from baker's percentages (hydration, salt, yeast, oil as % of flour).

- Calculator id: `pizza-dough` · Category: Food & Cooking (`food`) · Tool name: `calculate_pizza_dough`
- Canonical page: https://tttkmbb.com/food/pizza-dough · This document: https://tttkmbb.com/food/pizza-dough.md · JSON definition: https://tttkmbb.com/food/pizza-dough.json

## Purpose

Computes the flour, water, salt, yeast and oil in grams for a number of pizza dough balls of a given weight from baker's percentages (hydration, salt, yeast, oil as % of flour).

**Use when:** You want exact gram amounts for a batch of pizza dough balls, e.g. 4 balls of 250 g at 62 % hydration.

**Do not use when:** You are starting from a known flour weight or need custom ingredients (use bakers-percentage), or you need bread with preferments or several flours.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `number_of_pizzas` | integer |  | required | How many dough balls (pizzas) to make. (min 1, max 1000) |
| `ball_weight_g` | number | g | optional, default 250 | Weight of one dough ball; 200–280 g gives a 22–35 cm Neapolitan pizza, 300–350 g a 12-inch New York style. (min 50, max 2000) |
| `hydration_percent` | number | % | optional, default 62 | Water as a percentage of flour weight (Neapolitan 55–62 %, home-oven doughs 60–70 %). (min 40, max 100) |
| `salt_percent` | number | % | optional, default 2 | Salt as a percentage of flour weight (typically 2–3 %). (min 0, max 5) |
| `yeast_percent` | number | % | optional, default 0.3 | Instant dry yeast as a percentage of flour; use about 3× for fresh yeast, and less for long cold fermentation. (min 0, max 5) |
| `oil_percent` | number | % | optional, default 0 | Olive oil as a percentage of flour (0 for Neapolitan, 2–4 % for New York style). (min 0, max 15) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `flour_g` | number | g | Flour weight (100 %). |
| `water_g` | number | g | Water weight (= ml). |
| `salt_g` | number | g | Salt weight. |
| `yeast_g` | number | g | Instant dry yeast weight. |
| `oil_g` | number | g | Oil weight. |
| `total_dough_g` | number | g | number_of_pizzas × ball_weight_g. |

## Formula

`total = number_of_pizzas × ball_weight_g; flour = total / (1 + (hydration + salt + yeast + oil) / 100); water = flour × hydration/100; salt = flour × salt/100; yeast = flour × yeast/100; oil = flour × oil/100`

Baker's percentages express every ingredient relative to flour = 100 %. The AVPN Neapolitan regulation uses 1 L water to 1.6–1.8 kg flour (55–62 % hydration), 40–60 g salt per litre and 200–280 g balls.

## Data Sources

- Associazione Verace Pizza Napoletana – International Regulations (dough recipe and ball weight) — https://www.pizzanapoletana.org/en/ricetta_pizza_napoletana (standard, retrieved 2026-09-23)
- King Arthur Baking – Baker's percentage — https://www.kingarthurbaking.com/pro/reference/bakers-percentage (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/pizza-dough?number_of_pizzas=…`
- `POST https://tttkmbb.com/api/v1/calculate/pizza-dough` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/pizza-dough · OpenAPI operationId `calculate_pizza_dough` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "pizza-dough", "inputs": {…}}`

## Example

- 4 × 250 g, 62 % hydration, 2 % salt, 0.3 % yeast: inputs `{"number_of_pizzas":4,"ball_weight_g":250,"hydration_percent":62,"salt_percent":2,"yeast_percent":0.3,"oil_percent":0}` → `{"total_dough_g":1000,"flour_g":608.6,"water_g":377.4,"salt_g":12.2,"yeast_g":1.83,"oil_g":0}`
- 2 × 280 g, 65 % / 2.5 % / 0.5 % / 2 % oil: inputs `{"number_of_pizzas":2,"ball_weight_g":280,"hydration_percent":65,"salt_percent":2.5,"yeast_percent":0.5,"oil_percent":2}` → `{"flour_g":329.4,"water_g":214.1,"salt_g":8.2,"yeast_g":1.65,"oil_g":6.6}`

```
GET https://tttkmbb.com/api/v1/calculate/pizza-dough?number_of_pizzas=4&ball_weight_g=250&hydration_percent=62&salt_percent=2&yeast_percent=0.3&oil_percent=0
```

## Limitations

You are starting from a known flour weight or need custom ingredients (use bakers-percentage), or you need bread with preferments or several flours. Baker's percentages express every ingredient relative to flour = 100 %. The AVPN Neapolitan regulation uses 1 L water to 1.6–1.8 kg flour (55–62 % hydration), 40–60 g salt per litre and 200–280 g balls. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How much fresh or active dry yeast instead of instant?**

Fresh yeast ≈ 3 × instant by weight; active dry ≈ 1.25 × instant. For a 24–48 h cold ferment 0.1–0.2 % instant yeast is enough.

**Why does the sum of the ingredients equal the ball weight exactly?**

The flour is solved from the total so that flour + water + salt + yeast + oil equals the required dough weight; weigh an extra 1–2 % to cover losses on the bench.

## Related

- [Baker's Percentage Calculator](https://tttkmbb.com/food/bakers-percentage.md) — General baker's percentage conversions for any dough.
- [Recipe Scaler](https://tttkmbb.com/food/recipe-scaler.md) — Scale a dough recipe by servings.


---

# Brine Calculator

> Computes the grams of salt (and optional sugar) for a wet brine from the water volume and a percentage concentration expressed relative to the water weight (6 % = 60 g per litre).

- Calculator id: `brine` · Category: Food & Cooking (`food`) · Tool name: `calculate_brine`
- Canonical page: https://tttkmbb.com/food/brine · This document: https://tttkmbb.com/food/brine.md · JSON definition: https://tttkmbb.com/food/brine.json

## Purpose

Computes the grams of salt (and optional sugar) for a wet brine from the water volume and a percentage concentration expressed relative to the water weight (6 % = 60 g per litre).

**Use when:** You are brining poultry, pork or vegetables and need the salt for a given amount of water at a target strength.

**Do not use when:** You need a dry brine or an equilibrium brine based on the meat's weight (salt = 0.5–2 % of meat + water weight), or curing with nitrite salts, which follow different rules.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `water_liters` | number | L | required | Volume of water in litres (1 L = 1 kg). (> 0, max 1000) |
| `salt_percent` | number | % | optional, default 6 | Salt as a percentage of the water weight: 3–4 % mild (long brines), 5–6 % standard for poultry (4–12 h), 8–10 % quick brines (1–2 h). (min 0.5, max 30) |
| `sugar_percent` | number | % | optional, default 0 | Optional sugar as a percentage of the water weight (often half the salt). (min 0, max 30) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `salt_g` | number | g | Salt to dissolve in the water. |
| `sugar_g` | number | g | Sugar to dissolve in the water. |
| `water_g` | number | g | Water weight. |
| `brine_total_g` | number | g | Water + salt + sugar. |
| `salt_percent_of_solution` | number | % | Salt as a percentage of the finished brine weight, the convention used in food science tables. |

## Formula

`salt_g = water_liters × 1000 × salt_percent / 100; sugar_g = water_liters × 1000 × sugar_percent / 100; salt_percent_of_solution = 100 × salt_g / (water_g + salt_g + sugar_g)`

Percent of water weight (w/v) is the usual home-cooking convention; a 6 % brine is 60 g salt per litre, close to the USDA guideline of ¾ cup table salt per gallon (≈ 58 g/L). Sea water is about 3.5 %.

## Data Sources

- USDA FSIS – Poultry: Basting, Brining, and Marinating (¾ cup salt per gallon of water; brine in the refrigerator) — https://www.fsis.usda.gov/food-safety/safe-food-handling-and-preparation/poultry/poultry-basting-brining-and-marinating (government, retrieved 2026-09-23)
- Wikipedia – Brining — https://en.wikipedia.org/wiki/Brining (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/brine?water_liters=…`
- `POST https://tttkmbb.com/api/v1/calculate/brine` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/brine · OpenAPI operationId `calculate_brine` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "brine", "inputs": {…}}`

## Example

- 2 L at 6 % salt, 3 % sugar: inputs `{"water_liters":2,"salt_percent":6,"sugar_percent":3}` → `{"salt_g":120,"sugar_g":60,"water_g":2000,"brine_total_g":2180,"salt_percent_of_solution":5.5}`
- 4 L at 3.5 % salt: inputs `{"water_liters":4,"salt_percent":3.5}` → `{"salt_g":140,"sugar_g":0,"salt_percent_of_solution":3.38}`

```
GET https://tttkmbb.com/api/v1/calculate/brine?water_liters=2&salt_percent=6&sugar_percent=3
```

## Limitations

You need a dry brine or an equilibrium brine based on the meat's weight (salt = 0.5–2 % of meat + water weight), or curing with nitrite salts, which follow different rules. Percent of water weight (w/v) is the usual home-cooking convention; a 6 % brine is 60 g salt per litre, close to the USDA guideline of ¾ cup table salt per gallon (≈ 58 g/L). Sea water is about 3.5 %. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How many tablespoons is that?**

It depends on the salt: table salt ≈ 18 g per tablespoon, Morton kosher ≈ 15 g, Diamond Crystal kosher ≈ 9 g. Weigh salt whenever possible.

**How long should I brine?**

At 5–6 %: whole chicken 4–12 h, turkey 12–24 h, pork chops 1–4 h, shrimp 30 min; always in the refrigerator. Rinse or reduce added salt afterwards.

## Related

- [Turkey Cooking Time Calculator](https://tttkmbb.com/food/turkey-cooking-time.md) — Roasting time for the brined turkey.
- [Cooking Measurement Converter](https://tttkmbb.com/food/cooking-converter.md) — Convert gallons or quarts of water to litres.


---

# Rice to Water Ratio Calculator

> Computes the water needed for a quantity of uncooked rice (cups or grams) using absorption-method ratios by rice type: long-grain white 1:1.5, jasmine 1:1.25, basmati 1:1.5, brown 1:2, sushi 1:1.1, wild 1:3.

- Calculator id: `rice-water` · Category: Food & Cooking (`food`) · Tool name: `calculate_rice_water_ratio`
- Canonical page: https://tttkmbb.com/food/rice-water · This document: https://tttkmbb.com/food/rice-water.md · JSON definition: https://tttkmbb.com/food/rice-water.json

## Purpose

Computes the water needed for a quantity of uncooked rice (cups or grams) using absorption-method ratios by rice type: long-grain white 1:1.5, jasmine 1:1.25, basmati 1:1.5, brown 1:2, sushi 1:1.1, wild 1:3.

**Use when:** You are cooking rice by the absorption method (tight lid or rice cooker) and need the water amount for a given quantity and type of rice.

**Do not use when:** You boil rice in excess water and drain it (ratio irrelevant), cook risotto or paella, or follow a package instruction that specifies a different ratio for that product.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `rice_cups` | number | cups | optional | Uncooked rice in US cups (236.6 ml). Give this or rice_g. (> 0, max 100) |
| `rice_g` | number | g | optional | Uncooked rice in grams; converted at 185 g per cup. Ignored when rice_cups is given. (> 0, max 20000) |
| `rice_type` | enum: white_long \| jasmine \| basmati \| brown \| sushi \| wild |  | optional, default "white_long" | Rice type; sets the water-to-rice volume ratio. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `water_cups` | number | cups | Water in US cups. |
| `water_ml` | number | ml | Water in millilitres (cups × 236.6). |
| `rice_cups_used` | number | cups | Rice quantity used, in cups. |
| `ratio` | string |  | Volume ratio applied, rice : water. |
| `cooked_rice_cups_approx` | number | cups | Approximate cooked volume: about 3× for white and brown rice, 4× for wild rice. |

## Formula

`rice_cups = rice_g / 185 (if grams given); water_cups = rice_cups × ratio; water_ml = water_cups × 236.588; ratio: white_long 1.5, jasmine 1.25, basmati 1.5, brown 2, sushi 1.1, wild 3`

Ratios are by volume for rinsed rice cooked covered with minimal evaporation (rice cooker or tight lid). Stovetop guides such as USA Rice quote up to 2:1 for white and 2¼:1 for brown rice because more water boils off; larger batches need proportionally less water.

## Data Sources

- USA Rice – How to cook rice (liquid-to-rice ratios by type) — https://www.usarice.com/thinkrice/how-to/how-to-cook-rice (reference, retrieved 2026-09-23)
- America's Test Kitchen – Nailing the perfect ratio of water to rice (absorption vs evaporation) — https://www.americastestkitchen.com/articles/1692-nailing-the-perfect-ratio-of-water-to-rice (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/rice-water?`
- `POST https://tttkmbb.com/api/v1/calculate/rice-water` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/rice-water · OpenAPI operationId `calculate_rice_water_ratio` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "rice-water", "inputs": {…}}`

## Example

- 2 cups jasmine: inputs `{"rice_cups":2,"rice_type":"jasmine"}` → `{"water_cups":2.5,"water_ml":591,"rice_cups_used":2,"ratio":"1:1.25"}`
- 300 g basmati: inputs `{"rice_g":300,"rice_type":"basmati"}` → `{"rice_cups_used":1.62,"water_cups":2.43,"water_ml":575,"ratio":"1:1.5"}`

```
GET https://tttkmbb.com/api/v1/calculate/rice-water?rice_cups=2&rice_type=jasmine
```

## Limitations

You boil rice in excess water and drain it (ratio irrelevant), cook risotto or paella, or follow a package instruction that specifies a different ratio for that product. Ratios are by volume for rinsed rice cooked covered with minimal evaporation (rice cooker or tight lid). Stovetop guides such as USA Rice quote up to 2:1 for white and 2¼:1 for brown rice because more water boils off; larger batches need proportionally less water. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I rinse the rice and does it change the water?**

Rinse until the water runs mostly clear for fluffier long-grain and sushi rice; drained rinsed rice carries a little water, so the ratios already assume rinsing. Soaking basmati 20–30 min lets you use slightly less water.

**Why does my pot need more water than a rice cooker?**

Evaporation. A loose lid or long simmer loses water that a rice cooker retains; add about ¼ cup per cup of rice on the stove if the rice comes out dry.

## Related

- [Cooking Measurement Converter](https://tttkmbb.com/food/cooking-converter.md) — Convert the water to millilitres or fluid ounces.
- [Recipe Scaler](https://tttkmbb.com/food/recipe-scaler.md) — Scale the whole meal by servings.


---

# Baker's Percentage Calculator

> Converts a bread or dough formula between baker's percentages and grams: flour is 100 %, every other ingredient is expressed relative to flour weight; works in both directions and reports total dough weight and hydration.

- Calculator id: `bakers-percentage` · Category: Food & Cooking (`food`) · Tool name: `calculate_bakers_percentage`
- Canonical page: https://tttkmbb.com/food/bakers-percentage · This document: https://tttkmbb.com/food/bakers-percentage.md · JSON definition: https://tttkmbb.com/food/bakers-percentage.json

## Purpose

Converts a bread or dough formula between baker's percentages and grams: flour is 100 %, every other ingredient is expressed relative to flour weight; works in both directions and reports total dough weight and hydration.

**Use when:** You know the flour weight and the formula percentages (or the ingredient grams) and want the other representation, e.g. to scale or compare bread recipes.

**Do not use when:** You want a ready-made pizza formula from ball count and weight (use pizza-dough) or plain servings-based scaling (use recipe-scaler).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `flour_g` | number | g | required | Total flour weight (= 100 %). (> 0, max 1000000) |
| `ingredient_names` | string_list |  | required | Names of the non-flour ingredients, in order (comma-separated; use underscores instead of spaces, e.g. olive_oil). |
| `ingredient_percents` | number_list |  | optional | Baker's percentage of each ingredient (same order as the names). Give this to get grams. |
| `ingredient_grams` | number_list |  | optional | Weight of each ingredient in grams (same order). Used when ingredient_percents is not given, to get percentages. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ingredients` | list |  | Per ingredient: ingredient, percent (of flour) and grams. |
| `total_dough_g` | number | g | Flour plus all ingredients. |
| `total_percent` | number | % | 100 + sum of ingredient percentages; total_dough = flour × total_percent / 100. |
| `hydration_percent` | number | % | Percentage of the ingredient named 'water' (only when present). |

## Formula

`grams_i = flour_g × percent_i / 100; percent_i = grams_i / flour_g × 100; total_dough = flour_g + Σ grams_i; total_percent = 100 + Σ percent_i`

Baker's percentages let a formula be scaled to any flour weight and compared across recipes; hydration is the water percentage. For a preferment, count its flour in flour_g if you want true overall percentages.

## Data Sources

- King Arthur Baking – Baker's percentage — https://www.kingarthurbaking.com/pro/reference/bakers-percentage (reference, retrieved 2026-09-23)
- Wikipedia – Baker percentage — https://en.wikipedia.org/wiki/Baker_percentage (reference, retrieved 2026-09-23)
- BC Campus – Basic Kitchen and Food Service Management: Converting and Adjusting Recipes and Formulas — https://opentextbc.ca/basickitchenandfoodservicemanagement/chapter/convert-and-adjust-recipes-and-formulas/ (textbook, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/bakers-percentage?flour_g=…&ingredient_names=…`
- `POST https://tttkmbb.com/api/v1/calculate/bakers-percentage` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/bakers-percentage · OpenAPI operationId `calculate_bakers_percentage` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "bakers-percentage", "inputs": {…}}`

## Example

- 500 g flour, 65 % water, 2 % salt, 1 % yeast: inputs `{"flour_g":500,"ingredient_names":["water","salt","yeast"],"ingredient_percents":[65,2,1]}` → `{"ingredients":[{"ingredient":"water","percent":65,"grams":325},{"ingredient":"salt","percent":2,"grams":10},{"ingredient":"yeast","percent":1,"grams":5}],"total_dough_g":840,"total_percent":168,"hydration_percent":65}`
- 1000 g flour, 700 g water, 20 g salt → percentages: inputs `{"flour_g":1000,"ingredient_names":["water","salt"],"ingredient_grams":[700,20]}` → `{"ingredients":[{"ingredient":"water","percent":70,"grams":700},{"ingredient":"salt","percent":2,"grams":20}],"total_dough_g":1720,"total_percent":172,"hydration_percent":70}`

```
GET https://tttkmbb.com/api/v1/calculate/bakers-percentage?flour_g=500&ingredient_names=water%2Csalt%2Cyeast&ingredient_percents=65%2C2%2C1
```

## Limitations

You want a ready-made pizza formula from ball count and weight (use pizza-dough) or plain servings-based scaling (use recipe-scaler). Baker's percentages let a formula be scaled to any flour weight and compared across recipes; hydration is the water percentage. For a preferment, count its flour in flour_g if you want true overall percentages. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why can percentages add up to more than 100?**

Because each ingredient is relative to the flour, not to the whole dough. A 65 % hydration bread with 2 % salt and 1 % yeast totals 168 %, meaning 1.68 g of dough per gram of flour.

**How do I scale to a target dough weight?**

flour = target_dough / (total_percent / 100). For 1 kg of dough at 168 % use 595 g flour, then multiply each percentage by it.

## Related

- [Pizza Dough Calculator](https://tttkmbb.com/food/pizza-dough.md) — Preset pizza formula from ball count and weight.
- [Recipe Scaler](https://tttkmbb.com/food/recipe-scaler.md) — Simple servings-based scaling.


---

# Turkey Cooking Time Calculator

> Looks up the USDA FSIS roasting timetable for a whole turkey at 325 °F (163 °C) by weight and stuffing, returning the time range in minutes, the 165 °F (74 °C) safe internal temperature and refrigerator thawing time.

- Calculator id: `turkey-cooking-time` · Category: Food & Cooking (`food`) · Tool name: `estimate_turkey_cooking_time`
- Canonical page: https://tttkmbb.com/food/turkey-cooking-time · This document: https://tttkmbb.com/food/turkey-cooking-time.md · JSON definition: https://tttkmbb.com/food/turkey-cooking-time.json

## Purpose

Looks up the USDA FSIS roasting timetable for a whole turkey at 325 °F (163 °C) by weight and stuffing, returning the time range in minutes, the 165 °F (74 °C) safe internal temperature and refrigerator thawing time.

**Use when:** You need to plan how long a turkey of a given weight takes to roast in a conventional oven and when to start thawing it.

**Do not use when:** You are deep-frying, smoking, spatchcocking, cooking a turkey breast only over 8 lb, or roasting at a different oven temperature; the USDA table covers whole birds at 325 °F only.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `weight` | number |  | required | Weight of the whole (thawed) turkey, in weight_unit. Covered range: 4–24 lb (1.8–10.9 kg) unstuffed, 8–24 lb stuffed. (> 0, max 50) |
| `weight_unit` | enum: kg \| lb |  | optional, default "kg" | Unit of the weight input. |
| `stuffed` | boolean |  | optional, default false | true if the cavity is filled with stuffing (adds roughly 15–45 minutes and the stuffing must also reach 165 °F). |
| `oven_temperature` | enum: 163c_325f |  | optional, default "163c_325f" | Oven setting; the USDA timetable is defined for 325 °F only. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `min_minutes` | number | min | Lower end of the USDA time range. |
| `max_minutes` | number | min | Upper end of the USDA time range. |
| `time_range` | string |  | Time range in hours and minutes. |
| `weight_lb` | number | lb | Turkey weight in pounds. |
| `weight_kg` | number | kg | Turkey weight in kilograms. |
| `usda_weight_band` | string |  | Row of the USDA timetable applied. |
| `safe_internal_temp_c` | number | °C | Minimum internal temperature in the thickest part of thigh, wing and breast (and stuffing centre). |
| `safe_internal_temp_f` | number | °F | Same in Fahrenheit. |
| `thaw_refrigerator_days` | string |  | About 24 hours per 4–5 lb at 4 °C / 40 °F. |

## Formula

`Lookup by weight_lb in the USDA FSIS timetable (325 °F): unstuffed 8–12 lb 2¾–3 h, 12–14 lb 3–3¾ h, 14–18 lb 3¾–4¼ h, 18–20 lb 4¼–4½ h, 20–24 lb 4½–5 h (breast 4–6 lb 1½–2¼ h, 6–8 lb 2¼–3¼ h); stuffed 8–12 lb 3–3½ h, 12–14 lb 3½–4 h, 14–18 lb 4–4¼ h, 18–20 lb 4¼–4¾ h, 20–24 lb 4¾–5¼ h; thaw_days = weight_lb / 5 to weight_lb / 4`

Times are for a fresh or fully thawed bird in an open pan at 325 °F and are approximate; doneness must be verified with a food thermometer reading 165 °F (74 °C). Let the turkey stand 20 minutes before carving or removing stuffing.

## Data Sources

- USDA FSIS – Turkey Basics: Safe Cooking (roasting timetable at 325 °F; 165 °F minimum internal temperature) — https://www.fsis.usda.gov/food-safety/safe-food-handling-and-preparation/poultry/turkey-basics-safe-cooking (government, retrieved 2026-09-23)
- USDA FSIS – Let's Talk Turkey: a consumer guide to safely roasting a turkey — https://www.fsis.usda.gov/food-safety/safe-food-handling-and-preparation/poultry/lets-talk-turkey-roasting (government, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/turkey-cooking-time?weight=…`
- `POST https://tttkmbb.com/api/v1/calculate/turkey-cooking-time` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/turkey-cooking-time · OpenAPI operationId `estimate_turkey_cooking_time` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "turkey-cooking-time", "inputs": {…}}`

## Example

- 6.5 kg unstuffed: inputs `{"weight":6.5,"weight_unit":"kg","stuffed":false}` → `{"weight_lb":14.3,"min_minutes":225,"max_minutes":255,"time_range":"3 h 45 min – 4 h 15 min","usda_weight_band":"14 to 18 lb, unstuffed","safe_internal_temp_c":74,"safe_internal_temp_f":165}`
- 20 lb stuffed: inputs `{"weight":20,"weight_unit":"lb","stuffed":true}` → `{"weight_kg":9.07,"min_minutes":255,"max_minutes":285,"time_range":"4 h 15 min – 4 h 45 min","usda_weight_band":"18 to 20 lb, stuffed"}`

```
GET https://tttkmbb.com/api/v1/calculate/turkey-cooking-time?weight=6.5&weight_unit=kg&stuffed=false
```

## Limitations

You are deep-frying, smoking, spatchcocking, cooking a turkey breast only over 8 lb, or roasting at a different oven temperature; the USDA table covers whole birds at 325 °F only. Times are for a fresh or fully thawed bird in an open pan at 325 °F and are approximate; doneness must be verified with a food thermometer reading 165 °F (74 °C). Let the turkey stand 20 minutes before carving or removing stuffing. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Where do I put the thermometer?**

In the innermost part of the thigh and wing and the thickest part of the breast, not touching bone; a stuffed bird is done only when the centre of the stuffing also reads 165 °F (74 °C).

**Can I roast at a higher temperature to save time?**

Many recipes use 350–425 °F, but the USDA timetable does not cover them; rely on the thermometer and expect roughly 10–20 % shorter times at 350 °F.

## Related

- [Brine Calculator](https://tttkmbb.com/food/brine.md) — Brine the turkey before roasting.
- [Cooking Measurement Converter](https://tttkmbb.com/food/cooking-converter.md) — Convert kitchen volumes for the stuffing or brine.


---

# Flooring Calculator

> Computes the floor area of a rectangular room, adds a cutting-waste allowance and converts the result into the number of boxes to buy from the coverage printed on the packaging. Areas are reported in m² and ft².

- Calculator id: `flooring` · Category: Construction & Home (`construction`) · Tool name: `estimate_flooring_materials`
- Canonical page: https://tttkmbb.com/construction/flooring · This document: https://tttkmbb.com/construction/flooring.md · JSON definition: https://tttkmbb.com/construction/flooring.json

## Purpose

Computes the floor area of a rectangular room, adds a cutting-waste allowance and converts the result into the number of boxes to buy from the coverage printed on the packaging. Areas are reported in m² and ft².

**Use when:** You need to order laminate, vinyl plank, hardwood, carpet tiles or underlay for a room and want the area with waste and the box count.

**Do not use when:** You are counting individual tiles with grout joints (use tile), boards for an outdoor deck (use decking) or the room is L-shaped: split it into rectangles, run this for each and add the results (or use rectangle for the areas).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `room_length` | number | m or ft | required | Room length in metres (metric) or feet (imperial). (> 0, max 1000) |
| `room_width` | number | m or ft | required | Room width in metres or feet. (> 0, max 1000) |
| `waste_percent` | number | % | optional, default 10 | Extra material for cuts, breakage and offcuts, applied as a multiplier (1 + waste_percent/100). Use 5–10 % for straight layouts and about 15 % for diagonal or herringbone patterns. (min 0, max 50) |
| `box_coverage` | number | m² or ft² | optional | Area covered by one box or carton, in m² (metric) or ft² (imperial), as printed on the packaging. Optional; enables the box count. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area_m2` | number | m² | room_length × room_width. |
| `area_ft2` | number | ft² | Same area in square feet (1 m² = 10.7639 ft²). |
| `area_with_waste_m2` | number | m² | Area × (1 + waste_percent/100). |
| `area_with_waste_ft2` | number | ft² | Area to order in square feet. |
| `boxes_needed` | integer |  | ceil(area_with_waste / box_coverage); only when box_coverage is given. |

## Formula

`area = room_length × room_width; area_with_waste = area × (1 + waste_percent/100); boxes_needed = ceil(area_with_waste / box_coverage). 1 ft² = 0.09290304 m².`

## Data Sources

- Best Laminate – What is the laminate flooring waste factor? (5–10 %) — https://www.bestlaminate.com/blog/what-is-the-laminate-flooring-waste-factor/ (reference, retrieved 2026-09-23)
- Wood Floor Business (NWFA) – How to calculate install waste factors — https://www.woodfloorbusiness.com/installation/techniques/article/15124419/wood-flooring-qa-how-to-calculate-install-waste-factors (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/flooring?room_length=…&room_width=…`
- `POST https://tttkmbb.com/api/v1/calculate/flooring` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/flooring · OpenAPI operationId `estimate_flooring_materials` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "flooring", "inputs": {…}}`

## Example

- 5 m × 4 m room, 10 % waste, 2.2 m² boxes: inputs `{"unit_system":"metric","room_length":5,"room_width":4,"waste_percent":10,"box_coverage":2.2}` → `{"area_m2":20,"area_ft2":215.28,"area_with_waste_m2":22,"area_with_waste_ft2":236.81,"boxes_needed":10}`
- 15 ft × 12 ft room, 10 % waste, 20 ft² boxes: inputs `{"unit_system":"imperial","room_length":15,"room_width":12,"waste_percent":10,"box_coverage":20}` → `{"area_ft2":180,"area_m2":16.72,"area_with_waste_ft2":198,"area_with_waste_m2":18.39,"boxes_needed":10}`

```
GET https://tttkmbb.com/api/v1/calculate/flooring?unit_system=metric&room_length=5&room_width=4&waste_percent=10&box_coverage=2.2
```

## Limitations

You are counting individual tiles with grout joints (use tile), boards for an outdoor deck (use decking) or the room is L-shaped: split it into rectangles, run this for each and add the results (or use rectangle for the areas). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How much waste should I add?**

5–10 % for a straight lay in a simple rectangular room; 15 % for diagonal, herringbone or rooms with many alcoves. Keep a few spare planks for future repairs.

**Should I subtract cabinets or islands?**

Only permanent built-ins that sit directly on the subfloor; floating floors normally run under movable furniture and appliances.

## Related

- [Tile Calculator](https://tttkmbb.com/construction/tile.md) — Count individual tiles including grout joints.
- [Paint Calculator](https://tttkmbb.com/construction/paint.md) — Estimate paint for the same room.
- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Area of the individual rectangles of an irregular room.


---

# Paint Calculator

> Estimates wall paint from the wall area (room length, width and height, or a given area), subtracting 1.9 m² per door and 1.4 m² per window, multiplying by the number of coats and dividing by the coverage rate; reports litres, US gallons and cans.

- Calculator id: `paint` · Category: Construction & Home (`construction`) · Tool name: `estimate_paint_needed`
- Canonical page: https://tttkmbb.com/construction/paint · This document: https://tttkmbb.com/construction/paint.md · JSON definition: https://tttkmbb.com/construction/paint.json

## Purpose

Estimates wall paint from the wall area (room length, width and height, or a given area), subtracting 1.9 m² per door and 1.4 m² per window, multiplying by the number of coats and dividing by the coverage rate; reports litres, US gallons and cans.

**Use when:** You need to know how much paint to buy for the walls of a room or for a known wall area, in litres or gallons and cans.

**Do not use when:** You need ceiling, floor or exterior siding paint with different coverage rates (enter the area and the product's coverage directly), or you need the wall area only (use rectangle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `room_length` | number | m or ft | optional | Room length (m or ft). Used with room_width and wall_height when wall_area is not given. (> 0, max 1000) |
| `room_width` | number | m or ft | optional | Room width (m or ft). (> 0, max 1000) |
| `wall_height` | number | m or ft | optional | Floor-to-ceiling height (m or ft). (> 0, max 100) |
| `wall_area` | number | m² or ft² | optional | Gross wall area before openings (m² or ft²). When given, the room dimensions are ignored. (> 0) |
| `doors` | integer |  | optional, default 1 | Number of doors; 1.9 m² (20.5 ft²) is subtracted per door. (min 0, max 100) |
| `windows` | integer |  | optional, default 1 | Number of windows; 1.4 m² (15.1 ft²) is subtracted per window. (min 0, max 100) |
| `coats` | integer |  | optional, default 2 | Number of coats. Two coats are standard for colour changes; primer is not included. (min 1, max 5) |
| `coverage` | number |  | optional | Coverage from the tin: m² per litre in metric (default 10) or ft² per US gallon in imperial (default 350). Typical emulsion covers 10–14 m²/L (350–400 ft²/gal). (> 0) |
| `can_size` | number |  | optional | Litres per can (metric, default 5) or US gallons per can (imperial, default 1); used for the can count. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `gross_wall_area_m2` | number | m² | 2 × (length + width) × height, or wall_area. |
| `gross_wall_area_ft2` | number | ft² | Gross wall area in square feet. |
| `paintable_area_m2` | number | m² | Gross area minus 1.9 m² per door and 1.4 m² per window. |
| `paintable_area_ft2` | number | ft² | Paintable area in square feet. |
| `paint_liters` | number | L | paintable_area × coats / coverage, in litres. |
| `paint_gallons` | number | US gal | Same amount in US gallons (1 gal = 3.785 L). |
| `cans_needed` | integer |  | ceil(paint needed / can_size). |
| `can_size_used` | string |  | Can size assumed for the can count. |

## Formula

`gross = 2 × (room_length + room_width) × wall_height (or wall_area); paintable = gross − 1.9 m² × doors − 1.4 m² × windows; litres = paintable_m² × coats / coverage_m²_per_L; gallons = litres / 3.785; cans = ceil(litres / can_size). Imperial coverage: ft²/gal × 0.09290304 / 3.785411784 = m²/L.`

The door (1.9 m² ≈ 0.9 × 2.1 m) and window (1.4 m²) deductions are conventional averages; real coverage depends on surface texture, porosity, colour change and application method, so read the coverage figure from the product label.

## Data Sources

- Sherwin-Williams – Paint calculator FAQ (a gallon covers about 350–400 sq ft) — https://www.sherwin-williams.com/en-us/color/color-tools/paint-calculator (reference, retrieved 2026-09-23)
- Dulux – Paint calculator (coverage varies by surface and product) — https://www.dulux.co.uk/en/paint-calculator (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/paint?`
- `POST https://tttkmbb.com/api/v1/calculate/paint` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/paint · OpenAPI operationId `estimate_paint_needed` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "paint", "inputs": {…}}`

## Example

- 5 m × 4 m × 2.4 m, 1 door, 2 windows, 2 coats, 10 m²/L, 5 L cans: inputs `{"unit_system":"metric","room_length":5,"room_width":4,"wall_height":2.4,"doors":1,"windows":2,"coats":2,"coverage":10,"can_size":5}` → `{"gross_wall_area_m2":43.2,"gross_wall_area_ft2":465,"paintable_area_m2":38.5,"paintable_area_ft2":414.41,"paint_liters":7.7,"paint_gallons":2.03,"cans_needed":2,"can_size_used":"5 L"}`
- 15 ft × 12 ft × 8 ft, 2 doors, 2 windows, 2 coats, 350 ft²/gal, 1 gal cans: inputs `{"unit_system":"imperial","room_length":15,"room_width":12,"wall_height":8,"doors":2,"windows":2,"coats":2}` → `{"gross_wall_area_ft2":432,"gross_wall_area_m2":40.13,"paintable_area_ft2":360.96,"paint_gallons":2.06,"paint_liters":7.81,"cans_needed":3,"can_size_used":"1 gal"}`

```
GET https://tttkmbb.com/api/v1/calculate/paint?unit_system=metric&room_length=5&room_width=4&wall_height=2.4&doors=1&windows=2&coats=2&coverage=10&can_size=5
```

## Limitations

You need ceiling, floor or exterior siding paint with different coverage rates (enter the area and the product's coverage directly), or you need the wall area only (use rectangle). The door (1.9 m² ≈ 0.9 × 2.1 m) and window (1.4 m²) deductions are conventional averages; real coverage depends on surface texture, porosity, colour change and application method, so read the coverage figure from the product label. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does this include primer or the ceiling?**

No. Primer covers only 200–300 ft²/gal (5–7 m²/L) and is estimated separately; for the ceiling enter its area as wall_area with doors = 0 and windows = 0.

**Why litres and gallons at the same time?**

Paint is sold in litres in most countries and in US gallons/quarts in the USA; both are reported from the same paintable area so either label can be used.

**What if coverage is given per coat on the tin?**

Coverage rates on labels are always per coat; this calculator multiplies by the number of coats, so enter the label value unchanged.

## Related

- [Wallpaper Calculator](https://tttkmbb.com/construction/wallpaper.md) — Rolls of wallpaper for the same walls.
- [Drywall Calculator](https://tttkmbb.com/construction/drywall.md) — Sheets of plasterboard for the same walls.
- [Flooring Calculator](https://tttkmbb.com/construction/flooring.md) — Floor material for the same room.


---

# Concrete Slab Calculator

> Computes the concrete volume of a rectangular slab, footing or pad from length, width and thickness, adds a waste allowance and converts it to cubic yards, cubic feet and the number of 80 lb, 60 lb and 25 kg bags of premixed concrete.

- Calculator id: `concrete-slab` · Category: Construction & Home (`construction`) · Tool name: `estimate_concrete_slab`
- Canonical page: https://tttkmbb.com/construction/concrete-slab · This document: https://tttkmbb.com/construction/concrete-slab.md · JSON definition: https://tttkmbb.com/construction/concrete-slab.json

## Purpose

Computes the concrete volume of a rectangular slab, footing or pad from length, width and thickness, adds a waste allowance and converts it to cubic yards, cubic feet and the number of 80 lb, 60 lb and 25 kg bags of premixed concrete.

**Use when:** You need the amount of ready-mix concrete to order or the number of premix bags for a slab, patio, shed base, footing or pad of uniform thickness.

**Do not use when:** The pour is a cylinder such as a post hole or pier (use cylinder for the volume), or you need mortar for brickwork (use brick).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `length` | number | m or ft | required | Slab length in metres or feet. (> 0, max 1000) |
| `width` | number | m or ft | required | Slab width in metres or feet. (> 0, max 1000) |
| `thickness` | number | cm or in | required | Slab thickness in centimetres (metric) or inches (imperial). Typical: 10 cm / 4 in for paths and patios, 15 cm / 6 in for driveways. (> 0, max 500) |
| `waste_percent` | number | % | optional, default 10 | Extra material for cuts, breakage and offcuts, applied as a multiplier (1 + waste_percent/100). Covers uneven sub-base, spillage and over-excavation; 5–10 % is usual. (min 0, max 50) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume_m3` | number | m³ | length × width × thickness, before waste. |
| `volume_cubic_feet` | number | ft³ | Same volume in cubic feet. |
| `volume_cubic_yards` | number | yd³ | Same volume in cubic yards (1 yd³ = 27 ft³ = 0.7646 m³). |
| `volume_with_waste_m3` | number | m³ | Volume × (1 + waste_percent/100). |
| `volume_with_waste_cubic_yards` | number | yd³ | Volume to order in cubic yards. |
| `bags_80lb` | integer |  | ceil(volume_with_waste_ft³ / 0.60 ft³ per bag). |
| `bags_60lb` | integer |  | ceil(volume_with_waste_ft³ / 0.45 ft³ per bag). |
| `bags_25kg` | integer |  | ceil(volume_with_waste_m³ × 96 bags per m³), assuming about 2400 kg of dry premix per m³ of placed concrete. |

## Formula

`volume = length × width × thickness (thickness/100 in m or thickness/12 in ft); with_waste = volume × (1 + waste_percent/100); yd³ = ft³ / 27; m³ = ft³ × 0.028316847; bags_80lb = ceil(ft³ / 0.60); bags_60lb = ceil(ft³ / 0.45); bags_25kg = ceil(m³ × 96).`

Bag yields follow the QUIKRETE data sheet (80 lb → 0.60 ft³, 60 lb → 0.45 ft³). The 25 kg count assumes ≈ 2400 kg of dry mix per m³ (96 bags), a conservative figure: manufacturer yields of 0.010–0.0125 m³ per 25 kg bag correspond to 80–100 bags/m³, so check the bag.

## Data Sources

- QUIKRETE Concrete Mix No. 1101 product data sheet (yield: 80 lb bag 0.60 ft³, 60 lb bag 0.45 ft³) — https://www.quikrete.com/pdfs/data_sheet-concrete%20mix%201101.pdf (reference, retrieved 2026-09-23)
- QUIKRETE – Concrete, mortar and post-setting calculators — https://www.quikrete.com/calculator/main.asp (reference, retrieved 2026-09-23)
- Wikipedia – Concrete (density of normal-weight concrete ≈ 2400 kg/m³) — https://en.wikipedia.org/wiki/Concrete (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/concrete-slab?length=…&width=…&thickness=…`
- `POST https://tttkmbb.com/api/v1/calculate/concrete-slab` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/concrete-slab · OpenAPI operationId `estimate_concrete_slab` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "concrete-slab", "inputs": {…}}`

## Example

- 10 ft × 20 ft slab, 4 in thick, 10 % waste: inputs `{"unit_system":"imperial","length":10,"width":20,"thickness":4,"waste_percent":10}` → `{"volume_cubic_feet":66.67,"volume_cubic_yards":2.469,"volume_m3":1.888,"volume_with_waste_cubic_yards":2.716,"volume_with_waste_m3":2.077,"bags_80lb":123,"bags_60lb":163,"bags_25kg":200}`
- 4 m × 3 m slab, 10 cm thick, 10 % waste: inputs `{"unit_system":"metric","length":4,"width":3,"thickness":10,"waste_percent":10}` → `{"volume_m3":1.2,"volume_cubic_yards":1.57,"volume_with_waste_m3":1.32,"volume_with_waste_cubic_yards":1.727,"bags_25kg":127,"bags_80lb":78,"bags_60lb":104}`

```
GET https://tttkmbb.com/api/v1/calculate/concrete-slab?unit_system=imperial&length=10&width=20&thickness=4&waste_percent=10
```

## Limitations

The pour is a cylinder such as a post hole or pier (use cylinder for the volume), or you need mortar for brickwork (use brick). Bag yields follow the QUIKRETE data sheet (80 lb → 0.60 ft³, 60 lb → 0.45 ft³). The 25 kg count assumes ≈ 2400 kg of dry mix per m³ (96 bags), a conservative figure: manufacturer yields of 0.010–0.0125 m³ per 25 kg bag correspond to 80–100 bags/m³, so check the bag. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I order ready-mix or use bags?**

Bags are practical up to roughly 0.5 m³ (about 30 × 80 lb bags); above that, ready-mix delivered by truck is cheaper and gives a consistent mix. Ready-mix is ordered by the m³ or yd³ using the with-waste figure.

**Why do bag counts differ between brands?**

Yield per bag depends on the mix design and how much water is added; the figures here are QUIKRETE's for US bags and a conservative 2400 kg/m³ assumption for 25 kg bags. Use the yield printed on the bag when it differs.

## Related

- [Gravel Calculator](https://tttkmbb.com/construction/gravel.md) — Sub-base aggregate under the slab.
- [Brick Calculator](https://tttkmbb.com/construction/brick.md) — Bricks and mortar for walls on the slab.
- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Volume of round post holes or piers.


---

# Tile Calculator

> Counts the tiles needed for a floor or wall area from the tile dimensions plus the grout joint width, adds a cutting-waste allowance and converts to boxes when the tiles per box are known.

- Calculator id: `tile` · Category: Construction & Home (`construction`) · Tool name: `estimate_tiles_needed`
- Canonical page: https://tttkmbb.com/construction/tile · This document: https://tttkmbb.com/construction/tile.md · JSON definition: https://tttkmbb.com/construction/tile.json

## Purpose

Counts the tiles needed for a floor or wall area from the tile dimensions plus the grout joint width, adds a cutting-waste allowance and converts to boxes when the tiles per box are known.

**Use when:** You need to order ceramic, porcelain or stone tiles for a known area and tile size, including grout joints and waste.

**Do not use when:** You are laying planks or sheet goods sold by area (use flooring), or need the area itself from room dimensions (use rectangle first).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `area` | number | m² or ft² | required | Floor or wall area to cover, in m² (metric) or ft² (imperial). (> 0, max 100000) |
| `tile_length` | number | mm or in | required | Tile length in millimetres (metric) or inches (imperial). (> 0, max 5000) |
| `tile_width` | number | mm or in | required | Tile width in millimetres or inches. (> 0, max 5000) |
| `grout_gap_mm` | number | mm | optional, default 3 | Grout joint width in millimetres for both unit systems (3 mm ≈ 1/8 in; 1.6 mm = 1/16 in is the ANSI minimum). (min 0, max 30) |
| `waste_percent` | number | % | optional, default 10 | Extra material for cuts, breakage and offcuts, applied as a multiplier (1 + waste_percent/100). 10 % for straight layouts, 15 % for diagonal patterns or rooms with many cuts. (min 0, max 50) |
| `tiles_per_box` | integer |  | optional | Number of tiles in one box; optional, enables the box count. (min 1, max 1000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area_m2` | number | m² | Area to tile in square metres. |
| `area_ft2` | number | ft² | Area to tile in square feet. |
| `tile_footprint_cm2` | number | cm² | (tile_length + gap) × (tile_width + gap). |
| `tile_footprint_in2` | number | in² | Same footprint in square inches. |
| `tiles_needed_no_waste` | integer |  | ceil(area / tile_footprint). |
| `tiles_needed` | integer |  | ceil(area / tile_footprint × (1 + waste_percent/100)). |
| `boxes_needed` | integer |  | ceil(tiles_needed / tiles_per_box); only when tiles_per_box is given. |

## Formula

`footprint = (tile_length + grout_gap) × (tile_width + grout_gap); tiles_no_waste = ceil(area / footprint); tiles = ceil(area / footprint × (1 + waste_percent/100)); boxes = ceil(tiles / tiles_per_box).`

## Data Sources

- Custom Building Products – Technical Bulletin TB85: Grout joint width (ANSI A108.02 minimum 1/16 in) — https://www.custombuildingproducts.com/media/60712312/tb85-grout-joint-width.pdf (reference, retrieved 2026-09-23)
- Ceramic Tile Education Foundation – Tile industry standards for grout joints — https://www.ceramictilefoundation.org/blog/want-credit-card-grout-joints-check-tile-industry-standards (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/tile?area=…&tile_length=…&tile_width=…`
- `POST https://tttkmbb.com/api/v1/calculate/tile` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/tile · OpenAPI operationId `estimate_tiles_needed` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "tile", "inputs": {…}}`

## Example

- 20 m², 300 × 300 mm tiles, 3 mm joints, 10 % waste, 10 per box: inputs `{"unit_system":"metric","area":20,"tile_length":300,"tile_width":300,"grout_gap_mm":3,"waste_percent":10,"tiles_per_box":10}` → `{"area_m2":20,"tile_footprint_cm2":918.09,"tile_footprint_in2":142.3,"tiles_needed_no_waste":218,"tiles_needed":240,"boxes_needed":24}`
- 120 ft², 12 × 24 in tiles, 3 mm joints, 10 % waste, 8 per box: inputs `{"unit_system":"imperial","area":120,"tile_length":12,"tile_width":24,"grout_gap_mm":3,"waste_percent":10,"tiles_per_box":8}` → `{"area_m2":11.15,"tile_footprint_in2":292.27,"tiles_needed_no_waste":60,"tiles_needed":66,"boxes_needed":9}`

```
GET https://tttkmbb.com/api/v1/calculate/tile?unit_system=metric&area=20&tile_length=300&tile_width=300&grout_gap_mm=3&waste_percent=10&tiles_per_box=10
```

## Limitations

You are laying planks or sheet goods sold by area (use flooring), or need the area itself from room dimensions (use rectangle first). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why add the grout joint to the tile size?**

Each tile occupies its own face plus one joint along each edge, so the effective footprint is (length + gap) × (width + gap); ignoring the joint over-orders by a few percent on small tiles.

**How wide should the grout joint be?**

ANSI A108.02 requires at least 1/16 in (1.6 mm); 1/8 in (3 mm) is typical for rectified tiles and 3/16 in (5 mm) for calibrated (non-rectified) tiles.

## Related

- [Flooring Calculator](https://tttkmbb.com/construction/flooring.md) — Sheet or plank flooring sold by area.
- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Get the area from length and width.


---

# Roof Pitch Calculator

> Converts a roof slope given as rise and run, or as an angle, into the pitch expressed in rise per 12 units of run, the angle in degrees, the slope in percent and the rafter length multiplier (rafter length per unit of horizontal run).

- Calculator id: `roof-pitch` · Category: Construction & Home (`construction`) · Tool name: `calculate_roof_pitch`
- Canonical page: https://tttkmbb.com/construction/roof-pitch · This document: https://tttkmbb.com/construction/roof-pitch.md · JSON definition: https://tttkmbb.com/construction/roof-pitch.json

## Purpose

Converts a roof slope given as rise and run, or as an angle, into the pitch expressed in rise per 12 units of run, the angle in degrees, the slope in percent and the rafter length multiplier (rafter length per unit of horizontal run).

**Use when:** You need to convert between roof pitch notations (x:12, degrees, percent) or estimate rafter length from the horizontal run.

**Do not use when:** You need a general right-triangle solution with all sides (use right-triangle) or a plain angle unit conversion (use angle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `rise` | number |  | optional | Vertical rise over the given run (any length unit, same as run). Give rise + run, or angle_degrees. (min 0, max 1000000) |
| `run` | number |  | optional, default 12 | Horizontal run over which the rise is measured (same unit as rise). With the default 12, rise is directly the pitch numerator (e.g. 4 → 4:12). (> 0, max 1000000) |
| `angle_degrees` | number | ° | optional | Roof angle from horizontal in degrees; used only when rise is not given. (min 0) |
| `horizontal_run_length` | number |  | optional | Optional horizontal distance the rafter spans (e.g. half the building width for a gable roof), any unit; returns the rafter length in the same unit (excluding overhang). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pitch_per_12` | number |  | Rise for 12 units of run (US pitch notation). |
| `pitch` | string |  | Pitch written as rise:12. |
| `angle_degrees` | number | ° | atan(rise / run) in degrees. |
| `slope_percent` | number | % | 100 × rise / run. |
| `rafter_multiplier` | number |  | √(rise² + run²) / run = 1 / cos(angle); multiply the horizontal run by this to get the rafter length. |
| `rafter_length` | number |  | horizontal_run_length × rafter_multiplier (same unit as horizontal_run_length); only when given. |

## Formula

`pitch_per_12 = 12 × rise / run; angle = atan(rise / run); slope_percent = 100 × rise / run; rafter_multiplier = √(1 + (rise/run)²); rafter_length = horizontal_run_length × rafter_multiplier. From an angle: rise/run = tan(angle).`

## Data Sources

- Wikipedia – Roof pitch — https://en.wikipedia.org/wiki/Roof_pitch (reference, retrieved 2026-09-23)
- ICC – 2021 International Residential Code, Chapter 3 Building Planning (R311.7 Stairways) — https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/roof-pitch?`
- `POST https://tttkmbb.com/api/v1/calculate/roof-pitch` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/roof-pitch · OpenAPI operationId `calculate_roof_pitch` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "roof-pitch", "inputs": {…}}`

## Example

- 3:12 pitch, 5 m horizontal run: inputs `{"rise":3,"run":12,"horizontal_run_length":5}` → `{"pitch_per_12":3,"pitch":"3:12","angle_degrees":14.04,"slope_percent":25,"rafter_multiplier":1.0308,"rafter_length":5.154}`
- 30° roof: inputs `{"angle_degrees":30}` → `{"pitch_per_12":6.93,"pitch":"6.93:12","angle_degrees":30,"slope_percent":57.74,"rafter_multiplier":1.1547}`

```
GET https://tttkmbb.com/api/v1/calculate/roof-pitch?rise=3&run=12&horizontal_run_length=5
```

## Limitations

You need a general right-triangle solution with all sides (use right-triangle) or a plain angle unit conversion (use angle). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is a 4:12 pitch in degrees?**

atan(4/12) = 18.43°, a slope of 33.3 %. Pitches below 2:12 (9.5°) are considered low-slope and usually need membrane rather than shingle roofing.

**Is pitch the same as slope?**

In US practice 'pitch' means rise per 12 in of run (e.g. 6:12); historically pitch was rise over the full span (6:12 = 1/4 pitch). Slope in percent is 100 × rise/run.

**Does rafter_length include the overhang or the ridge board?**

No. It is the sloped length over the horizontal run you enter; add the eave overhang and subtract half the ridge-board thickness when cutting rafters.

## Related

- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Solve the full rafter triangle from any two values.
- [Stair Calculator](https://tttkmbb.com/construction/stairs.md) — Another rise-over-run design calculation.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert between degrees, radians and gradians.


---

# Stair Calculator

> Divides a total floor-to-floor rise into equal risers close to a target riser height, derives the tread count, total run, stringer length and stair angle, and checks the result against the IRC residential limits (riser ≤ 7¾ in / 196 mm, tread ≥ 10 in / 254 mm) and the 2R + T comfort rule.

- Calculator id: `stairs` · Category: Construction & Home (`construction`) · Tool name: `calculate_stair_dimensions`
- Canonical page: https://tttkmbb.com/construction/stairs · This document: https://tttkmbb.com/construction/stairs.md · JSON definition: https://tttkmbb.com/construction/stairs.json

## Purpose

Divides a total floor-to-floor rise into equal risers close to a target riser height, derives the tread count, total run, stringer length and stair angle, and checks the result against the IRC residential limits (riser ≤ 7¾ in / 196 mm, tread ≥ 10 in / 254 mm) and the 2R + T comfort rule.

**Use when:** You are laying out a straight flight of interior or deck stairs and need the number of risers, the exact riser height, the total run and the stringer length.

**Do not use when:** The stair has winders, landings or curves (design each straight flight separately), or you need a roof/rafter slope (use roof-pitch).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `total_rise` | number | cm or in | required | Finished-floor to finished-floor height in centimetres (metric) or inches (imperial). (> 0, max 2000) |
| `ideal_riser_height` | number | cm or in | optional | Preferred riser height; the riser count is total_rise / this value rounded to the nearest whole number. Default 18 cm (metric) or 7 in (imperial). (> 0, max 40) |
| `tread_depth` | number | cm or in | optional | Horizontal depth of each tread, nosing to nosing. Default from the comfort rule: 63 cm − 2 × riser (metric) or 25 in − 2 × riser (imperial). (> 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `risers` | integer |  | round(total_rise / ideal_riser_height), at least 1. |
| `treads` | integer |  | risers − 1 (the upper floor acts as the last tread). |
| `riser_height_cm` | number | cm | total_rise / risers. |
| `riser_height_in` | number | in | Riser height in inches. |
| `tread_depth_cm` | number | cm | Tread depth used. |
| `tread_depth_in` | number | in | Tread depth in inches. |
| `total_run_cm` | number | cm | treads × tread_depth (horizontal length of the flight). |
| `total_run_in` | number | in | Total run in inches. |
| `stringer_length_cm` | number | cm | √(total_rise² + total_run²), the sloped length of the flight. |
| `stringer_length_in` | number | in | Stringer length in inches. |
| `stair_angle_degrees` | number | ° | atan(total_rise / total_run). |
| `comfort_check` | string |  | Whether 2 × riser + tread falls in the 63–65 cm (24–25 in) comfort range. |
| `code_check` | string |  | Comparison with IRC R311.7.5: riser ≤ 7¾ in (196 mm), tread ≥ 10 in (254 mm). |

## Formula

`risers = round(total_rise / ideal_riser_height); riser = total_rise / risers; treads = risers − 1; total_run = treads × tread_depth; stringer = √(total_rise² + total_run²); angle = atan(total_rise / total_run); comfort: 63 cm ≤ 2·riser + tread ≤ 65 cm (24–25 in).`

The 2R + T rule (Blondel, 1675) approximates a natural stride; the IRC limits are the US one- and two-family dwelling maximums (R311.7.5.1–.2), with a 3/8 in (9.5 mm) allowed variation between risers. UK Part K allows risers 150–220 mm and goings ≥ 220 mm for private stairs.

## Data Sources

- ICC – 2021 International Residential Code, Chapter 3 Building Planning (R311.7 Stairways) — https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning (standard, retrieved 2026-09-23)
- Wikipedia – Stairs (dimensions and the 2R + T rule) — https://en.wikipedia.org/wiki/Stairs (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/stairs?total_rise=…`
- `POST https://tttkmbb.com/api/v1/calculate/stairs` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/stairs · OpenAPI operationId `calculate_stair_dimensions` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "stairs", "inputs": {…}}`

## Example

- 106 in rise, 7 in target riser, 10.5 in treads: inputs `{"unit_system":"imperial","total_rise":106,"ideal_riser_height":7,"tread_depth":10.5}` → `{"risers":15,"treads":14,"riser_height_in":7.067,"riser_height_cm":17.95,"total_run_in":147,"stringer_length_in":181.23,"stair_angle_degrees":35.8,"comfort_check":"2R + T = 24.63 in: within the 24–25 in comfort range","code_check":"Meets IRC R311.7.5 (riser 7.07 in ≤ 7.75 in, tread 10.5 in ≥ 10 in)"}`
- 270 cm rise, 18 cm target riser, 27 cm treads: inputs `{"unit_system":"metric","total_rise":270,"ideal_riser_height":18,"tread_depth":27}` → `{"risers":15,"treads":14,"riser_height_cm":18,"riser_height_in":7.087,"total_run_cm":378,"stringer_length_cm":464.5,"stair_angle_degrees":35.54,"comfort_check":"2R + T = 63 cm: within the 63–65 cm comfort range"}`

```
GET https://tttkmbb.com/api/v1/calculate/stairs?unit_system=imperial&total_rise=106&ideal_riser_height=7&tread_depth=10.5
```

## Limitations

The stair has winders, landings or curves (design each straight flight separately), or you need a roof/rafter slope (use roof-pitch). The 2R + T rule (Blondel, 1675) approximates a natural stride; the IRC limits are the US one- and two-family dwelling maximums (R311.7.5.1–.2), with a 3/8 in (9.5 mm) allowed variation between risers. UK Part K allows risers 150–220 mm and goings ≥ 220 mm for private stairs. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the number of treads one less than the risers?**

The top riser lands on the upper floor, which serves as the final walking surface, so a flight with n risers has n − 1 treads (unless the top tread is a separate landing board).

**Which rise do I measure?**

From finished floor to finished floor, including floor coverings on both levels; a 20 mm difference in finish thickness would otherwise create an uneven first or last step.

**Is the IRC check valid outside the USA?**

The limits are from the US residential code. Many other codes are similar but not identical (e.g. UK Part K max riser 220 mm, min going 220 mm), so verify against the local code.

## Related

- [Roof Pitch Calculator](https://tttkmbb.com/construction/roof-pitch.md) — Rise-over-run conversions for roofs.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Solve the stringer triangle directly.
- [Decking Calculator](https://tttkmbb.com/construction/decking.md) — Deck material for the platform the stairs serve.


---

# Wallpaper Calculator

> Estimates wallpaper rolls by the strip method: the strip length is the wall height plus 10 cm trim, rounded up to a whole pattern repeat; whole strips per roll are counted, door and window areas are deducted and the strips are converted to rolls.

- Calculator id: `wallpaper` · Category: Construction & Home (`construction`) · Tool name: `estimate_wallpaper_rolls`
- Canonical page: https://tttkmbb.com/construction/wallpaper · This document: https://tttkmbb.com/construction/wallpaper.md · JSON definition: https://tttkmbb.com/construction/wallpaper.json

## Purpose

Estimates wallpaper rolls by the strip method: the strip length is the wall height plus 10 cm trim, rounded up to a whole pattern repeat; whole strips per roll are counted, door and window areas are deducted and the strips are converted to rolls.

**Use when:** You need to know how many rolls of wallpaper to buy for a room from its perimeter (or wall area), height and the roll dimensions, with or without a pattern repeat.

**Do not use when:** You are painting (use paint) or boarding (use drywall) the walls, or the paper is a mural sold by the panel.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `room_perimeter` | number | m or ft | optional | Total length of the walls to paper (m or ft), e.g. 2 × (length + width). Alternatively give wall_area. (> 0, max 10000) |
| `wall_height` | number | m or ft | required | Height to paper (m or ft); 10 cm (4 in) is added per strip for trimming. (> 0, max 100) |
| `wall_area` | number | m² or ft² | optional | Gross wall area before openings (m² or ft²); used instead of room_perimeter × wall_height when given. (> 0) |
| `doors` | integer |  | optional, default 1 | Number of doors; 1.9 m² (20.5 ft²) is deducted per door. (min 0, max 100) |
| `windows` | integer |  | optional, default 1 | Number of windows; 1.4 m² (15.1 ft²) is deducted per window. (min 0, max 100) |
| `roll_width` | number | m or ft | optional | Roll width. Default 0.53 m (metric, European roll) or 2.25 ft = 27 in (imperial, American roll). (> 0, max 10) |
| `roll_length` | number | m or ft | optional | Roll length. Default 10.05 m (metric) or 27 ft (imperial). (> 0, max 200) |
| `pattern_repeat` | number | cm or in | optional, default 0 | Vertical pattern repeat printed on the label (cm or in); 0 for plain or free-match paper. Each strip is rounded up to a whole number of repeats. (min 0, max 500) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `gross_wall_area_m2` | number | m² | perimeter × height (or wall_area). |
| `net_wall_area_m2` | number | m² | Gross area minus door and window deductions. |
| `strip_length_m` | number | m | Height + 0.10 m trim, rounded up to whole pattern repeats. |
| `strip_length_ft` | number | ft | Strip length in feet. |
| `strips_per_roll` | integer |  | floor(roll_length / strip_length). |
| `strips_needed` | integer |  | ceil(net_wall_area / (roll_width × wall_height)). |
| `rolls_needed` | integer |  | ceil(strips_needed / strips_per_roll). |
| `roll_size_used` | string |  | Roll width × length assumed. |

## Formula

`strip = wall_height + 0.10 m, rounded up to a multiple of pattern_repeat; strips_per_roll = floor(roll_length / strip); net_area = perimeter × height − 1.9 m² × doors − 1.4 m² × windows; strips_needed = ceil(net_area / (roll_width × wall_height)); rolls = ceil(strips_needed / strips_per_roll).`

Rounding each strip up to a whole repeat is the standard allowance for pattern matching; drop (offset) matches can waste up to half a repeat more per strip. Buy all rolls from the same batch number.

## Data Sources

- Wikipedia – Wallpaper (roll sizes, pattern repeat) — https://en.wikipedia.org/wiki/Wallpaper (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/wallpaper?wall_height=…`
- `POST https://tttkmbb.com/api/v1/calculate/wallpaper` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/wallpaper · OpenAPI operationId `estimate_wallpaper_rolls` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "wallpaper", "inputs": {…}}`

## Example

- 16 m perimeter, 2.4 m high, 1 door, 1 window, plain 0.53 × 10.05 m rolls: inputs `{"unit_system":"metric","room_perimeter":16,"wall_height":2.4,"doors":1,"windows":1}` → `{"gross_wall_area_m2":38.4,"net_wall_area_m2":35.1,"strip_length_m":2.5,"strips_per_roll":4,"strips_needed":28,"rolls_needed":7,"roll_size_used":"0.53 m × 10.05 m"}`
- 48 ft perimeter, 8 ft high, 2 doors, 2 windows, 24 in repeat, 27 in × 27 ft rolls: inputs `{"unit_system":"imperial","room_perimeter":48,"wall_height":8,"doors":2,"windows":2,"pattern_repeat":24}` → `{"gross_wall_area_m2":35.67,"net_wall_area_m2":29.07,"strip_length_ft":10,"strips_per_roll":2,"strips_needed":18,"rolls_needed":9}`

```
GET https://tttkmbb.com/api/v1/calculate/wallpaper?unit_system=metric&room_perimeter=16&wall_height=2.4&doors=1&windows=1
```

## Limitations

You are painting (use paint) or boarding (use drywall) the walls, or the paper is a mural sold by the panel. Rounding each strip up to a whole repeat is the standard allowance for pattern matching; drop (offset) matches can waste up to half a repeat more per strip. Buy all rolls from the same batch number. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I buy a spare roll?**

Usually yes: one extra roll from the same batch covers mistakes and future repairs, because colours differ slightly between batches.

**Why does a pattern repeat need more rolls?**

Each strip must start at the same point of the pattern, so it is cut to a whole number of repeats; a 64 cm repeat on a 2.5 m strip means cutting 2.56 m, which reduces the whole strips per 10.05 m roll from 4 to 3.

## Related

- [Paint Calculator](https://tttkmbb.com/construction/paint.md) — Paint instead of paper for the same walls.
- [Drywall Calculator](https://tttkmbb.com/construction/drywall.md) — Board the walls before decorating.


---

# Gravel Calculator

> Computes the volume of loose aggregate needed to cover an area to a given depth and converts it to weight with a typical bulk density for gravel, crushed stone, sand, topsoil or mulch (or a custom density).

- Calculator id: `gravel` · Category: Construction & Home (`construction`) · Tool name: `estimate_gravel_volume`
- Canonical page: https://tttkmbb.com/construction/gravel · This document: https://tttkmbb.com/construction/gravel.md · JSON definition: https://tttkmbb.com/construction/gravel.json

## Purpose

Computes the volume of loose aggregate needed to cover an area to a given depth and converts it to weight with a typical bulk density for gravel, crushed stone, sand, topsoil or mulch (or a custom density).

**Use when:** You need to order gravel, crushed stone, sand, topsoil or bark mulch by volume (m³, yd³) or by weight (tonnes, US tons) for a driveway, path, bed or sub-base.

**Do not use when:** The material is concrete (use concrete-slab) or you need the density of a specific product: use the supplier's figure via material = custom and density_t_per_m3.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `length` | number | m or ft | optional | Length of the area (m or ft). Give length and width, or area. (> 0, max 10000) |
| `width` | number | m or ft | optional | Width of the area (m or ft). (> 0, max 10000) |
| `area` | number | m² or ft² | optional | Area to cover (m² or ft²); used instead of length × width when given. (> 0) |
| `depth` | number | cm or in | required | Depth of the layer in centimetres (metric) or inches (imperial). Typical: 5 cm / 2 in decorative gravel, 10–15 cm / 4–6 in driveway base, 7.5 cm / 3 in mulch. (> 0, max 500) |
| `material` | enum: gravel \| crushed_stone \| sand \| topsoil \| mulch \| custom |  | optional, default "gravel" | Selects a typical loose bulk density in tonnes per cubic metre. |
| `density_t_per_m3` | number | t/m³ | optional | Bulk density in tonnes per m³ (= kg/L); required for material = custom and overrides the preset otherwise. (> 0, max 10) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area_m2` | number | m² | Area covered. |
| `volume_m3` | number | m³ | area × depth. |
| `volume_cubic_yards` | number | yd³ | Same volume in cubic yards. |
| `volume_cubic_feet` | number | ft³ | Same volume in cubic feet. |
| `density_used_t_per_m3` | number | t/m³ | Bulk density applied. |
| `weight_tonnes` | number | t | volume_m3 × density (metric tonnes). |
| `weight_kg` | number | kg | Weight in kilograms. |
| `weight_us_tons` | number | US short tons | Weight in US short tons (1 t = 1.10231 short tons). |

## Formula

`area = length × width (or area); volume_m³ = area_m² × depth_m; yd³ = m³ / 0.764555; tonnes = m³ × density_t_per_m³; short tons = tonnes × 1.10231. Densities: gravel 1.6, crushed stone 1.6, sand 1.5, topsoil 1.2, mulch 0.4 t/m³.`

Loose bulk densities vary with moisture and grading (dry gravel ≈ 1.68 t/m³, dry sand ≈ 1.56 t/m³, loose earth ≈ 1.22 t/m³ per Engineering ToolBox); compacted sub-base settles by 10–20 %, so order extra for compacted layers.

## Data Sources

- Engineering ToolBox – Densities of dirt, mud, gravel and sand — https://www.engineeringtoolbox.com/dirt-mud-densities-d_1727.html (reference, retrieved 2026-09-23)
- Wikipedia – Bulk density — https://en.wikipedia.org/wiki/Bulk_density (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/gravel?depth=…`
- `POST https://tttkmbb.com/api/v1/calculate/gravel` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/gravel · OpenAPI operationId `estimate_gravel_volume` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "gravel", "inputs": {…}}`

## Example

- 10 m × 5 m of gravel, 5 cm deep: inputs `{"unit_system":"metric","length":10,"width":5,"depth":5,"material":"gravel"}` → `{"area_m2":50,"volume_m3":2.5,"volume_cubic_yards":3.27,"volume_cubic_feet":88.29,"density_used_t_per_m3":1.6,"weight_tonnes":4,"weight_kg":4000,"weight_us_tons":4.409}`
- 20 ft × 10 ft of mulch, 3 in deep: inputs `{"unit_system":"imperial","length":20,"width":10,"depth":3,"material":"mulch"}` → `{"area_m2":18.58,"volume_cubic_feet":50,"volume_cubic_yards":1.852,"volume_m3":1.416,"weight_tonnes":0.566,"weight_us_tons":0.624}`

```
GET https://tttkmbb.com/api/v1/calculate/gravel?unit_system=metric&length=10&width=5&depth=5&material=gravel
```

## Limitations

The material is concrete (use concrete-slab) or you need the density of a specific product: use the supplier's figure via material = custom and density_t_per_m3. Loose bulk densities vary with moisture and grading (dry gravel ≈ 1.68 t/m³, dry sand ≈ 1.56 t/m³, loose earth ≈ 1.22 t/m³ per Engineering ToolBox); compacted sub-base settles by 10–20 %, so order extra for compacted layers. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do suppliers sell by weight or volume?**

Bulk aggregates are usually sold by the tonne or by the cubic yard/metre; a bulk bag holds about 0.5 m³ (≈ 0.8 t of gravel). Use whichever figure matches the supplier's price list.

**How much extra should I order?**

Add 5–10 % for uneven ground and spillage, and 10–20 % more for layers that will be compacted (road base, sub-base under paving).

## Related

- [Concrete Slab Calculator](https://tttkmbb.com/construction/concrete-slab.md) — Concrete poured on the sub-base.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert between m³, yd³ and litres.
- [Density Calculator](https://tttkmbb.com/physics/density-mass-volume.md) — Mass from volume and density for other materials.


---

# Drywall Calculator

> Estimates the number of gypsum board sheets for walls (and optionally the ceiling) of a room with a waste allowance, plus screws at about one per square foot and joint compound at the USG rate of 10 gallons per 1,000 ft² of board.

- Calculator id: `drywall` · Category: Construction & Home (`construction`) · Tool name: `estimate_drywall_sheets`
- Canonical page: https://tttkmbb.com/construction/drywall · This document: https://tttkmbb.com/construction/drywall.md · JSON definition: https://tttkmbb.com/construction/drywall.json

## Purpose

Estimates the number of gypsum board sheets for walls (and optionally the ceiling) of a room with a waste allowance, plus screws at about one per square foot and joint compound at the USG rate of 10 gallons per 1,000 ft² of board.

**Use when:** You need to order plasterboard/drywall sheets, screws and joint compound for a room or a known wall area.

**Do not use when:** You need paint or wallpaper quantities for the finished wall (use paint or wallpaper), or metal-stud framing take-offs.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `room_length` | number | m or ft | optional | Room length (m or ft); used with room_width and wall_height when wall_area is not given, and for the ceiling. (> 0, max 1000) |
| `room_width` | number | m or ft | optional | Room width (m or ft). (> 0, max 1000) |
| `wall_height` | number | m or ft | optional | Wall height (m or ft). (> 0, max 100) |
| `wall_area` | number | m² or ft² | optional | Total wall area to board (m² or ft²); replaces 2 × (length + width) × height when given. (> 0) |
| `include_ceiling` | boolean |  | optional, default false | Add the ceiling area (room_length × room_width). |
| `openings_area` | number | m² or ft² | optional, default 0 | Area of large openings (doors, windows) to deduct; small openings are usually not deducted because the cut-outs are waste. (min 0) |
| `sheet_size` | enum: 4x8_ft \| 4x12_ft \| 1200x2400_mm \| 1200x3000_mm |  | optional | Board size. Default 1200 × 2400 mm (metric) or 4 × 8 ft (imperial). |
| `waste_percent` | number | % | optional, default 10 | Extra material for cuts, breakage and offcuts, applied as a multiplier (1 + waste_percent/100). 10 % is typical for rooms with few openings; use 15 % for complex rooms. (min 0, max 50) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area_m2` | number | m² | Walls (+ ceiling) − openings. |
| `area_ft2` | number | ft² | Area in square feet. |
| `sheets_needed` | integer |  | ceil(area × (1 + waste_percent/100) / sheet_area). |
| `sheet_size_used` | string |  | Board size assumed. |
| `screws` | integer |  | About 1 screw per ft² of board (≈ 32 per 4 × 8 sheet at 16 in stud spacing). |
| `joint_compound_liters` | number | L | Ready-mixed all-purpose compound: 37.8 L per 100 m² of board (USG). |
| `joint_compound_gallons` | number | US gal | 10 gal per 1,000 ft² of board (USG). |
| `compound_pails_4_5_gal` | integer |  | ceil(gallons / 4.5), the common US pail size (about 17 L). |

## Formula

`area = 2 × (room_length + room_width) × wall_height (or wall_area) + room_length × room_width (if include_ceiling) − openings_area; sheets = ceil(area × (1 + waste/100) / sheet_area); screws ≈ area_ft² × 1; compound_gal = area_ft² / 100; pails = ceil(compound_gal / 4.5).`

Fastener spacing follows IRC R702.3.5 (screws at 16 in on walls and 12 in on ceilings with 16 in framing), which works out to roughly one screw per square foot. Compound coverage is USG's figure for taping and three-coat finishing of the joints.

## Data Sources

- USG – Sheetrock Brand All Purpose Joint Compound submittal sheet (≈ 10 gal per 1,000 sq ft of panels) — https://www.usg.com/content/dam/USG_Marketing_Communications/united_states/product_promotional_materials/finished_assets/sheetrock-all-purpose-joint-compound-submittal-J1969.pdf (reference, retrieved 2026-09-23)
- ICC – 2021 International Residential Code, Chapter 7 Wall Covering (R702.3.5 gypsum board fastening) — https://codes.iccsafe.org/content/IRC2021P2/chapter-7-wall-covering (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/drywall?`
- `POST https://tttkmbb.com/api/v1/calculate/drywall` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/drywall · OpenAPI operationId `estimate_drywall_sheets` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "drywall", "inputs": {…}}`

## Example

- 15 ft × 12 ft × 8 ft room with ceiling, 4 × 8 sheets, 10 % waste: inputs `{"unit_system":"imperial","room_length":15,"room_width":12,"wall_height":8,"include_ceiling":true,"sheet_size":"4x8_ft","waste_percent":10}` → `{"area_ft2":612,"area_m2":56.86,"sheets_needed":22,"sheet_size_used":"4 × 8 ft","screws":612,"joint_compound_gallons":6.12,"joint_compound_liters":23.2,"compound_pails_4_5_gal":2}`
- 40 m² of wall, 1200 × 2400 mm boards, 10 % waste: inputs `{"unit_system":"metric","wall_area":40,"waste_percent":10}` → `{"area_m2":40,"area_ft2":430.56,"sheets_needed":16,"sheet_size_used":"1200 × 2400 mm","screws":431,"joint_compound_liters":16.3,"joint_compound_gallons":4.31,"compound_pails_4_5_gal":1}`

```
GET https://tttkmbb.com/api/v1/calculate/drywall?unit_system=imperial&room_length=15&room_width=12&wall_height=8&include_ceiling=true&sheet_size=4x8_ft&waste_percent=10
```

## Limitations

You need paint or wallpaper quantities for the finished wall (use paint or wallpaper), or metal-stud framing take-offs. Fastener spacing follows IRC R702.3.5 (screws at 16 in on walls and 12 in on ceilings with 16 in framing), which works out to roughly one screw per square foot. Compound coverage is USG's figure for taping and three-coat finishing of the joints. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Should I subtract doors and windows?**

Usually not for standard openings: the cut-out pieces are rarely reusable, so most estimators ignore openings under about 2 m² and only deduct large ones via openings_area.

**Which sheet size should I choose?**

Use the longest sheets you can handle: 4 × 12 ft or 1200 × 3000 mm sheets reduce the number of joints to tape; 4 × 8 ft and 1200 × 2400 mm are the common DIY sizes.

**Is tape included?**

No. Joint tape is roughly 37 m per 100 m² (370 ft per 1,000 ft²) of board; corner bead is the sum of the outside-corner lengths.

## Related

- [Paint Calculator](https://tttkmbb.com/construction/paint.md) — Paint for the finished boards.
- [Wallpaper Calculator](https://tttkmbb.com/construction/wallpaper.md) — Paper for the finished boards.


---

# Fence Calculator

> Estimates the posts, rails and pickets for a straight run of wooden fence from the total length, the maximum post spacing, the number and width of gates, the rails per section and the picket width plus gap.

- Calculator id: `fence` · Category: Construction & Home (`construction`) · Tool name: `estimate_fence_materials`
- Canonical page: https://tttkmbb.com/construction/fence · This document: https://tttkmbb.com/construction/fence.md · JSON definition: https://tttkmbb.com/construction/fence.json

## Purpose

Estimates the posts, rails and pickets for a straight run of wooden fence from the total length, the maximum post spacing, the number and width of gates, the rails per section and the picket width plus gap.

**Use when:** You need a material list (posts, rails, pickets) for a picket, privacy or post-and-rail fence of a known length.

**Do not use when:** You need concrete for the post holes (use cylinder for the hole volume and concrete-slab for bags), or the fence is chain-link or panel fencing sold per panel (divide the length by the panel width instead).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `total_length` | number | m or ft | required | Overall length of the fence line including gate openings (m or ft). (> 0, max 100000) |
| `post_spacing` | number | m or ft | optional | Maximum centre-to-centre distance between posts; sections are spaced evenly at or below this. Default 2.4 m (metric) or 8 ft (imperial). (> 0, max 20) |
| `gates` | integer |  | optional, default 0 | Number of gate openings in the run; each takes a bay between two posts. (min 0, max 50) |
| `gate_width` | number | m or ft | optional | Width of each gate opening. Default 1 m (metric) or 3 ft (imperial). (> 0, max 10) |
| `rails_per_section` | integer |  | optional, default 2 | Horizontal rails between each pair of posts: 2 for fences up to about 1.2 m / 4 ft, 3 for 1.8 m / 6 ft privacy fences. (min 1, max 5) |
| `picket_width` | number | mm or in | optional | Width of one picket/board in millimetres (metric) or inches (imperial). Optional; enables the picket count. (> 0, max 1000) |
| `picket_gap` | number | mm or in | optional, default 0 | Gap between pickets (0 for a solid privacy fence), in mm or in. (min 0, max 1000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `fence_length_m` | number | m | total_length − gates × gate_width. |
| `fence_length_ft` | number | ft | Same length in feet. |
| `sections` | integer |  | ceil(fence_length / post_spacing). |
| `posts` | integer |  | sections + gates + 1 (straight run; gate posts included). |
| `actual_post_spacing_m` | number | m | fence_length / sections. |
| `actual_post_spacing_ft` | number | ft | Actual spacing in feet. |
| `rails` | integer |  | sections × rails_per_section. |
| `pickets` | integer |  | ceil(fence_length / (picket_width + picket_gap)); only when picket_width is given. |

## Formula

`fence_length = total_length − gates × gate_width; sections = ceil(fence_length / post_spacing); posts = sections + gates + 1; actual_spacing = fence_length / sections; rails = sections × rails_per_section; pickets = ceil(fence_length / (picket_width + picket_gap)).`

Assumes one straight run with posts at both ends and gates as extra bays; for a closed loop (fence all the way round) subtract 1 post, and add one post per corner or change of direction. Gate hardware, post concrete and cap rails are not included.

## Data Sources

- Lowe's – How to build a wood fence (posts 6–8 ft on centre, 3 rails for 6 ft pickets) — https://www.lowes.com/n/how-to/install-a-wood-fence (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/fence?total_length=…`
- `POST https://tttkmbb.com/api/v1/calculate/fence` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/fence · OpenAPI operationId `estimate_fence_materials` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "fence", "inputs": {…}}`

## Example

- 100 ft, 8 ft spacing, one 4 ft gate, 2 rails, 5.5 in pickets with 0.5 in gap: inputs `{"unit_system":"imperial","total_length":100,"post_spacing":8,"gates":1,"gate_width":4,"rails_per_section":2,"picket_width":5.5,"picket_gap":0.5}` → `{"fence_length_ft":96,"fence_length_m":29.26,"sections":12,"posts":14,"actual_post_spacing_ft":8,"rails":24,"pickets":192}`
- 30 m, 2.4 m spacing, no gate, 3 rails, 90 mm pickets with 10 mm gap: inputs `{"unit_system":"metric","total_length":30,"post_spacing":2.4,"gates":0,"rails_per_section":3,"picket_width":90,"picket_gap":10}` → `{"fence_length_m":30,"sections":13,"posts":14,"actual_post_spacing_m":2.308,"actual_post_spacing_ft":7.571,"rails":39,"pickets":300}`

```
GET https://tttkmbb.com/api/v1/calculate/fence?unit_system=imperial&total_length=100&post_spacing=8&gates=1&gate_width=4&rails_per_section=2&picket_width=5.5&picket_gap=0.5
```

## Limitations

You need concrete for the post holes (use cylinder for the hole volume and concrete-slab for bags), or the fence is chain-link or panel fencing sold per panel (divide the length by the panel width instead). Assumes one straight run with posts at both ends and gates as extra bays; for a closed loop (fence all the way round) subtract 1 post, and add one post per corner or change of direction. Gate hardware, post concrete and cap rails are not included. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How deep should posts go?**

About one third of the post length, below the local frost line: a 1.8 m (6 ft) fence typically uses 2.4 m (8 ft) posts set 60 cm (2 ft) deep in concrete.

**Why are the actual spacings smaller than the maximum?**

The run is divided into equal sections so that no bay exceeds post_spacing; e.g. 30 m at a 2.4 m maximum needs 13 sections of 2.31 m.

## Related

- [Decking Calculator](https://tttkmbb.com/construction/decking.md) — Boards and joists for a deck alongside the fence.
- [Concrete Slab Calculator](https://tttkmbb.com/construction/concrete-slab.md) — Bags of concrete for post footings.
- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Volume of a round post hole.


---

# Decking Calculator

> Estimates the number of deck boards (rows of boards across the width, board lengths along the length, plus waste), the joists at a given spacing and the screws at two per board per joist for a rectangular deck.

- Calculator id: `decking` · Category: Construction & Home (`construction`) · Tool name: `estimate_decking_materials`
- Canonical page: https://tttkmbb.com/construction/decking · This document: https://tttkmbb.com/construction/decking.md · JSON definition: https://tttkmbb.com/construction/decking.json

## Purpose

Estimates the number of deck boards (rows of boards across the width, board lengths along the length, plus waste), the joists at a given spacing and the screws at two per board per joist for a rectangular deck.

**Use when:** You need a material list for a rectangular timber or composite deck: boards, joists and fasteners.

**Do not use when:** You need structural sizing of joists and beams (span tables depend on species, grade and load; see the AWC DCA 6 guide) or stairs to the deck (use stairs).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `deck_length` | number | m or ft | required | Deck dimension parallel to the boards (m or ft). Joists run across this direction. (> 0, max 1000) |
| `deck_width` | number | m or ft | required | Deck dimension across the boards (m or ft); equals the joist length. (> 0, max 1000) |
| `board_width` | number | mm or in | optional | Actual face width of one board. Default 140 mm (metric) or 5.5 in (imperial, a nominal 2 × 6 or 5/4 × 6). (> 0, max 1000) |
| `board_gap` | number | mm or in | optional | Drainage gap between boards. Default 5 mm (metric) or 3/16 in = 0.1875 in (imperial). (min 0, max 100) |
| `board_length` | number | m or ft | optional | Length of the boards you will buy. Default 3.6 m (metric) or 12 ft (imperial). (> 0, max 100) |
| `joist_spacing` | number | mm or in | optional | Centre-to-centre joist spacing. Default 400 mm (metric) or 16 in (imperial); composite boards laid diagonally usually need 300 mm / 12 in. (> 0, max 2000) |
| `waste_percent` | number | % | optional, default 5 | Extra material for cuts, breakage and offcuts, applied as a multiplier (1 + waste_percent/100). 5 % for straight decking; 10–15 % for diagonal or picture-frame patterns. (min 0, max 50) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area_m2` | number | m² | deck_length × deck_width. |
| `area_ft2` | number | ft² | Deck area in square feet. |
| `board_rows` | integer |  | ceil(deck_width / (board_width + board_gap)). |
| `linear_length_m` | number | m | board_rows × deck_length, before waste. |
| `linear_length_ft` | number | ft | Same in feet. |
| `boards_needed` | integer |  | ceil(linear_length × (1 + waste_percent/100) / board_length). |
| `joists` | integer |  | floor(deck_length / joist_spacing) + 1, each as long as deck_width (rim joists included in the count, beams/posts not). |
| `screws` | integer |  | board_rows × joists × 2. |

## Formula

`rows = ceil(deck_width / (board_width + board_gap)); linear = rows × deck_length; boards = ceil(linear × (1 + waste/100) / board_length); joists = floor(deck_length / joist_spacing) + 1; screws = rows × joists × 2.`

Assumes boards run parallel to deck_length and joists perpendicular to them at the given spacing, with a joist at each end. Ledger, beams, posts, blocking and stair framing are not included.

## Data Sources

- American Wood Council – DCA 6 Prescriptive Residential Wood Deck Construction Guide — https://awc.org/wp-content/uploads/2022/02/AWC-DCA62012-DeckGuide-1405.pdf (standard, retrieved 2026-09-23)
- Trex – How to space deck boards (3/16 in side gap) — https://www.trex.com/deck-ideas/how-to-space-deck-boards/ (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/decking?deck_length=…&deck_width=…`
- `POST https://tttkmbb.com/api/v1/calculate/decking` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/decking · OpenAPI operationId `estimate_decking_materials` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "decking", "inputs": {…}}`

## Example

- 4 m × 3 m deck, 140 mm boards, 5 mm gap, 3.6 m boards, 400 mm joists, 5 % waste: inputs `{"unit_system":"metric","deck_length":4,"deck_width":3,"board_width":140,"board_gap":5,"board_length":3.6,"joist_spacing":400,"waste_percent":5}` → `{"area_m2":12,"area_ft2":129.17,"board_rows":21,"linear_length_m":84,"boards_needed":25,"joists":11,"screws":462}`
- 16 ft × 12 ft deck, 5.5 in boards, 3/16 in gap, 16 ft boards, 16 in joists, 5 % waste: inputs `{"unit_system":"imperial","deck_length":16,"deck_width":12,"board_width":5.5,"board_gap":0.1875,"board_length":16,"joist_spacing":16,"waste_percent":5}` → `{"area_ft2":192,"area_m2":17.84,"board_rows":26,"linear_length_ft":416,"boards_needed":28,"joists":13,"screws":676}`

```
GET https://tttkmbb.com/api/v1/calculate/decking?unit_system=metric&deck_length=4&deck_width=3&board_width=140&board_gap=5&board_length=3.6&joist_spacing=400&waste_percent=5
```

## Limitations

You need structural sizing of joists and beams (span tables depend on species, grade and load; see the AWC DCA 6 guide) or stairs to the deck (use stairs). Assumes boards run parallel to deck_length and joists perpendicular to them at the given spacing, with a joist at each end. Ledger, beams, posts, blocking and stair framing are not included. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which way should the boards run?**

Boards are usually laid perpendicular to the joists and parallel to the longest deck side to minimise cuts; enter that side as deck_length and buy boards close to it or to a multiple of it.

**Why two screws per joist?**

Face-fixing with two screws (or one hidden clip) at every joist crossing is the standard pattern in manufacturer guides; hidden fastener systems use about one clip per board per joist instead.

## Related

- [Fence Calculator](https://tttkmbb.com/construction/fence.md) — Posts, rails and pickets for the fence around the deck.
- [Stair Calculator](https://tttkmbb.com/construction/stairs.md) — Steps from the deck to the ground.
- [Board Feet Calculator](https://tttkmbb.com/construction/board-feet.md) — Convert lumber dimensions to board feet for pricing.


---

# Board Feet Calculator

> Computes board feet (the US lumber volume unit: 1 board foot = 144 cubic inches = a 1 in × 12 in × 12 in board) from nominal thickness and width in inches and length in feet, for a given quantity, with the total cost at a price per board foot.

- Calculator id: `board-feet` · Category: Construction & Home (`construction`) · Tool name: `calculate_board_feet`
- Canonical page: https://tttkmbb.com/construction/board-feet · This document: https://tttkmbb.com/construction/board-feet.md · JSON definition: https://tttkmbb.com/construction/board-feet.json

## Purpose

Computes board feet (the US lumber volume unit: 1 board foot = 144 cubic inches = a 1 in × 12 in × 12 in board) from nominal thickness and width in inches and length in feet, for a given quantity, with the total cost at a price per board foot.

**Use when:** You are pricing or ordering hardwood or rough lumber sold by the board foot, or converting lumber dimensions into board feet, cubic feet or cubic metres.

**Do not use when:** Lumber is sold by the linear foot or piece (dimensional softwood such as 2 × 4 studs), or you need deck board counts (use decking).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `thickness_in` | number | in | required | Nominal thickness in inches (hardwood is often quoted in quarters: 4/4 = 1 in, 8/4 = 2 in). (> 0, max 48) |
| `width_in` | number | in | required | Nominal width in inches. (> 0, max 120) |
| `length_ft` | number | ft | required | Length in feet. (> 0, max 200) |
| `quantity` | integer |  | optional, default 1 | Number of identical pieces. (min 1, max 100000) |
| `price_per_board_foot` | number |  | optional | Optional unit price; enables the total cost. (min 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `board_feet_each` | number | bd ft | thickness_in × width_in × length_ft / 12. |
| `board_feet_total` | number | bd ft | board_feet_each × quantity. |
| `total_cost` | number |  | board_feet_total × price_per_board_foot; only when a price is given. |
| `volume_cubic_feet` | number | ft³ | board_feet_total / 12. |
| `volume_m3` | number | m³ | Total volume in cubic metres (1 bd ft = 0.002359737 m³). |

## Formula

`board_feet = thickness_in × width_in × length_ft / 12 (equivalently T × W × L_in / 144); total = board_feet × quantity; cost = total × price_per_board_foot; ft³ = board_feet / 12; m³ = ft³ × 0.028316847.`

Board footage uses nominal (rough-sawn) dimensions: a surfaced 4/4 board that measures 13/16 in is still counted as 1 in thick. Some yards round each board's width to the nearest inch before calculating.

## Data Sources

- American Hardwood Export Council – Grading sawn lumber: measurement (board foot = W × L × D / 12) — https://www.americanhardwood.org/en/american-hardwood/grading-sawn-lumber/measurement (reference, retrieved 2026-09-23)
- NHLA – Rules for the Measurement & Inspection of Hardwood & Cypress (2023) — https://nhla.com/wp-content/uploads/2023/07/2023-Rulesbook_English_web.pdf (standard, retrieved 2026-09-23)
- Wikipedia – Board foot — https://en.wikipedia.org/wiki/Board_foot (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/board-feet?thickness_in=…&width_in=…&length_ft=…`
- `POST https://tttkmbb.com/api/v1/calculate/board-feet` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/board-feet · OpenAPI operationId `calculate_board_feet` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "board-feet", "inputs": {…}}`

## Example

- Ten 1 × 6 boards, 8 ft long, at $5 per board foot: inputs `{"thickness_in":1,"width_in":6,"length_ft":8,"quantity":10,"price_per_board_foot":5}` → `{"board_feet_each":4,"board_feet_total":40,"total_cost":200,"volume_cubic_feet":3.3333,"volume_m3":0.09439}`
- One 2 × 4, 8 ft long: inputs `{"thickness_in":2,"width_in":4,"length_ft":8}` → `{"board_feet_each":5.333,"board_feet_total":5.333,"volume_cubic_feet":0.4444}`

```
GET https://tttkmbb.com/api/v1/calculate/board-feet?thickness_in=1&width_in=6&length_ft=8&quantity=10&price_per_board_foot=5
```

## Limitations

Lumber is sold by the linear foot or piece (dimensional softwood such as 2 × 4 studs), or you need deck board counts (use decking). Board footage uses nominal (rough-sawn) dimensions: a surfaced 4/4 board that measures 13/16 in is still counted as 1 in thick. Some yards round each board's width to the nearest inch before calculating. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do I use nominal or actual dimensions?**

Nominal. A 2 × 4 counts as 2 in × 4 in even though it measures 1.5 in × 3.5 in; hardwood thicknesses are quoted in quarters (5/4 = 1.25 in) of nominal thickness.

**How do I convert a length in inches?**

Divide by 12 to get feet, or use T × W × L(in) / 144, which gives the same board feet.

## Related

- [Decking Calculator](https://tttkmbb.com/construction/decking.md) — Board counts for a deck.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert cubic feet and cubic metres.
- [Rectangular Prism Calculator](https://tttkmbb.com/geometry/rectangular-prism.md) — General box volume.


---

# Brick Calculator

> Counts the bricks in a single-leaf (half-brick, stretcher-bond) wall from its length and height using a standard brick size with its mortar joint, adds waste, and estimates the mortar volume geometrically and the bags of mortar mix from a manufacturer rule of thumb.

- Calculator id: `brick` · Category: Construction & Home (`construction`) · Tool name: `estimate_bricks_needed`
- Canonical page: https://tttkmbb.com/construction/brick · This document: https://tttkmbb.com/construction/brick.md · JSON definition: https://tttkmbb.com/construction/brick.json

## Purpose

Counts the bricks in a single-leaf (half-brick, stretcher-bond) wall from its length and height using a standard brick size with its mortar joint, adds waste, and estimates the mortar volume geometrically and the bags of mortar mix from a manufacturer rule of thumb.

**Use when:** You need the number of bricks and the mortar for a garden wall, veneer or single-skin wall of known face area.

**Do not use when:** The wall is concrete block (use the block face 440 × 215 mm or 8 × 16 in as a custom brick) or two leaves thick: double the brick count, or use concrete-slab for footings.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `wall_length` | number | m or ft | required | Length of the wall face (m or ft). (> 0, max 10000) |
| `wall_height` | number | m or ft | required | Height of the wall face (m or ft). (> 0, max 100) |
| `brick_size` | enum: us_modular \| uk_standard \| au_standard \| de_nf \| metric_modular \| custom |  | optional | Brick format. Default uk_standard (metric) or us_modular (imperial). |
| `brick_length` | number | mm or in | optional | Brick length for brick_size = custom (mm or in). (> 0, max 1000) |
| `brick_height` | number | mm or in | optional | Brick height for custom (mm or in). (> 0, max 1000) |
| `brick_width` | number | mm or in | optional | Brick width (wall thickness) for custom, used for the mortar volume (mm or in). (> 0, max 1000) |
| `mortar_joint` | number | mm or in | optional | Joint thickness for custom bricks. Default 10 mm (metric) or 3/8 in (imperial). (min 0, max 50) |
| `waste_percent` | number | % | optional, default 5 | Extra material for cuts, breakage and offcuts, applied as a multiplier (1 + waste_percent/100). 5 % covers cut and broken bricks on plain walls; 10 % for walls with many openings or corners. (min 0, max 50) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `wall_area_m2` | number | m² | wall_length × wall_height. |
| `wall_area_ft2` | number | ft² | Wall face area in square feet. |
| `bricks_per_m2` | number |  | 1 / ((length + joint) × (height + joint)). |
| `bricks_per_ft2` | number |  | Bricks per square foot. |
| `bricks_needed_no_waste` | integer |  | ceil(area × bricks_per_m²). |
| `bricks_needed` | integer |  | ceil(area × bricks_per_m² × (1 + waste_percent/100)). |
| `mortar_volume_m3` | number | m³ | Geometric joint volume: area × brick_width − bricks × brick volume. |
| `mortar_volume_cubic_feet` | number | ft³ | Same volume in cubic feet. |
| `mortar_bags_80lb` | integer |  | ceil(bricks_no_waste / 37): QUIKRETE states one 80 lb (36 kg) bag lays up to 37 standard bricks, waste included. |
| `mortar_bags_25kg` | integer |  | ceil(bricks_no_waste / 25), the 80 lb figure pro-rated by bag mass. |

## Formula

`bricks_per_m² = 1 / ((L + j) × (H + j)); bricks = ceil(wall_area × bricks_per_m² × (1 + waste/100)); mortar_m³ = wall_area × W − wall_area × bricks_per_m² × L × W × H; bags_80lb = ceil(bricks / 37); bags_25kg = ceil(bricks / 25). US modular uses the nominal 8 × 2⅔ in course module (3 courses = 8 in).`

Single-leaf stretcher bond only; the geometric mortar volume (≈ 0.018 m³ per m² for UK bricks, close to BIA's 5.5 ft³ per 100 ft² for modular brick) excludes frogs, perforations and dropped mortar, which is why bag counts use the manufacturer's per-brick rule instead.

## Data Sources

- Brick Industry Association – Technical Note 10: Dimensioning and Estimating Brick Masonry — https://www.gobrick.com/media/file/10-dimensioning-and-estimating-brick-masonry.pdf (standard, retrieved 2026-09-23)
- QUIKRETE Mortar Mix No. 1102 product data sheet (80 lb bag lays up to 37 standard bricks) — https://www.quikrete.com/pdfs/data_sheet-mortar%20mix%201102.pdf (reference, retrieved 2026-09-23)
- Wikipedia – Brick (standard sizes by country) — https://en.wikipedia.org/wiki/Brick (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/brick?wall_length=…&wall_height=…`
- `POST https://tttkmbb.com/api/v1/calculate/brick` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/brick · OpenAPI operationId `estimate_bricks_needed` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "brick", "inputs": {…}}`

## Example

- 20 ft × 8 ft wall, US modular brick, 5 % waste: inputs `{"unit_system":"imperial","wall_length":20,"wall_height":8,"brick_size":"us_modular","waste_percent":5}` → `{"wall_area_ft2":160,"wall_area_m2":14.86,"bricks_per_ft2":6.75,"bricks_per_m2":72.66,"bricks_needed_no_waste":1080,"bricks_needed":1134,"mortar_volume_cubic_feet":9.46,"mortar_volume_m3":0.268,"mortar_bags_80lb":30,"mortar_bags_25kg":44}`
- 6 m × 2.4 m wall, UK standard brick, 5 % waste: inputs `{"unit_system":"metric","wall_length":6,"wall_height":2.4,"brick_size":"uk_standard","waste_percent":5}` → `{"wall_area_m2":14.4,"bricks_per_m2":59.26,"bricks_needed_no_waste":854,"bricks_needed":896,"mortar_volume_m3":0.254,"mortar_bags_80lb":24,"mortar_bags_25kg":35}`

```
GET https://tttkmbb.com/api/v1/calculate/brick?unit_system=imperial&wall_length=20&wall_height=8&brick_size=us_modular&waste_percent=5
```

## Limitations

The wall is concrete block (use the block face 440 × 215 mm or 8 × 16 in as a custom brick) or two leaves thick: double the brick count, or use concrete-slab for footings. Single-leaf stretcher bond only; the geometric mortar volume (≈ 0.018 m³ per m² for UK bricks, close to BIA's 5.5 ft³ per 100 ft² for modular brick) excludes frogs, perforations and dropped mortar, which is why bag counts use the manufacturer's per-brick rule instead. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How many bricks per square metre?**

About 60 for UK bricks (215 × 65 mm with 10 mm joints gives 59.3), 50 for Australian and German formats, 73 for US modular (6.75 per ft²) and 75 for the 190 × 57 mm metric modular brick, all for a single leaf in stretcher bond.

**What about a full-brick (one-brick-thick) wall?**

Double the brick count (≈ 120 per m² for UK bricks) and roughly triple the mortar, because the collar joint between the two leaves is also filled.

**Why do the mortar volume and the bag count not match?**

The volume is the net geometry of the joints; the bag rule (37 bricks per 80 lb bag) is the manufacturer's practical figure and includes frogs, perforations and spillage, which typically double the mortar actually used.

## Related

- [Concrete Slab Calculator](https://tttkmbb.com/construction/concrete-slab.md) — Concrete for the footing under the wall.
- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Area of a wall with openings to subtract.
- [Gravel Calculator](https://tttkmbb.com/construction/gravel.md) — Hardcore or sand under the footing.
