Charles Babbage invented, but did not build, an ‘Anylitical Engine’ which was mechanical programmable computer in the 19th century. Subsequently it has been proved to be workable.
An abacus is a kind of computer which predates most of western history.
The decoding specialist at Bletchley Park created an electronic computer (Called variously a ‘bomb’ or ‘bombs’ which was also programable. perhaps mainly through the genius of Alan Turing.
Commercially, perhaps ENIAC is recognised as the first electronic computer.