For some types of cancer, there were hints that coffee may even be beneficial, said the International Agency for Research on Cancer (IARC) - but not if consumed hotter than 65 degrees Celsius.
A review of over 1,000 studies concluded that drinking "very hot" beverages was "probably carcinogenic to humans," said the agency.
"It doesn't matter what the liquid is. What matters is the temperature," said epidemiologist Dana Loomis, who took part in the review of the world's most popular hot drinks.
Both had been classified as "possibly cancerogenic to humans" since 1991, when the last evaluation was done.
Also Read
But evidence gathered since could link neither drink to an elevated cancer risk, said IARC, an agency of the UN's World Health Organization (WHO).
Only when drunk hotter than 65 C did any association arise with cancer of the gullet - the pipe that transports food and fluids from the throat to the stomach, it added.
But there was good news for coffee drinkers.
The analysis found that at "normal" temperatures, there was some data pointing to a lower risk of cancer of the uterus, liver and breast.
Studies have also found that coffee had strong antioxidant effects and other possible health benefits.
Taken together, the available data suggests "there is inadequate evidence in humans for the carcinogenicity of coffee drinking," said the agency.
Mate is typically consumed from a closed container with a metal straw that delivers the brew directly to the throat.
"The single study that examined cold mate drinking showed no association with oesophageal cancer," said the agency.
It also scoured studies on the possible link between cancer and other hot beverages, including milky teas drunk in parts of Africa and central Asia.