“I intend to resign after prime minister’s questions [on Wednesday], before the prime minister goes to the Palace, he said.
The chancellor – a staunch opponent of a no-deal Brexit – also vowed to help lead the Commons campaign to block it, from the backbenches, and predicted success.
“I am confident that parliament does have a way of preventing a no-deal exit on 31 without parliamentary consent,” he told the BBC’s Andrew Marr programme.
“I intend to work with others to ensure parliament uses its power to make sure the new government can’t do that,” Mr Hammond threatened.
Mr Johnson, the near-certain next prime minister, has vowed a “do or die Brexit” on Halloween – without an agreement if the EU refuses to budge on the Irish backstop.
It was already certain that Mr Hammond, who has been in N0 11 for three years, would leave the government if the frontrunner wins the race when the result is declared on Tuesday.
Asked if he thought he would be sacked, he replied: “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 31 October, 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.”
The move comes after David Gauke, the justice Secretary David Gauke – another no-deal opponent – revealed he would also quit on Wednesday if Mr Johnson reaches Downing Street.
Mr Gauke said: “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.”
Mr Hammond has previously hinted he would join a vote-of-no-confidence to topple Mr Johnson if necessary, but told the programme: “I don’t think it will get to that.”
He added: “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.”