
Density calculator
Calculate density calculator using the values and assumptions you provide.
Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.
Method and assumptions
Method version 1.0.0 · Updated
Calculate
Formula: ρ = m / V
Calculate density calculator using the values and assumptions you provide.
- mass
- Mass (kg)
- volume
- Volume (m³)
Results depend on the assumptions entered; verify professional or safety-critical decisions independently.
Calculate with code
These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.
JavaScript
const massKg = 2, volumeM3 = 0.001;
console.log(massKg / volumeM3); // 2000 kg/m³TypeScript
const massKg = 2, volumeM3 = 0.001;
const density: number = massKg / volumeM3;
console.log(density); // 2000 kg/m³Python
print(2 / 0.001) # 2000 kg/m³Java
System.out.println(2.0 / 0.001); // 2000 kg/m³C#
Console.WriteLine(2m / 0.001m); // 2000 kg/m³