John Gray Foster (May 27, 1823 – September 2, 1874) was a career military officer in the United States Army and a Union general during the American Civil War whose most distinguished services were in North and South Carolina. A postbellum expert in underwater demolition, he wrote the definitive treatise on the subject in 1869.