Johnson had earlier sacked Northern Ireland secretary Julian Smith, a surprising move given Smith's role in restoring the power-sharing government to Belfast last month after a three-year suspension.
Meanwhile Liz Truss, the MP for South West Norfolk who had been tipped for a demotion, kept her job as secretary of state for global trade. Witham MP Priti Patel also remains as home secretary.
Javid's resignation follows reports he had clashed with Johnson's powerful adviser, Dominic Cummings.
In his resignation letter, Mr Javid said: "I believe it is important as leaders to have trusted teams that reflect the character and integrity that you would wish to be associated with".
This is now being replaced with an integrated Number 10-Treasury team of advisers at the top of that structure.
In August Mr Cummings fired Mr Javid's aide Sonia Khan and it appears Number 10 wanted to go further in keeping a closer eye on the chancellor.
"He has turned down the job of chancellor of the exchequer", a source close to Mr Javid said.
Johnson's spokesman said a new economic team of special political aides had been formed to jointly advise both the prime minister and the chancellor.
"The chancellor said no self-respecting minister would accept those terms".
Lambert said it's unlikely there will be much pushback from Sunak on decisions coming from the prime minister's office.
The upheaval at Number 11 - less than a month before Javid was due to deliver his first budget - would normally be expected to rattle financial markets.
- Andrea Leadsom was sacked as business secretary.
Paul Dales, chief United Kingdom economist at Capital Economics, said: 'The unexpected resignation of Sajid Javid and the promotion of Rishi Sunak could mean that fiscal policy will provide an even bigger boost to GDP growth over the next few years than we already expected.
The government said Thursday that Alok Sharma, previously in charge of worldwide development, would become business secretary and also take charge of COP26.
George Eustice was promoted to environment secretary from his previous role in the same department.
Former Brexit minister Suella Braverman returns to the Government as Attorney General.
But investors piled into sterling in the hope Sunak - chief secretary to the Treasury and an ally of Number Ten - will deliver a more radical budget to kick-start the economy.
Foreign Secretary Dominic Raab, Johnson's de facto deputy Michael Gove and several other key ministers stayed in the post - and Javid was widely assumed to be safe.