Kameny was born to Ashkenazi Jewish parents in New York City. He attended Richmond Hill High School and graduated in 1941. In 1941, at age 16, Kameny went to Queens College to learn physics and at age 17 he told his parents that he was an atheist. He was drafted into the United States Army before completion. He served in the Army throughout World War II in Europe, and later served 20 years on the Selective Service board. After leaving the Army, he returned to Queens College and graduated with a baccalaureate in physics in 1948. Kameny then enrolled at Harvard University; while a teaching fellow at Harvard, he refused to sign a loyalty oath without attaching qualifiers, and exhibited a skepticism against accepted orthodoxies. He graduated with both a master's degree (1949) and doctorate (1956) in astronomy. His doctoral thesis was entitled "A Photoelectric Study of Some RV Tauri and Yellow Semiregular Variables" and was written under the supervision of Cecilia Payne-Gaposchkin.