Hammond said he would quit after Theresa May’s final prime minister’s questions on Wednesday, before she goes to see the Queen and recommend that the winner of the Tory leadership race takes over as PM.
Johnson has committed to taking Britain out of the EU “do or die” by the October 31 Brexit deadline including if it means leaving without a deal, which Hammond has repeatedly opposed.
Asked on BBC One’s Andrew Marr Show if he thought he would be sacked, Hammond said: “No, I’m sure I’m not going to be sacked because I’m going to resign before we get to that point.
“Assuming that Boris Johnson becomes the next prime minister, I understand that his conditions for serving in his government would include accepting a no-deal exit on the October 31 and it’s not something that I could ever sign up to.
“It’s very important that the prime minister is able to have a chancellor who is closely aligned with him in terms of policy and I therefore intend to resign to Theresa May before she goes to the palace to tender her own resignation on Wednesday.”
It comes after Justice Secretary David Gauke also confirmed he would quit the cabinet on Wednesday if Johnson is about to take office.
He told the Sunday Times: “Given that I’ve been in the cabinet since Theresa May came to power, I think the appropriate thing is for me to resign to her.”
The pair were among the four cabinet ministers who rebelled on Thursday to back measures to block Johnson from suspending parliament to force through a no-deal Brexit on Halloween.
They are expected to be leading figures in the so-called “Gaukeward squad” of Tory former ministers aimed at stopping a no-deal Brexit from the backbenches.
Hammond has even suggested he could take the radical step of voting to bring down his own government in a confidence vote to stop no deal.
Defence Minister Tobias Ellwood meanwhile sidestepped questions about whether he could serve in a Johnson government.
“I really get frustrated with this energy towards no-deal. I know all my parliamentary colleagues on all sides of the House recognise the dangers of no-deal,” he told Sky’s Sophy Ridge on Sunday.
“The fact that we keep talking about it - it isn’t a solution.”
Pressed again, he said: “I want us to move away from discussion about no-deal at all. I believe a deal is absolutely possible. The fact that we keep talking about no-deal fuels the small caucus of people that see that as their destination.”
Hammond meanwhile said he was confident that MPs would find a way to block a no-deal Brexit without having to vote to bring down the government.
MPs in Johnson’s camp have been questioning whether anti-no deal in forces can find a mechanism to block no deal, or have the numbers to back a vote of no confidence in the government.
Asked whether he would back a vote of no confidence to stop no deal, Hammond said: “I don’t think it will get to that and, while many clever people have been scratching their heads, parliamentary process is extraordinarily complex and sometimes arcane.
“I am confident that parliament does have a way of preventing a no-deal exit on October 31 without parliamentary consent and I intend to work with others to ensure parliament uses its power to make sure that the new government can’t do that.
“The point of that is not to inflict some defeat on the new government, it is to ensure that the new government focuses then on trying to achieve a sensible, negotiated settlement with the EU that protects our economy and allows us all to get on with our lives.”
It came after Shadow Brexit Secretary Sir Keir Starmer told the Observer he would work with Tory ministers who quit to stop no deal.