School meals might be becoming healthier, but there are warnings from nutritionists that too many pupils are still buying junk food in local shops.
A study in two secondary schools found that 41% of pupils did not ever use the school canteen - and only 6% chose the hot lunch option.
In contrast, 80% of pupils bought food from local shops.
The study of eating habits was carried out by the Nutrition Policy Unit of London Metropolitan University.
In the wake of the warnings by chef Jamie Oliver, there have been efforts to provide healthier food in school canteens in England.
But researchers have found that many pupils are ignoring these nutritionally-balanced offerings and are preferring to spend their money in local corner shops and take-aways.
The study of two large comprehensive schools found that pupils were either buying food on the way to school or, where they were allowed, going out during lunchtime to buy snacks such as crisps, sweets, chocolates and chips.
This was not simply about children preferring junk food, say the researchers.
An important factor was a lack of convenience in eating in school canteens - which could be overcrowded, uncomfortable and likely to take up too much of pupils' free time, say the researchers.
The study found that local shops were more entrepreneurial about meeting this demand - offering cut-price child-size portions and getting in extra staff so that children could be served quickly.
But this meant that rather than eating the healthy options in the school canteen pupils were more likely to be eating the type of junk food, both hot and cold, which would have too much fat, sugar and salt.
A £1 portion of chicken and chips, of the type sold near to school, had more than half the fat intake for a child for a whole day. A single serving of a popular cold drink had more sugar than a teenage girls should have in an entire day.