John Michael O'Connor was born in 1790 in Philadelphia, Pennsylvania, the son of Hugh and Margaret O'Connor (d. 1812). He entered the army as a first lieutenant in 1812, serving in the 3rd New York Artillery, and was cited for gallantry at the Battle of Chippawa in 1814, and brevetted major, assistant adjutant general, in the same year. While serving under Major General George Izard, he obtained a transfer order without Izard's consent, precipitating a long-standing feud between the two men. Izard brought O'Connor before a court martial, and O'Connor received a two-month suspension and loss of his brevet, but he was honorably discharged in June 1815, and promoted to captain, 4th Infantry, during his reinstatement in January 1816.
In the postwar army, O'Connor translated Gay de Vernon's Treatise on the Science of War and Fortifications, which was used as a textbook at West Point beginning in 1818 and for many years afterward. During this process, he spent two years in France at the École Polytechnique near Paris and the military school at Metz. Discouraged by the failure of his application for further study in France, and by chronic illness, he left the army in 1821, and began trading securities. He also became involved in the unsuccessful 1824 presidential campaign of William H. Crawford. He died of illness on February 25, 1826, at the age of 36.