Heading to the supermarket is fraught with temptation for dieters, with aisles crammed full of forbidden treats.
But U.S scientists have found consumers who take cash to the shops and leave their debit cards at home are more likely to leave junk food on the shelves.
Reporting in the Journal of Consumer Research, the study authors wrote: 'Two factors contribute to this intriguing effect.
'First, there is a correlation between unhealthiness and impulsiveness of food items: Unhealthy food items also tend to elicit impulsive responses.
'Second, cash payments are psychologically more painful than card payments, and this pain of payment can curb the impulsive responses to buy unhealthy food items.'
The study could provide hope for shoppers keen to stick to a healthy eating regime.
The researchers from Cornell University and the University at Buffalo in the U.S analysed the shopping behaviour of 1,000 households.
They found that supermarket trolleys had a larger proportion of impulsive junk food items when the shopper was using credit or debit cards rather than cash.
In a follow-up study they found people could better regulate what they spent if they paid in cash because of a 'pain effect' that was not felt when putting the bill on a card.
Reporting in the Journal of Consumer Research, the authors wrote: 'The notion that mode of payment can curb impulsive purchase of unhealthy food products is substantially important.
'The epidemic increase in obesity suggests that regulating impulsive purchases...is a steep challenge for many consumers.'
They suggested that there may even be a connection between rising obesity levels in western countries and changing modes of payment.
In Britain, nearly a quarter of adults were classed as obese in 2008, while 32 per cent of women and 42 per cent of men were overweight.