Sedgwick was born in the Litchfield Hills town of Cornwall, Connecticut. He was named after his grandfather, John Sedgwick (brother of Theodore Sedgwick), an American Revolutionary War general who served with George Washington. He attended Sharon Academy for 2 years and Cheshire Academy in 1830–31. After teaching for two years, he attended the United States Military Academy, graduated in 1837 ranked 24th of 50, and was commissioned a second lieutenant in the U.S. Army's artillery branch. He fought in the Seminole Wars and received two brevet promotions in the Mexican–American War, to captain for Contreras and Churubusco, and to major for Chapultepec. After returning from Mexico he transferred to the cavalry and served in Kansas, in the Utah War, and in the Indian Wars, participating in 1857 in a punitive expedition against the Cheyenne.