This calculator converts a given quantity from a wide range of units (mass, volume, length, or count) into grams, using the density or molar mass you provide. Enter the numeric value, select its unit, and supply the conversion factor (density in g/mL or molar mass in g/mol) to get the mass in grams.
Formula
The conversion uses the fundamental relation between mass, amount, and density (or molar mass):
mass (g) = amount × conversion factor × density (g/mL) or molar mass (g/mol)
Where:
- amount – the numeric value you enter (no unit).
- conversion factor – the factor that converts your chosen unit to grams (for mass units) or to milliliters (for volume units). For example, 1 kg = 1000 g, 1 L = 1000 mL.
- density (g/mL) – used when the amount is a volume (mL, L, cm³, m³). Density is mass per unit volume; for water at 25 °C it is approximately 1.000 g/mL.
- molar mass (g/mol) – used when the amount is in moles (mol). Molar mass is the mass of one mole of a substance; for NaCl it is 58.44 g/mol.
For mass units (g, kg, mg), the density/molar mass field is ignored (set to 1). For volume units, you must enter the density of the substance. For moles, you must enter the molar mass.
Worked Example
Using the default values: amount = 1, unit = g, density = 1.000 g/mL (ignored for mass units).
Step 1: Identify the conversion factor for grams: 1 g = 1 g.
Step 2: Since the unit is already grams, the mass is simply: 1 × 1 × 1.000 = 1.000 g.
Step 3: The calculator returns 1.000 g.
Now consider a typical volume conversion: you have 250 mL of a liquid with density 0.789 g/mL (ethanol). Enter amount = 250, unit = mL, density = 0.789.
Step 1: Convert mL to mL (factor = 1).
Step 2: Mass = 250 × 1 × 0.789 = 197.25 g.
The calculator would show 197.25 g.
Assumptions
- Density is constant at the temperature of measurement; for liquids, density changes with temperature.
- For volume conversions, the substance is homogeneous and the density is uniform.
- For mole conversions, the molar mass is that of the pure substance, not a mixture.
- Mass units (g, kg, mg) do not require density; the conversion factor is exact.
How to Choose the Right Conversion Factor
The key is to know what your starting unit measures:
- Mass units (g, kg, mg) – direct conversion: 1 kg = 1000 g, 1 mg = 0.001 g. No density needed.
- Volume units (mL, L, cm³, m³) – you must know the density of the substance. Density is often given in g/mL or g/cm³ (they are numerically equal). For water, density ≈ 1.000 g/mL at 4 °C and ≈ 0.998 g/mL at 20 °C. For other liquids, look up the density in a reference table or on the safety data sheet (SDS).
- Moles (mol) – you must know the molar mass of the substance. For a compound, add the atomic weights of its elements (e.g., NaCl: 22.99 + 35.45 = 58.44 g/mol). For elements, use the atomic weight from the periodic table.
When in doubt, check the units of your density or molar mass: if density is in g/mL, use volume in mL; if molar mass is in g/mol, use amount in mol.
Common Mistakes and Misconceptions
- Mixing up volume and mass – 1 mL of water weighs 1 g, but 1 mL of oil weighs about 0.92 g. Always use density; do not assume 1 mL = 1 g except for water.
- Forgetting to convert units – If you enter volume in liters but density is in g/mL, you must convert liters to milliliters (1 L = 1000 mL). Our calculator does this automatically, but if you do it manually, always check unit consistency.
- Using molar mass for volume – Molar mass is for moles, not for volume. If you have a solution of known molarity, you need to convert moles to grams using molar mass, not density.
- Rounding too early – Round only the final answer, not intermediate steps, to avoid significant error.
When to Use This Conversion
This conversion is essential in chemistry labs, cooking, and everyday measurements:
- Preparing solutions – To make a molar solution, you weigh the solute in grams. For example, to make 1 L of 1 M NaCl, you need 58.44 g of NaCl.
- Converting recipe measurements – Many recipes list dry ingredients in cups (volume), but scales measure in grams. Converting cups to grams requires the density of the ingredient (e.g., flour ~0.5 g/mL, sugar ~0.85 g/mL).
- Reading nutrition labels – Some labels list serving size in mL; converting to grams helps track intake, especially for liquids with density different from water.
- Calculating reagent amounts – In a lab procedure, you might need 0.5 mol of a compound; multiply by molar mass to get grams.
Limitations and Accuracy
This calculator is a general tool; its accuracy depends on the precision of the density or molar mass you enter. For critical lab work, always use the exact density at your working temperature, and for molar mass use the precise atomic weights from the IUPAC table. The calculator assumes the substance is pure and the density is constant, which may not hold for mixtures or gases. For gases, density is highly dependent on pressure and temperature; use the ideal gas law instead. Also, for very small or large numbers, the calculator may display scientific notation; interpret accordingly.
Frequently Asked Questions
How many grams are in a cup?
It depends on the ingredient. A cup is a volume unit (about 237 mL). For water, 1 cup weighs about 237 g. For flour, which is less dense, 1 cup weighs about 120 g. To convert, multiply the volume in mL by the density in g/mL.
Is 1 mL always 1 gram?
No, only for water at 4 °C. The density of water is 1.000 g/mL at that temperature, but at 20 °C it is 0.998 g/mL. For other liquids, the density differs significantly; for example, olive oil has a density of about 0.91 g/mL, so 1 mL of olive oil weighs 0.91 g.
How do I convert moles to grams?
Multiply the number of moles by the molar mass of the substance. For example, 2 moles of water (molar mass 18.015 g/mol) weigh 2 × 18.015 = 36.03 g. You need the molar mass from the periodic table or a compound’s formula.
What is the difference between density and molar mass?
Density is mass per unit volume (g/mL or g/cm³), and it varies with temperature and pressure. Molar mass is the mass of one mole of a substance (g/mol) and is a fixed property of the substance. Density is used for volume-to-mass conversions; molar mass is used for mole-to-mass conversions.
Can I use this calculator for gas conversions?
Not directly. Gases have densities that change dramatically with temperature and pressure. For gases, you would need the ideal gas law (PV = nRT) to find moles, then multiply by molar mass to get grams. This calculator is best for liquids and solids where density is relatively stable.
Why does my recipe use grams instead of cups?
Because grams are a mass measurement, which is more accurate and consistent than volume. Volume measurements can vary due to packing (e.g., flour settles) and ingredient density. Using a scale ensures you get the exact same amount every time.
Related
Formula used
in amt | Amount | - | 1 | 0 sel unit | Unit | g=1, kg=1000, mg=0.001, mL=1, L=1000, cm³=1, m³=1e6, mol=1 in dens | Density or molar mass | g/mL or g/mol | 1.000 | 0 out grams | Mass in grams | g | amt * unit * dens | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- How to Calculate Mole Fractions0.400
- GCN Sequence Number Lookup: How It Works33:48:34
- How to Calculate Mole Fraction of a Solution0.0089
- How to Determine Mole Fraction0.4000
- How to Solve for Enthalpy of Reaction-635.3 kJ/mol
- How to Get Mole Fraction: Formula & Step-by-Step0.2000 mol/L