Some firms said they could not recruit or retain the staff they needed.
The Local Government Association said it was the result of "historic under-funding" and an ageing population.
The government declined an interview but said English councils had received £9.25bn for social care.
The figure for the number of cancelled contracts comes from a Freedom of Information request, which was responded to by 197 of 212 UK councils.
According to the research, carried out for Panorama by Opus Restructuring and Company Watch, 69 home care companies have closed in the last three months and one in four of the UK's 2,500 home care companies is at risk of insolvency.
Councillor Izzi Seccombe from the Local Government Association - which represents councils across England and Wales - said: "We have warned that the combination of the historic under-funding of adult social care, and the significant pressures of an ageing population and the national living wage, are pushing the care provider market to the brink of collapse.
"These figures show the enormous strain providers are under, and emphasises the urgent need for a long-term, sustainable solution to the social care funding crisis."
Many home care companies say their biggest problem is recruitment and retention of carers.
The Centre for Workforce Intelligence estimates at least two million more carers will be needed by 2025 in England alone, in both in-home care and care homes, to cope with growing demand.
Last October, the regulator for England, the Care Quality Commission, warned that adult social care was at a tipping point.
One home care company, Cymorth Llaw, which had contracts with three councils in north Wales, told Panorama it had recently stopped working with one - Conwy, which had initially paid £14.20 an hour for care.
It offered to raise that to £15, but the company decided that still wasn't enough and handed back the contract.
Ken Hogg, at Cymorth Llaw, said: "We didn't think we could do it for the money - it was as simple as that.
"We pay as much [in wages] as we possibly can and we've always paid above what was the national minimum wage and the national living wage.
"[Carers] get a mileage allowance, they get paid travelling time between their clients."
Mr Hogg said the company was legally obliged to pay 1% pension and 13.8% national insurance contributions, along with training and other staff-associated costs, which "doesn't leave a great deal".
Conwy Council said it was committed to supporting vulnerable people in communities, despite the financial challenges.
Home care company Mears used to have a contract with Liverpool City Council but cancelled it in July, saying £13.10 an hour was not enough to cover costs.
Mears said it needed at least £15 an hour, and like other companies across the UK, argued its costs are often greater than what councils pay.
Alan Long, executive director at Mears, said: "That was a terrible thing to do for both service users and for care staff.
"We absolutely did not take that lightly, but frankly what choice did we have?
"We just cannot do the two most basic things that you need to do in home care - pay staff the absolute minimum of a living wage and be able to recruit enough people to deliver the service that Liverpool Council actually expected from us."
The industry's trade body, the United Kingdom Homecare Association, said many companies were really struggling.
Colin Angel, its policy and campaigns director, said some care providers are "really desperate" and "really do not know whether they're going to be able to continue in business, beyond the next year".
He added: "That means they're really having to make some hard commercial decisions, whether they might need to cease trading or indeed just hand back work to local councils."
The nationwide shortage of carers is leaving many elderly people stuck in NHS wards, which results in bed blocking.
Government figures show there are more than 6,500 people across Britain stuck in an acute hospital bed, despite being well enough to leave.
In England, a third of these are waiting for a home care package.
Mike Furlong, manager of the Granby Rehabilitation Unit in Liverpool, told Panorama that while on average people spend 28 days at the care facility, "some patients have been with us 12 and 14 weeks because all the therapy is complete, but unfortunately there's no care package available at the end of it".
Liverpool City Council said that, over the last seven years, its budget had been cut by £330m and it now needed to find a further £90m over the next three years.
Samih Kalakeche, Liverpool's director of adult social services, said: "Is there a crisis in the home care services? I'll say yes, there is - and it's not just money, it's the sheer volume of demographics.
"We've got an ageing population which we welcome, but we don't have enough people coming into the industry."
Earlier this month, Chancellor Philip Hammond announced £2bn extra for social care for English councils over the next three years.
Scotland, Northern Ireland, and Wales will decide how they spend their extra funding.
But the industry says that with an increasingly ageing population, it's just not enough to keep pace with demand.
The government has said it will be bringing forward more proposals later this year, to ensure a financially sustainable social care system.
Panorama: Britain's Home Care Crisis - Monday, 20 March, 20:30 GMT, BBC One
Care firms have cancelled contracts with 95 UK councils, saying they cannot deliver services for the amount they are being paid, a BBC Panorama investigation has found.