Not all of the Armed Services keep easily accessible records of their retired officers. The Marine Corps has online biographies for 400 retired generals (of all ranks). According to the Department of Defense, the Marine Corps has 82 generals on active duty. The Air Force keeps a partial list of online biographies, which includes 86 retired generals. There are 13 active-duty generals in the Air Force.
The Explainer used the ratios above to estimate the number of retired generals in the other military branches. The Army—which currently has 312 generals—should have between 1,100 and 2,200 retired generals. According to the Army's press office, the number is about 1,700.
By the same logic, there are probably between 750 and 1,500 retired admirals in the Navy and between 1,000 and 2,000 retired generals (of all ranks) in the Air Force. In total, then, you might expect somewhere between 3,100 and 6,300 retired generals and admirals.