Water Hardness Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the calcium and magnesium from your water test to get the total hardness, in mg/L as CaCO3 and in grains per gallon.
Result
Total hardness (mg/L as CaCO3)
Total hardness (grains per US gallon)
- Total hardness (mmol/L)
- USGS hardness class
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Calcium, Ca, in mg/L: enter 0 or more.
- Magnesium, Mg, in mg/L: enter 0 or more.
- Read the result: Total hardness (mg/L as CaCO3); the panel also shows Total hardness (grains per US gallon), Total hardness (mmol/L) and USGS hardness class.
How this calculator works
Hardness as CaCO3 = Ca × (100.086 ÷ 40.078) + Mg × (100.086 ÷ 24.305), that is about 2.497 × Ca + 4.118 × Mg, in mg/L. The molar masses of CaCO3 (100.086), Ca (40.078) and Mg (24.305) come from the CIAAW abridged standard atomic weights 2024 (ciaaw.org/abridged-atomic-weights.htm, read on 2026-10-27).
USGS classes: 0 to 60 mg/L soft, 61 to 120 moderately hard, 121 to 180 hard, more than 180 very hard (USGS Water Science School, Hardness of Water, usgs.gov, read on 2026-10-27).
1 grain = 64.79891 mg exactly (NIST SP 811, Appendix B.9, read on 2026-10-27) and 1 US gallon = 3.785411784 L, so 1 grain per gallon = 17.1181 mg/L.
The formula
| Symbol | Meaning | Unit |
|---|---|---|
| Calcium, Ca | mg/L | |
| Magnesium, Mg | mg/L | |
| Total hardness (mg/L as CaCO3) |
Worked example
| Calcium, Ca | 40 mg/L |
|---|---|
| Magnesium, Mg | 10 mg/L |
| Total hardness (grains per US gallon) | 8.241 |
|---|---|
| Total hardness (mmol/L) | 1.4095 |
| USGS hardness class | Hard (121 to 180 mg/L) |
Total hardness (mg/L as CaCO3) 141.0704
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
How hard is water with 40 mg/L calcium and 10 mg/L magnesium?
About 141.1 mg/L as CaCO3, or 8.24 grains per gallon: hard in the USGS classes.
How do I convert grains per gallon to mg/L?
Multiply by 17.1181. For example 10 grains per gallon is about 171.2 mg/L as CaCO3.