function calculateDensity() {
var mass = parseFloat(document.getElementById("massValue").value);
var volume = parseFloat(document.getElementById("volumeValue").value);
var mUnit = document.getElementById("massUnit").value;
var vUnit = document.getElementById("volumeUnit").value;
var resultDiv = document.getElementById("density-result");
var finalDensitySpan = document.getElementById("finalDensity");
var sentenceSpan = document.getElementById("resultSentence");
if (isNaN(mass) || isNaN(volume) || volume <= 0 || mass <= 0) {
alert("Please enter positive numeric values for both mass and volume.");
return;
}
var density = mass / volume;
var roundedDensity = Math.round(density * 10000) / 10000;
finalDensitySpan.innerHTML = roundedDensity + " " + mUnit + "/" + vUnit;
sentenceSpan.innerHTML = "This means for every 1 " + vUnit + " of volume, the substance has a mass of " + roundedDensity + " " + mUnit + ".";
resultDiv.style.display = "block";
}
The Ultimate Guide to Calculating Density: A Worksheet Helper
Understanding how to calculate density is a fundamental skill in physics and chemistry. Density is a physical property of matter that expresses the relationship between mass and volume. It tells us how much "stuff" is packed into a specific amount of space.
What is the Density Formula?
To find the density of an object, you use the following mathematical equation:
Density (ρ) = Mass (m) ÷ Volume (V)
Mass: The amount of matter in an object (usually measured in grams or kilograms).
Volume: The amount of space an object occupies (usually measured in cubic centimeters, milliliters, or liters).
Density: The mass per unit of volume (expressed as g/cm³, kg/m³, etc.).
How to Calculate Density Step-by-Step
If you are working through a calculating density worksheet, follow these simple steps to ensure accuracy:
Measure the Mass: Use a balance or scale to find the mass of the object.
Determine the Volume:
For regular solids (like a cube), use a ruler and the formula Length × Width × Height.
For irregular solids, use the water displacement method with a graduated cylinder.
For liquids, simply measure using a graduated cylinder.
Divide Mass by Volume: Plug your numbers into the formula.
Check Your Units: Ensure your final answer includes the correct units, such as g/mL or kg/L.
Real-World Example Calculation
Let's look at a common problem you might find on a density worksheet:
Problem: A block of wood has a mass of 120 grams and a volume of 150 cm³. What is the density of the wood?
Solution: 1. Mass = 120g
2. Volume = 150 cm³
3. Density = 120 / 150
4. Density = 0.8 g/cm³
Note: Since the density is less than 1.0 g/cm³ (the density of water), this wood would float!
Common Densities for Reference
Substance
Density (g/cm³)
Water
1.00
Gold
19.30
Aluminum
2.70
Iron
7.87
Ice
0.92
Why Does Density Matter?
Density helps scientists identify unknown substances because every pure substance has a specific density. It also explains buoyancy—why some objects sink while others float. This principle is vital in engineering ships, airplanes, and even understanding weather patterns and ocean currents.