The chancellor, Sajid Javid, has failed to rule out a Conservative alliance with Nigel Farage’s Brexit party at a general election.

He told the BBC that the Tories did not need an electoral alliance but did not categorically deny that they might need to work with Farage, whose party took close to half of the UK’s seats at the European elections in May.

Javid said: “We don’t need an electoral alliance with anyone. We can stand on our own two feet.” However, pushed three times during his interview on BBC One’s The Andrew Marr Show, he failed to rule out a specific deal being struck. Farage has said he is prepared not to stand candidates in Tory areas where he could end up splitting leave voters and told the Tories they will not win an election without his support.

The Conservatives currently have no majority in the Commons and there are concerns they may struggle to win a snap election despite polling showing a large lead over Labour.

Pressed by Marr, Javid replied: “The picture our opponents are painting of us … and of course they would paint a false picture … we are a proud centre-right, moderate, one nation party. There is nothing extremist about wanting to meet the will of the British people on a simple question, which was: do you want to leave the EU or not?”

Marr said: “I’m asking you one question, can you rule out an agreement with the Brexit party, yes or no?”

Javid said: “We’re not in an election yet. When we get there I’m clear we don’t need an alliance with anyone. I think our message will resonate across the country.”

Farage’s offer to help the Tories by standing aside in key leave seats is dependent on his party being allowed a clear shot in Labour heartlands. He believes this deal could enable the government to return a majority of more than 100.

Javid said an election was necessary because parliament was trying to “kneecap” the government’s Brexit negotiations. He denied the party was offering nothing to the 48% of voters who voted remain in 2016. He said the public liked “all the other things” they have been talking about such as “keeping the economy strong”.

With a general election looming, both parties have been scrambling to show they have something to offer both leavers and remainers.

The shadow foreign secretary, Emily Thornberry, found herself mocked last week after setting out Labour’s current stance, which is to negotiate a fresh Brexit deal with the EU27 before putting that to the public in a referendum. She and several other senior figures, including Keir Starmer, the shadow Brexit secretary, have said they would then campaign for remain in that vote.

The shadow chancellor, John McDonnell, appeared to signal a shift from that approach on Sunday, suggesting the leave option put to voters could essentially be the withdrawal agreement negotiated by Theresa May.

“I think it’s a matter of just confirming what the offer would be and we’ve said then it has to go back to the people again,” McDonnell said. He said that could incorporate some of the reassurances that were under discussion during the cross-party talks initiated by May – on environmental standards and workers’ rights, for example.

“I was in negotiations for six weeks with the Conservatives and there were a whole range of issues there that were addressed which, from the indications that we were getting from the European Union, there might be able to have some shift on.

“So you can have an offer consolidating that. That would then go back to the people,” he said, adding: “We believe the people should have the final decision.”

Labour is keen to hold open the prospect of winning votes from Brexit supporters in heartland seats but also faces intense pressure from its members and many of its MPs to become a full-throated remain party.