# 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.
