Home › Physics › Density Calculator
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.
When to use
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).
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
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
mass_kg | number | kg | no | Mass in kilograms (1 g = 0.001 kg). Omit to solve for it. Range: ≥ 0 |
volume_m3 | number | m³ | no | Volume in cubic metres (1 L = 0.001 m³, 1 cm³ = 1e-6 m³). Omit to solve for it. Range: > 0 |
density_kg_m3 | number | kg/m³ | no | Density in kg/m³ (1 g/cm³ = 1000 kg/m³; water ≈ 1000, steel ≈ 7850, aluminium ≈ 2700). Omit to solve for it. Range: > 0 |
Outputs
| Output | 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³. |
Example
2 kg in 2.5 L: {"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³): {"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
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/density-mass-volume(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/density-mass-volume · Markdown: https://tttkmbb.com/physics/density-mass-volume.md · JSON definition: https://tttkmbb.com/physics/density-mass-volume.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="density-mass-volume" - OpenAPI operationId:
solve_density - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
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 calculators
- Pressure Calculator — Force and pressure exerted by a mass.
- Sphere Calculator — Volume of a sphere for the density formula.
- Cylinder Calculator — Volume of a cylinder for the density formula.