Welsh hospitals have been left nearly £9m in wills in the past three financial years, new figures show.
Health officials say the money is never expected, but can provide services which are not funded by the NHS.
The biggest single gift left last year was for £630,000 for palliative and community care in mid and south Powys.
"It's a huge amount of money," said Martin Price, chair of the Institute of Fundraising Cymru which supports fundraisers and charities.
"Local communities are very supportive of their local hospitals," he told BBC Radio Wales.
The figure show over £442,000 was left to Swansea's Singleton Hospital's radiotherapy unit and £168,000 went to cancer care at Glan Clwyd in Denbighshire.
"Legacies help us provide life-changing equipment, training, projects and research that is not available through the NHS," said Kirsty Thomson, fundraising manager for the Betsi Fund.
It is a charity which looks after 290 funds aligned to hospital and health care in north Wales managed by Betsi Cadwaladr University Health Board (BCUHB).
As the biggest health board in Wales, it received most bequests totalling £4,272,042 in the past three financial years.
The figures have been obtained by BBC Wales from all the health boards in Wales under a Freedom of Information request.
Last year's figure totalled £8.7m.
Mrs Thomson said the bequests honoured people's last wishes and were used to benefit patients and their families, purchasing everything from chairs to refurbishing relatives' room as well as funding music and arts in health and wellbeing projects.
"Generous people from across north Wales have helped us make really significant changes to healthcare provision through giving over £4m in legacies over the past three years."
The money from bequests is left as either a pecuniary legacy - decided when someone makes their will - or as a residuary legacy, which is the total left after someone's estate has been settled.
The figures show they do not only involve large sums. A small bequest of £17.22 was left to Betsi Cadwaladr last year, with £200 left to Knighton Hospital, Powys, among many others across Wales.
Mrs Thomson explained: "Not everyone wants to tell us about their intention to leave a legacy so sometimes we don't know until we are contacted when the executors are finalising the estate."
She explained that people had different motivations with some wanting to leave a legacy to benefit others while others used it to recognise the care that they or a family member had received.
"They recognise that exceptional care requires exceptional support," she said.