Sloppy mashed potato and soggy vegetables will become a thing of the past for hospital patients and staff under new rules to banish unacceptable food in the NHS.

For the first time hospitals will have to meet mandatory food standards as part of a long-mooted drive to raise its standards of food across the country, the Department of Health (DoH) said.

They will also be ranked according to the quality of their food and will be required to meet legally-binding standards.

Patients will be screened for malnutrition and given personal food plans, while hospital staff will have to ensure patients get the help they need so that they can physically eat and drink.

Healthy diets will be promoted to staff and visitors in hospital canteens, and what they serve will have to meet Government recommendations on salt, sugar and saturated fats.

Food suppliers will also benefit, with food having to be sourced in a sustainable way so that it is healthy, good for individuals and the wider food industry.

The standards were recommended in a report by the Hospital Food Standards Panel, which developed them after working with organisations including royal colleges and nutritional experts.

As well as the compulsory standards there are recommendations that hospitals develop food and drink policies that encourage healthy eating, high-quality food production, sustainability and excellent nutritional care.

Patients will be able to check the standard of food at their local hospital on the NHS Choices website, where every hospital will be ranked for food quality.

They will be assessed on everything from quality and choice of food to the availability of fresh fruit, cost of food services and whether a menu has been approved by a dietician.

The DoH said that food was a "critical part of a patient's hospital experience".

A spokesman said: " It needs to be nutritious, appetising and accessible to patients, their visitors and NHS staff. It should meet social and cultural expectations and be packaged and presented so that people can eat and enjoy it.

"Food must also be clinically appropriate and everyone who needs more help to eat and drink should get it.

"When a patient is malnourished it makes recovery more difficult, increases length of stay and can lead to complications such as pressure sores and infections."

The Care Quality Commission (CQC) will look at a range of information, including patient inspection data, to spot potential problems with food and determine which hospitals need closer inspection of their food practices.

Hospitals that fail to follow the guidance will be in breach of their commissioning contract - usually held with a clinical commissioning group - and commissioners will be able to take action against them.

Health Secretary Jeremy Hunt said: " We are making the NHS more transparent, giving patients the power to compare food on wards and incentivising hospitals to raise their game.

"Many hospitals are already offering excellent food to their patients and staff. But we want to know that all patients have nourishing and appetising food to help them get well faster and stay healthy, which is why we're introducing tough new mandatory standards for the first time ever."

Dianne Jeffrey, chairwoman of Age UK, who led the standards panel, said the recommendations would help busy hospital staff ensure patients get appetising and nutritious food that they want to eat, and receive the help they need to do so.

She said: "Being in hospital is often a very worrying experience and it can be made worse when the food is unfamiliar or unappetising and you have no control over what and when you eat and drink.

"Whilst hospitals are not five-star restaurants, it's important that food and drink is tasty, nourishing and thoughtfully presented so that people can eat as well possible.

"Getting hospital food and drink right is critical and should also be considered an important part of someone's medical care. Malnutrition and dehydration pose a real risk for patients if they go unnoticed and untreated.

"We know malnourished people will take longer to recover and suffer from more complications. No hospital can afford to neglect this essential part of their care."

Professor Edward Baker, deputy chief inspector of hospitals at the CQC, welcomed the announcement.

He said: "It's really important for patients to have access to good quality food based on their own needs. During our inspections, we speak to patients and check records to ensure patients are receiving the right food for their individual needs.

"Our findings determine which hospitals need closer inspection of their food practices."

The Royal College of Nursing also commended the move, calling good hospital food "one of the cornerstones of good patient care".

Janet Davies, the college's executive director, said: "While hospital food has improved in many parts of the NHS, there is still more to do to ensure consistency in the quality of the meals being provided to patients.

"Many hospital patients need help to eat, for example it can take up to 45 minutes to assist someone with dementia to eat even a small meal, so staff need to have enough time to help feed their patients.

"Hospitals must make sure they have sufficient numbers of suitably trained staff available to deliver this care and assistance for every patient that needs it."

Shadow public health minister Luciana Berger said: "Everyone wants to see the quality of hospital food improved, but without proper enforcement there is a risk that these new standards will simply be ignored.

"It is regrettable that Jeremy Hunt has published these standards without consulting with patients and it is worrying that some experts have described the standards as 'weak' and 'woefully inadequate'.

"If Jeremy Hunt is serious about improving patients' experience of the NHS then he must also address the crisis in A&E and the growing waiting lists for operations."