Old English heardnes; see hard (adj.) + -ness. Meaning "difficulty of action or accomplishment" is late 14c.
the costs of reducing hardness depend on the relative amounts of calcium and magnesium compounds that are present
he assigned a series of problems of increasing hardness