# Decibel Calculator

> Converts between a linear ratio and decibels using 10·log10 for power quantities or 20·log10 for amplitude quantities (voltage, current, sound pressure), and between dBm and milliwatts (0 dBm = 1 mW).

- Calculator id: `decibel` · Category: Engineering & Automotive (`engineering`) · Tool name: `convert_decibels`
- Canonical page: https://tttkmbb.com/engineering/decibel · This document: https://tttkmbb.com/engineering/decibel.md · JSON definition: https://tttkmbb.com/engineering/decibel.json

## Purpose

Converts between a linear ratio and decibels using 10·log10 for power quantities or 20·log10 for amplitude quantities (voltage, current, sound pressure), and between dBm and milliwatts (0 dBm = 1 mW).

**Use when:** You need to express a gain, loss or signal ratio in dB, turn a dB figure back into a ratio, or convert an RF power level between dBm and mW/W.

**Do not use when:** You need to add two sound levels or account for distance attenuation, or you need plain logarithms (use logarithm).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `quantity` | enum: power \| amplitude \| dbm |  | optional, default "power" | Whether the linear value is a power ratio, an amplitude (field) ratio, or an absolute power in mW for dBm. |
| `linear_value` | number |  | optional | The ratio (output/input), or the power in milliwatts for quantity=dbm. Give either linear_value or decibel_value. (> 0) |
| `decibel_value` | number | dB | optional | Level in dB (or dBm for quantity=dbm). Give either linear_value or decibel_value. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `solved_for` | string |  | decibel_value or linear_value. |
| `decibel_value` | number | dB | 10·log10(ratio) for power, 20·log10(ratio) for amplitude, 10·log10(mW) for dBm. |
| `linear_value` | number |  | The ratio, or milliwatts for dBm. |
| `power_ratio` | number |  | 10^(dB/10): the power ratio corresponding to this dB value. |
| `amplitude_ratio` | number |  | 10^(dB/20): the voltage/current ratio corresponding to this dB value (power and amplitude modes). |
| `milliwatts` | number | mW | Absolute power (dBm mode only). |
| `watts` | number | W | Absolute power in watts (dBm mode only). |
| `dbw` | number | dBW | dBm − 30 (dBm mode only). |
| `interpretation` | string |  | Plain-language reading of the result. |

## Formula

`power: dB = 10 × log10(ratio), ratio = 10^(dB/10); amplitude: dB = 20 × log10(ratio), ratio = 10^(dB/20); dBm = 10 × log10(P_mW), P_mW = 10^(dBm/10); dBW = dBm − 30`

Amplitude quantities use 20·log10 because power is proportional to amplitude squared, so both conventions give the same dB for the same physical change. A negative dB value means attenuation (ratio below 1).

## Data Sources

- Wikipedia – Decibel — https://en.wikipedia.org/wiki/Decibel (reference, retrieved 2026-09-24)
- Wikipedia – dBm — https://en.wikipedia.org/wiki/DBm (reference, retrieved 2026-09-24)
- 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-24)

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/decibel?`
- `POST https://tttkmbb.com/api/v1/calculate/decibel` 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/decibel · OpenAPI operationId `convert_decibels` 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": "decibel", "inputs": {…}}`

## Example

- Power ratio 1000: inputs `{"quantity":"power","linear_value":1000}` → `{"solved_for":"decibel_value","decibel_value":30,"power_ratio":1000,"amplitude_ratio":31.622777,"interpretation":"Gain of 30 dB: output power is 1000× the input"}`
- 20 dBm to milliwatts: inputs `{"quantity":"dbm","decibel_value":20}` → `{"solved_for":"linear_value","linear_value":100,"milliwatts":100,"watts":0.1,"dbw":-10}`

```
GET https://tttkmbb.com/api/v1/calculate/decibel?quantity=power&linear_value=1000
```

## Limitations

You need to add two sound levels or account for distance attenuation, or you need plain logarithms (use logarithm). Amplitude quantities use 20·log10 because power is proportional to amplitude squared, so both conventions give the same dB for the same physical change. A negative dB value means attenuation (ratio below 1). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Is doubling 3 dB or 6 dB?**

Doubling the power is +3.01 dB; doubling the voltage (or current or sound pressure) is +6.02 dB, which is also a 4× power increase.

**What is the difference between dB and dBm?**

dB is a ratio with no unit; dBm is an absolute power referenced to 1 mW (0 dBm = 1 mW, 30 dBm = 1 W, −30 dBm = 1 µW).

## Related

- [Logarithm Calculator](https://tttkmbb.com/math/logarithm.md) — The underlying base-10 logarithm.
- [Electric Power Calculator](https://tttkmbb.com/physics/electric-power.md) — Absolute electrical power from voltage and current.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — Evaluate 10^(dB/10) directly.
