Hill was born on July 12, 1821 at Hill's Iron Works in York County, South Carolina. He was the son of Solomon and Nancy Hill. His grandfather, William Hill, a native of Ireland, built an iron foundry that made cannon for the Continental Army during the American Revolutionary War. He was also a Revolutionary War soldier. Hill was educated locally and in 1838 accepted an appointment to the United States Military Academy at West Point. He was in the same class as James Longstreet, William Rosecrans, John Pope, and George Sykes. He graduated four years later ranked 28th in a class of 56. He was given a commission in the 1st US Artillery.