Nobody, invented, the computer alone. It came together over more than a century, built piece by piece by different people solving different problems. Calling out one name flattens a story that actually involves mathematicians, engineers, and hobbyists working decades apart, often without knowing about each other's work.
The early groundwork
Charles Babbage designed the Analytical Engine in the 1830s. It never got built in his lifetime, but the design had the core parts of a modern computer: a way to store numbers, a way to process them, and a way to control the sequence of operations. Ada Lovelace worked alongside him and wrote what's now recognized as the first computer program, meant to run on a machine that didn't exist yet. She also wrote notes suggesting machines like this could eventually manipulate more than just numbers, which turned out to be a fairly big prediction.
That idea sat mostly dormant for a century. The materials and engineering needed to build something like Babbage's design weren't there yet.
The 1930s and 40s push
Things moved fast once electronics caught up. Alan Turing wrote a 1936 paper describing a theoretical machine that could compute anything computable, given the right instructions. This became the mathematical basis for what a computer actually is, separate from what it's made of.
Then came the machines themselves. Konrad Zuse built the Z3 in Germany in 1941, one of the first programmable computers. In Britain, Tommy Flowers built Colossus in 1943 to break German codes. In the US, the ENIAC, completed in 1945 by John Mauchly and J. Presper Eckert, was the first general-purpose electronic computer, though it took a room full of vacuum tubes and a team of women programmers to actually run it.
John von Neumann then wrote up an architecture in 1945 describing how a computer should store both its instructions and its data in the same memory. Nearly every computer built since, including the one you're reading this on, follows that basic layout.
After the war
The transistor, invented at Bell Labs in 1947 by John Bardeen, Walter Brattain, and William Shockley, replaced the bulky vacuum tube and made computers smaller and more reliable. Later, Jack Kilby and Robert Noyce separately figured out how to put multiple transistors on a single chip, which led to the integrated circuit and eventually the microprocessor.
From there it's a long relay race: Steve Wozniak and Steve Jobs built the Apple II for regular people to use at home. IBM brought the PC into offices. Software people like Grace Hopper, who built the first compiler, made it possible to write programs in something closer to English instead of raw machine code.
Why the question doesn't have a clean answer
Each person above solved a piece of the puzzle their predecessors hadn't. Babbage designed it, Turing defined what "computing" even meant, Zuse and the ENIAC team built working machines, von Neumann figured out how to organize memory, and Bardeen, Brattain, Shockley, Kilby, and Noyce made the hardware small enough to matter. Pick any one of them as "the inventor" and you're ignoring the ones whose work made theirs possible.

