People who reduced their salt intake to three grams a day suffered significantly fewer headaches, a study found.
Three grams of salt is the equivalent of around half a teaspoon, or the amount found in a McDonalds Big Mac and large fries.
Experts said cutting salt could reduce headaches because it lowers blood and pulse pressure.
But even people with normal blood pressure saw a reduction in headaches when they cut their salt intake.
However, switching from a healthy diet to an unhealthy one had no effect on headaches, scientists said.
As part of the study almost 400 people were randomly assigned either a low-fat diet rich in fruits, vegetables and low-fat dairy products or a typical Western diet as a control.
Participants ate food with almost nine of salt a day for a set period, reflecting average salt consumption in the USA.
Then this was reduced to six grams a day (the top level of the recommended daily salt allowance) for the same length of time, before they finally ate a low-salt diet of three grams a day during the final period.
They were asked to record side effects such as headache, bloating, dry mouth, excessive thirst, fatigue or low energy, light- headedness, nausea and change in taste in a questionnaire.
Scientists discovered halving salt intake from nine grams a day to three grams a day reduced headaches by 31 per cent.
Lawrence Appel, of John Hopkins University said: 'A reduced sodium intake was associated with a significantly lower risk of headache, while dietary patterns had no effect on the risk of headaches in adults.
'Reduced dietary sodium intake offers a novel approach to prevent headaches.'
FOODS HIGH IN SALT
Watch out for these foods, which are almost always high in salt because of the way that they are produced:
- Pasta sauces
- Tinned soups
- Sausages, ham, salami and smoked meats
- Soy sauce
- Sauces like ketchup and mayonnaise
- Gravy granules and stock cubes
Professor Graham MacGregor, of Queen Mary University, London and World Action on Salt and Health (WASH) - who was not involved in the study - said scientists do not fully understand why cutting salt reduces headaches, but they suspect it is because it lowers blood and pulse pressure.
He told MailOnline: 'We have long suspected that reducing salt intakes reduces the number of people developing headaches, and this study confirms our suspicions.
'Blood pressure drugs do reduce headaches, various studies and anecdotal evidence shows.
'Clearly reducing blood pressure and pulse pressure does lower headaches, even if blood pressure is already in the normal range.
He added: 'This is the first well-controlled trial that really demonstrates a very large reduction in headaches just from modest reductions in salt intake.
'We would strongly advocate that those people who have headaches reduce their salt intake as it may abolish their headaches as well as having the very important effect of lowering their blood pressure and thereby the risk of a stroke and or heart attack.'
Katharine Jenner, of Consensus Action on Salt and Health (CASH), who was also not involved in the study, added: 'Rather than just reaching for the medicine cabinet, we should be thinking about what is causing our ill health; it is often lifestyle and diet-related.
'If you can get less headaches and lower your blood pressure just by eating less salt, that's two less pills you will need to take.'