He was born in Monmouth County, New Jersey, the son of Judge Joseph and Mary (Mount) Cox. He was an officer in the American Revolutionary War at the Battles of Brandywine, Germantown and Monmouth, and was elected Brigadier General of the Monmouth Brigade after the war. He was a member of the New Jersey General Assembly from 1801 to 1807 and was its speaker from 1804.
He served as a Representative in the 11th United States Congress from 1809 until he died of a stroke on 12 September 1810 in Upper Freehold, New Jersey.
James Cox married Ann Potts (1757–1815), daughter of William and Amy (Borden) Potts, on 29 February 1776. They were the parents of thirteen children, including Ezekiel Taylor Cox, who was a member of the Ohio State Senate and father of United States Representative Samuel Sullivan Cox.