The GNR was formed by the merging of the Direct Northern Railway and the London and York Railway. The latter was a combination of two abortive 1836 schemes to construct railways between London and York via Lincoln or Peterborough. It was first projected as the Cambridge and York Railway, being a line from the Eastern Counties Railway Company's station at Cambridge to York but later the promoters decided to bypass Cambridge and go directly to London, changing the name of the scheme to the London and York Railway. A bill was deposited in parliament for the 1846 session but was prevented from passing through the house of Lords after George Hudson (the "Railway King" and promoter of rival schemes) found errors in the London and York Railway's subscription contract. The Direct Northern Railway would have constructed a railway between London and York via Lincoln and Thorne, its bill was also deposited in 1846 and this too was thrown out. The two schemes were united under the resurrected name of the Great Northern (the name of one of the two 1836 schemes) and received Royal Assent on 26 June 1846 as the Great Northern Railway Act 1846.
The Act authorised the construction of the "Main Line" from Kings Cross to a junction with the Great North of England Railway at or near York Station, the "loop line" from Marham (near Peterborough) to Bawtry via Boston, Lincoln and Gainsborough and various branches. The loop was first to be opened on 17 October 1848 (Peterborough to Lincoln), with subsequent openings from 9 April 1849 (Lincoln to Gainsborough) and the northern part ending at Doncaster instead of Bawtry on 4 September 1849. The last date also saw the first opening of the Main Line from Doncaster to Retford and the entire line was opened at various dates being completed, between Kings Cross to just north of Doncaster where it met the North Eastern Railway, by 14 October 1852. It became the southern section of what is now known as the East Coast Main Line.
The GNR obtained various further acts of parliament which both extended its system and enabled it to absorb other railway and canal companies. On January 1923, the GNR became part of the London and North Eastern Railway Company by the North Eastern, Eastern and East Scottish Group Amalgamation Scheme 1922.