# Unit conversion

`calc_unit_conversion` · Runs: On the server · Level: Checked against a reference: exact rational arithmetic

Converts a value between units of one quantity, between molar and mass units, and between °C and K.

Research and education software; not medical advice, and not for diagnosis or treatment decisions. It computes from the inputs it receives. It does not check the person's data, design or sample.

[Catalogue](https://www.drybench.com/mcp/catalogue) / [Solutions](https://www.drybench.com/mcp/catalogue/solutions)

[Ask your assistant](https://www.drybench.com/mcp/connect) · [Open in Drybench Calc](https://www.drybench.com/calculators/app)

```cite
Unit conversion (calc_unit_conversion), Drybench MCP server 1.0.0; unit-conversion@1.0.1 (Checked against a reference); temperature-offset@1.0.0 (Checked against a reference); https://www.drybench.com/mcp/tools/calc-unit-conversion
```

## What it is

Converts between units and returns decimal text at result.converted.decimal with its unit. SI scaling and Celsius–kelvin offsets preserve all digits. Conversions between molar and mass units use your formula weight and round to twelve significant figures. A molar result outside the normal range of a double is refused.

Field: [Solutions](https://www.drybench.com/mcp/catalogue/solutions). It is the same calculation as [Drybench Calc](https://www.drybench.com/calculators/app), called by an AI assistant through the server.

## What it does

**You give**

- `value` (required): Plain decimal text such as '0.0025'. Strings retain all digits and can carry values outside the range of a double. Finite JSON numbers are also accepted.
- `from` (required): Unit converted from. Units: kg, g, mg, µg, ng, pg, L, mL, µL, nL, mol, mmol, µmol, nmol, pmol, fmol, M, mM, µM, nM, pM, kg/L, g/L, mg/mL, mg/L, µg/mL, ng/µL, µg/L, ng/mL, kg/mol, kDa, g/mol, Da, cm, mm, m^2, cm^2, mm^2, cells, cells/L, cells/mL, cells/µL, cells/cm^2, cells/mm^2, AU, mAU, degC, K.
- `to` (required): Unit converted to, using the same list as from.
- `formulaWeight`: Formula weight of the exact chemical form, g/mol; required between molar and mass units.

**A request and its answer**

Asked with

- `value`: 2.5
- `from`: mg/mL
- `to`: mM
- `formulaWeight`: 180.2

It answered (computed)

- `kind`: molar

Computed by this tool when the page was built. The steps between are not recorded, so this is not a worked example. The reply carries more values than are shown here. One answer to one request, not a reference value.

**Limits**

- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
- No other limit is recorded for this tool.

Every reply also carries its app's limits line: "The stock, dilution and buffer calculations here are not for dosing or clinical preparation."

**It will not answer when**

- A conversion that needs a density (%, mol/kg, mass to volume).
- Normality (N).
- Activity units (U, IU).
- ppm or ppb.

### Every input, with its units

4 inputs

- `value` (required): Plain decimal text such as '0.0025'. Strings retain all digits and can carry values outside the range of a double. Finite JSON numbers are also accepted.
- `from` (required): Unit converted from. Units: kg, g, mg, µg, ng, pg, L, mL, µL, nL, mol, mmol, µmol, nmol, pmol, fmol, M, mM, µM, nM, pM, kg/L, g/L, mg/mL, mg/L, µg/mL, ng/µL, µg/L, ng/mL, kg/mol, kDa, g/mol, Da, cm, mm, m^2, cm^2, mm^2, cells, cells/L, cells/mL, cells/µL, cells/cm^2, cells/mm^2, AU, mAU, degC, K.
- `to` (required): Unit converted to, using the same list as from.
- `formulaWeight`: Formula weight of the exact chemical form, g/mol; required between molar and mass units.

### Every refusal, with its code

15 refusals

| Code | When |
| --- | --- |
| `DENSITY` | A conversion that needs a density (%, mol/kg, mass to volume). |
| `NORMALITY` | Normality (N). |
| `ACTIVITY` | Activity units (U, IU). |
| `PPM` | ppm or ppb. |
| `FOLD` | A fold change. |
| `OD` | OD600. |
| `RPM` | RPM or × g. |
| `FORMULA_WEIGHT` | A molar bridge needs a positive formula weight. |
| `INCOMPATIBLE` | Units of two different quantities with no bridge. |
| `UNKNOWN_UNIT` | A unit the converter does not list. |
| `NOT_A_NUMBER` | The value is not a plain decimal. |
| `NEGATIVE` | A negative value. |
| `MAGNITUDE_OUT_OF_RANGE` | A nonzero molar bridge result lies outside the normal range of a double. |
| `BELOW_ABSOLUTE_ZERO` | A temperature below 0 K. |
| `NOT_A_NUMBER` | The value is not a plain decimal. |

## The calculation

2 methods, each with its equations, constants and worked example.

### [Unit conversion within one quantity, with molar bridges through a supplied formula weight](https://www.drybench.com/methods/m/unit-conversion/1.0.1)

`unit-conversion@1.0.1`

**Equation 1**

```text
Within one quantity: value_to = value_from × 10^(exp_from − exp_to), done on the decimal text so no digit is lost
exp is each unit's power of ten to its quantity's base unit (SI prefixes, Table 7
the litre, Table 8).
```

| Symbol | Meaning |
| --- | --- |
| `exp` | power of ten from the unit to the base unit (mg: −3 to g), 1 |

Source 1.

**Equation 2**

```text
Between molar and mass units: mass concentration = molarity × M, mass = amount × M, with M the formula weight the caller states for the exact chemical form.
```

| Symbol | Meaning |
| --- | --- |
| `M` | formula weight of the exact form, stated by the caller, g/mol |

| Constant | Value | From |
| --- | --- | --- |
| Each listed unit's power of ten to its base unit `exp` | a table of values, part of the method | Source 1 |

A definition, not a model: the equation states what the quantity means. A different convention gives a different number.

**Worked example**

Worked example: one case of unit-conversion\@1.0.1, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- value = 150
- from = mM
- to = g/L
- formulaWeight = 58.44

**Steps**

1. prefix: milli = 10⁻³ (SI Table 7) = 0.15 mol/L, from 150 mM = 150 × 10⁻³ mol/L.
2. bridge: ρ = c × M = 8.766 g/L, from c = 0.15, M = 58.44; gives result.value.

The working, as the case writes it:

```text
milli = 10⁻³ (Table 7)
mass concentration = molarity × formula weight.
```

**Answer**

- result.value = 8.766 g/L

Where these values came from: our own exact-arithmetic script and a hand-worked case; BIPM. The International System of Units (SI), 9th edition 2019, V4.01 (June 2026): Table 7 (prefixes), Table 8 (litre, dalton), §2.3.1 (t/°C = T/K − 273.15); the formula weight is the caller's.

The build has not run this example through the tool.

Worked by an AI session on 2026-11-21. No person has yet worked this case.

### [Celsius and kelvin by the exact offset](https://www.drybench.com/methods/m/temperature-offset/1.0.0)

`temperature-offset@1.0.0`

```text
t/°C = T/K − 273.15, exactly, on the decimal text.
```

| Symbol | Meaning |
| --- | --- |
| `t` | Celsius temperature, Cel |
| `T` | thermodynamic temperature, K |

Source 1.

| Constant | Value | From |
| --- | --- | --- |
| The offset between the scales, exact by definition `T0` | 273.15 K | Source 1 |

Kind of method: not recorded.

**Worked example**

Worked example: one case of temperature-offset\@1.0.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- value = 37
- from = °C
- to = K

**Steps**

1. offset: T/K = t/°C + 273.15 = 310.15 K, from t = 37; gives result.value.

The working, as the case writes it:

```text
T/K = t/°C + 273.15 (SI Brochure §2.3.1).
```

**Answer**

- result.value = 310.15 K

Where these values came from: our own exact-arithmetic script and a hand-worked case; BIPM. The International System of Units (SI), 9th edition 2019, V4.01 (June 2026): Table 7 (prefixes), Table 8 (litre, dalton), §2.3.1 (t/°C = T/K − 273.15).

The build has not run this example through the tool.

Worked by an AI session on 2026-11-11. No person has yet worked this case.

## Sources

1. Bureau International des Poids et Mesures. The International System of Units (SI), 9th edition, 2019 (V4.01, June 2026). doi:10.59161/AUEZ1291. Used for: Unit conversion within one quantity, with molar bridges through a supplied formula weight; Celsius and kelvin by the exact offset. At: table 7, 8; p. PDF page 19, section 2.3.1, the kelvin. **Read in full, 11 November 2026**

Read by AI-assisted sessions. No person has checked these readings.

## How it is checked

**Level:** Checked against a reference, the lowest of its 2 methods.

**Checked against:** Unit conversion within one quantity, with molar bridges through a supplied formula weight: Exact rational arithmetic (Python 3.13.16 fractions) with factors from the BIPM SI Brochure, 9th edition, on 44 cases, 16 of them refusals: prefix changes exactly as decimal strings, molar bridges to nine significant figures (10 October 2026). Celsius and kelvin by the exact offset: Exact rational arithmetic (Python 3.13.16 fractions) on 5 conversions and 2 refusals below absolute zero, exactly as decimal strings (10 October 2026).

**Cases:** Unit conversion within one quantity, with molar bridges through a supplied formula weight: No case set is linked to this version. Celsius and kelvin by the exact offset: No case set is linked to this version.

**Hostile inputs:** Sent 27 malformed, extreme and misspelt calls. None broke it, and every call with an undeclared argument, or with text in place of a number or a true/false value, was declined with a reason. Run 2026-11-12-2 of 12 November 2026, server 0.11.0.

**Same answer:** Called twice and with its arguments in another order, it gave the same result. Run 2026-11-12-2 of 12 November 2026, server 0.11.0.

**Not checked:** Unit conversion within one quantity, with molar bridges through a supplied formula weight: Since the 2019 SI the molar mass constant is not exactly 1 g/mol, so reading Da as g/mol is a convention rather than an identity; the size of the difference was not read here (CODATA 2022 not read) and is not carried. No published case set names unit-conversion\@1.0.1: its fixtures are not tied to this version by a manifest. Celsius and kelvin by the exact offset: No published case set names temperature-offset\@1.0.0.

No independent scientist has yet reviewed this.

### What was not checked, in full

from the method records

[Unit conversion within one quantity, with molar bridges through a supplied formula weight](https://www.drybench.com/methods/m/unit-conversion/1.0.1)

- Since the 2019 SI the molar mass constant is not exactly 1 g/mol, so reading Da as g/mol is a convention rather than an identity; the size of the difference was not read here (CODATA 2022 not read) and is not carried.
- No published case set names unit-conversion\@1.0.1: its fixtures are not tied to this version by a manifest.
- No case runs this method through the served tool on its production runtime.

### What this project's records still lack

2 things

- A run of the worked example through the tool for both methods.
- A case set linked to this version for both methods.

### Cite a number from this tool

the cite line

Every reply carries a cite line naming the tool, the server version, each method with its version and level, and the receipt. Quote it with any number taken from the reply.

```cite
calc_unit_conversion, server 1.0.0; unit-conversion@1.0.1 (Checked against a reference); receipt 4fd523641391/ff52379e7c71; methods https://www.drybench.com/methods/calculators; page https://www.drybench.com/methods/tools/calc-unit-conversion. Quote this line with any number taken from this reply.
```

### Changes to its methods

1 change

- [21 November 2026, unit-conversion\@1.0.1](https://www.drybench.com/methods/corrections#2026-11-21-unit-conversion101-1): In 1.0.1 such a bridge is worked in exact rational arithmetic on the decimal as typed and the formula weight's exact binary value, then rounded to twelve significant figures as before: the case above now gives 1e-200 M. An answer that is itself outside the normal range of a double is refused with problem magnitude and a stated reason. Every bridge whose double arithmetic stayed in the normal range runs 1.0.0's arithmetic and gives the same answer.
