Hydroxymethylfurfural, universally shortened to HMF, is a compound that forms in honey when sugars break down in acidic conditions. It is not added and it is not a contaminant in the usual sense; it is a natural by-product of two things, heat and time. Fresh honey straight from the comb contains almost none. Honey that has been warmed for pumping, filtering or pasteurising contains more, and honey that has simply sat in a drum for two years contains more as well.
That makes HMF a freshness and heat-treatment indicator rather than a safety parameter. Council Directive 2001/110/EC sets the maximum at not more than 40 mg per kg for honey placed on the EU market, with a higher allowance for honey of declared tropical origin. In practice a young, carefully handled honey arrives well below 10 mg per kg, so a result in the twenties or thirties is technically compliant while still telling you something about how the honey was treated.
The number becomes genuinely informative when it is read alongside diastase activity and the extraction date. Diastase is a heat-sensitive enzyme, so heat pushes HMF up and diastase down at the same time. A high HMF with a normal diastase on a two-year-old honey is age. A high HMF with a collapsed diastase is heat. Age is a commercial matter; heat on a honey sold as raw or unheated is a specification failure.
Two practical points for a buyer. First, ask for the extraction period on the certificate of analysis, not only the packing date, because HMF is uninterpretable without knowing how old the honey is. Second, remember that HMF keeps rising after you take delivery: a drum stored in a warm warehouse, or a container sitting in the sun, will test higher next quarter than it does today, which is why honey destined for a long shelf life is bought with headroom below the limit rather than at it.