There is no easy answer to this question due to the many different classifications of computers. The first mechanical computer, created by Charles Babbage in 1822, doesn’t really resemble what most would consider a computer today.
The first digital computer :
Short for Atanasoff-Berry Computer, the ABC began development by Professor John Vincent Atanasoff and graduate student Cliff Berry in 1937. Its development continued until 1942 at the Iowa State College (now Iowa State University).
The ABC was an electrical computer that used vacuum tubes for digital computation, including binary math and Boolean logic and had no CPU. On October 19, 1973, the US Federal Judge Earl R. Larson signed his decision that the ENIAC patent by J. Presper Eckert and John Mauchly was invalid and named Atanasoff the inventor of the electronic digital computer.
The ENIAC was invented by J. Presper Eckertand John Mauchly at the University of Pennsylvania and began construction in 1943and was not completed until 1946. It occupied about 1,800 square feet and used about 18,000 vacuum tubes, weighing almost 50 tons. Although the Judge ruled that the ABC computer was the first digital computer, many still consider the ENIAC to be the first digital computer because it was fully functional