Anderson was born at Long Hermiston, Midlothian, and educated at Ratho School and Edinburgh University. At the age of fifteen, after the death of his parents, he took over the working of the farm, which his family had occupied for several generations.
In 1768 Anderson married Margaret Seton (died 1788), and took over the management of a farm in Aberdeenshire of 1300 acres (5.3 km²). They had thirteen children. One daughter, Margaret (1778–1863), married Benjamin Outram.
Some historians believe Anderson was the root source for Marx's critique of capitalist agriculture. In 1777 Anderson published An Enquiry into the Nature of the Corn Laws in which he introduced what was to become the Malthusian/Ricardian theory of rent. In Marx's view, Anderson's original model was far superior to the variant later offered by the classical economists Thomas Malthus and David Ricardo since it placed strong emphasis on the possibility of continuing agricultural improvement.
Rent, Anderson argued, was a charge for the use of the more fertile soil. The least fertile soils in cultivation generated an income that simply covered the costs of production, while the more fertile soils received a "certain premium for an exclusive privilege to cultivate them; which will be greater or smaller according to the more or less fertility of the soil. It is this premium which constitutes what we now call rent; a medium by means of which the expence (sic) of cultivating soils of very different degrees of fertility may be reduced to a perfect quality." For Malthus and Ricardo this differential rent was sourced in the natural productivity of the soil apart from human influence. Anderson, however, insisted that continual improvement of the soil was possible and that the productivity of the least fertile soil could rise to a point that brought it much closer to that of the most fertile land; but also that the converse was true and humans could degrade the soil. Where fertility problems arise in agriculture, for Anderson this was a consequence of the failure to adopt rational and sustainable agricultural practices. He argued that since the land in England was farmed by capitalist farmers, this posed obstacles to rational agriculture, since the farmer tended to avoid all improvements, the full return for which would not be received for the duration of the lease.
Marx's critique of capitalist agriculture drew upon Anderson's analysis and he insisted that soil fertility was a historical issue, and that fertility could both improve or decline. The irrationality of capitalist agriculture, he argued, was bound up with the whole antagonism of town and country out of which bourgeois society had arisen.
In 1783 he settled in Edinburgh. In 1791 he started a weekly publication called The Bee, which was largely written by himself, and of which 18 volumes were published. In 1797 he began to reside at Isleworth, and from 1799 to 1802 he produced a monthly publication, Recreations in Agriculture, Natural History, Arts and Miscellaneous Literature. He was also the author of many pamphlets on agricultural and economical topics, under numerous aliases, including Agricola, Germanicus, and Timothy Hairbrain. One of his first publications was A Practical Treatise on Chimneys (1776). He was a friend of Jeremy Bentham, and involved in the latter's idea of an ideal prison or Panopticon. Anderson also corresponded with George Washington.
The engineer James Green, responsible for the building of some of the first canalboat lifts, credited their invention to Dr James Anderson.
The Scotch plough or Scots plough (not to be confused with the Scottish hand plough) was a wood and iron, animal draft, primary tillage implement (plough) for use on heavy ground invented in the 19th century by James Anderson.
In 1780 Anderson received an LLD (honorary doctorate in law) from Aberdeen University. He died in West Ham, Essex on 15 October 1808.