The constitutional amendment would have required printouts of cast ballots at polling sites, a change Bolsonaro argues is necessary to prevent voter fraud.
The amendment needed 308 votes to pass the Chamber of Deputies, but received only 229 when the measure was taken up late Tuesday. There were 218 votes against and one abstention, according to a statement from the chamber.
Hours earlier, a military convoy with dozens of vehicles had driven past the presidential palace and Congress, which observers interpreted as an intimidation attempt by Bolsonaro ahead of his looming defeat in the vote.
The electoral system in Brazil – Latin America's most populous country at 210 million people – is entirely electronic.
Bolsonaro demanded the vote also be recorded on paper, otherwise he may not recognize the result of next year's presidential election.
Since the 2018 presidential election, Bolsonaro has repeatedly sown doubt about the reliability of the electoral system. Like former U.S. President Donald Trump, he makes allegations of votes being manipulated, although there is little evidence to support the claims.