No mainline train services will call at the central London station on January 25 and 26 or February 1 and 2.
Network Rail has said this is so that testing of in-cab signalling on the East Coast Main Line – a project expected to cost £1.4 billion – can take place.
It is hoped that the technology will allow for lineside signals to be replaced with signalling displayed inside drivers’ cabs from the end of 2025.
Six train operators are expected to be directly impacted by the closure.
LNER will operate a reduced service to Peterborough where rail replacement coaches will transfer passengers to Bedford, allowing them to use Thameslink services to London St Pancras.
A reduced service will also be provided by Grand Central between Sunderland and Peterborough, with coach connections to King’s Cross. There will be no services to and from Bradford.
Hull Trains will have two trains per day in each direction running to and from St Pancras rather than King’s Cross, and Lumo’s reduced service will involve a non-stop rail replacement coach between King’s Cross and Peterborough.
There will be no Thameslink or Great Northern services between London and Peterborough, Royston and Stevenage via Hertford North.
As a result, East Midlands Railway services to and from London St Pancras are expected to be extremely busy on both weekends.
Customers have been advised to use Thameslink services and interchange at Bedford for rail replacement services to Peterborough.
Engineering work will also take place on the East Coast Mainline during the closure.
This includes renewing the line north of Stevenage, investing in bridge timbers south of Finsbury Park and, at Welwyn Garden City, upgrading switch and crossing equipment which allows tracks to separate, cross and rejoin.
Tunnel drainage work will be undertaken at Hadley Wood, and there will be improvements to the overhead line equipment at Biggleswade and Bounds Green.
Simon Pumphrey, Network Rail infrastructure director, said: “The work our teams will be carrying out over both these weekends goes well beyond regular maintenance tasks.
“This work is carefully planned to maximise the time when there are track closures, allowing us to undertake several projects at once and avoiding more frequent track closures.
“We’re sorry to passengers affected by the disruption and thank them for their patience as we make improvements that will help make the railway more reliable.”