Image copyright Getty Images Image caption Jeremy Corbyn targeted younger voters

Why did Theresa May lose her overall majority in the general election earlier this year?

There were lots of contributory factors, of course, but here is one that so far has been comparatively ignored - the rush of hundreds of thousands of young voters who used the government's online system to join the electoral register after the election was called.

They were probably enough to tilt the balance and deny Mrs May an effective Commons majority.

According to a new BBC analysis and data obtained under freedom of information, it is highly likely that without these additional voters the Conservatives would have won six seats which they lost narrowly, by under 200 votes - Kensington, Perth & North Perthshire, Dudley North, Newcastle-under-Lyme, Crewe & Nantwich, and Canterbury. The SNP took Perth & North Perthshire, while Labour squeezed home in the other five.

In two further seats held by Labour, Barrow & Furness and Keighley, it's reasonably likely the Tories would have won too. And depending on some assumptions used in the calculation, it's plausible they could have won another four or five seats - Lanark and Hamilton East (which the SNP held), Ashfield, Bishop Auckland, and possibly Peterborough and Stroud (which were Labour victories).

In the election the Conservatives won 317 seats, nine short of the target for a guaranteed overall majority. However given the seven Sinn Fein MPs who were elected do not take up their seats in the Commons, the Tories would have an effective majority if they had won just another five seats.

Image copyright Getty Images Image caption Theresa May saw her majority wiped out

After Theresa May announced on 18 April that there would be a snap general election, there were 2,834,000 online applications to join the electoral register made via the central "Register to vote" website.

Government data shows that 71% of these were made by voters under 35, with 1,051,000 aged 18 to 24 and 973,000 aged 25 to 34. Given that younger voters were much more likely to vote Labour or (in Scotland) SNP rather than back the Conservatives, this influx of young voters could well have swung the overall result.

Of course we can't be sure how (or indeed if) they actually voted. But we do know they were preponderantly young, and all the polling data shows that age was a major factor affecting voting patterns, with Conservative support mainly concentrated in the older age brackets.

The Cabinet Office has recently released data on the number of online applications for each council area during the election period, in response to a BBC freedom of information request. This enables us to check on the impact in individual constituencies.

The BBC analysis uses polling research from the British Election Study and Ipsos MORI on how different age groups voted, in order to estimate how these extra voters would have cast their ballot in each seat.

Image copyright Gov.uk Image caption The register to vote site has been live since 2014

However, assessing the full impact is uncertain because a substantial proportion of the online applications were actually duplicates. Some people who weren't sure they were on the electoral roll tried to register again to be on the safe side. The number will also include individuals who in fact were just changing address or asking for a postal vote, rather than adding themselves to the register.

According to an Electoral Commission report, council returning officers have put the number of duplicates at between 30% and 70%. The Commission told that me that its staff think around 40% is a reasonable approximation for the national level.

Taking a cautious approach, we would use the highest estimate for duplicates of around 70%. Then the analysis suggests that without the extra voters the Conservatives would have additionally won the six to eight most marginal seats. Being less cautious and using the Electoral Commission's suggested national approximation indicates an even higher figure, of 11 to 13 extra seats for the Tories.

The central online system for individuals to register was set up in 2014. Applications made via the website are passed on to local councils for checking and adding to the electoral roll. This has made it much easier for people missing from the register to add themselves later.

During the election Labour and some campaign organisations ran major drives to boost voter registration, particularly aimed at students and other young voters.