He was the son of Robert Cox, leather-dresser, of Gorgie Mills, near Edinburgh, and of Anne Combe, sister of George Combe and Andrew Combe. He was born at Gorgie on 25 Feb. 1810, and received his early education at a private school and at Edinburgh High School. Besides attending the classes of law and of general science at the University of Edinburgh, he also studied anatomy under Robert Knox.
For some years Cox was in the legal office of his uncle, George Combe, who wished him to become a partner in the business; but Cox declined. He passed as a writer to the signet, but limited his practice, and occupied himself mainly with scientific and literary matters. At about the age of twenty-five he accepted the secretaryship of a literary institution in Liverpool, the Philosophical Literary and Commercial Institution or Literary, Scientitic, and Commercial Institution, but resigned it in 1839 from considerations of health, and returned to Edinburgh.
The attention of Cox was first directed to the Sabbath question by the actions of the Edinburgh and Glasgow Railway Company, in withdrawing a limited passenger service in connection with their Sunday trains. Becoming a shareholder, he attended two half-yearly meetings of the company in 1850, at each of which he moved that to the Sunday trains which were being regularly run passenger carriages should be attached.
Cox took an active part in the Right of Way Association, and was one of the parties to the action against George Murray, 6th Duke of Atholl, by which Glen Tilt was reopened to the public. A Liberal in politics, he interested himself in social and philanthropic movements of a non-sectarian kind in Edinburgh. He was in practice the manager of the Phrenological Museum, a director and strong supporter of the United Industrial School, a director of the School of Arts, and an active promoter of university endowment and of schemes connected with the higher education of the country. He was a patron of art, and a member of the Edinburgh Association for Promotion of the Fine Arts.
Cox died, unmarried, on 3 February 1872. He is buried with his sister, Marion Cox (1803-1850) in Dean Cemetery in western Edinburgh. The grave lies on the north wall of the original cemetery, close to the grave of his maternal uncle, George Combe. The low-relief bronze head on the grave is sculpted by William Brodie.
Cox was the active editor of George Combe's Phrenological Journal from Nos. XXXIV to L. of the first series, to which he also contributed articles. After his return to Edinburgh he was induced by Messrs. Black to undertake the compilation of the index to the seventh edition of the Encyclopædia Britannica. In 1841 he also resumed the editorship of the Phrenological Journal; it ceased in 1847, on the death of Andrew Combe, of whom he contributed a memoir to the last number.
Cox's speeches on the sabbatarian question appeared as a pamphlet, A Plea for Sunday Trains; it was afterwards expanded to 560 pages, published in 1853 as Sabbath Laws and Sabbath Duties; considered in relation to their Natural and Scriptural Grounds, and to the Principles of Religious Liberty. He went on to publish in 1865 the erudite and lucid The Literature of the Sabbath Question, in two volumes. In 1860 he published The Whole Doctrine of Calvin about the Sabbath and the Lord's Day, extracted from his Commentaries, and in 1863 What is Sabbath Breaking? a Discussion occasioned by the Proposal to open the Botanical Gardens of Edinburgh on Sunday Afternoons. He also contributed most of the article "Sabbath" to Chambers's Encyclopædia.
Cox assisted his brothers Dr. Abram Cox of Kingston and Sir James Cox or Coxe, one of her majesty's Commissioners in Lunacy for Scotland, in the revision of Andrew Combe's popular physiological works, and those of George Combe's books dealing with the brain and nervous system. In 1869 he edited, along with James Nicol of Aberdeen, the Select Writings of Charles Maclaren, editor of The Scotsman. 
- Henderson 1887.
- The Phrenological Journal and Miscellany. John Anderson. 1837. p. 510. Retrieved 10 April 2012.
- The Phrenological Journal, and Magazine of Moral Science. MacLachlan, Stewart, and Co. 1838. p. 338. Retrieved 10 April 2012.
- Edinburgh and Leith Post Office Directory 1871-72
This article incorporates text from a publication now in the public domain: Henderson, Thomas Finlayson (1887). "Cox, Robert". In Stephen, Leslie (ed.). Dictionary of National Biography. Vol. 12. London: Smith, Elder & Co. pp. 416–417.