The second son of the Rev. John Thomson, D.D., by his first wife, Helen Forrest, he was born at Sanquhar, Dumfriesshire, where his father was minister, on 11 July 1779. Educated at the parish school of Markinch, Fife after his father had moved there, and at Edinburgh University which he left in 1800, he was licensed to preach by the presbytery of Kelso; but before receiving a clerical charge he was schoolmaster at Markinch. In 1802 he was appointed parish minister at Sprouston, Roxburghshire. In 1808 he was transferred to the East Church, Perth; in 1810 to New Greyfriars, Edinburgh; and in 1814, on the opening of the church, moved within the city to St. George's. There he remained until his death.
When the Edinburgh town council presented Thomson to Greyfriars, there was strong opposition; but he became one of the influential Edinburgh preachers. He promoted singing at his church, and an improved psalmody in Scottish church worship. He issued a new set of tunes, some of which he composed himself, "Redemption" and "St. George's, Edinburgh" being among them.
Thomson belonged to the evangelical section of the Church of Scotland, and was strongly opposed to the interference of the state in matters spiritual. For the last few years of his life he was a recognised leader of the evangelical party. In the General Assembly he identified himself with the reformers, and took part in the debates against pluralities in livings and the abuses of lay patronage. Like Thomas Chalmers, his ecclesiastical successor, he was interested in social questions, and founded in Edinburgh a weekday school, known as "Dr. Andrew Thomson's". He also took a prominent part in the agitation against slavery in the British colonies, advocating immediate and not gradual abolition. When a rumour alarm was spread that the French had landed, he gathered the Sprouston volunteers and marched into Kelso at their head.
In the Apocrypha controversy, Thomson assailed the British and Foreign Bible Society, in the pages of his Christian Instructor. In 1825 he resigned from the Society, and with supporters founded the Edinburgh Bible Society. He declined the offer of the degree of D.D. from Columbia College, New York, in 1818, but accepted the same honorary degree when Aberdeen University offered it in 1823.
He died suddenly in the street, when returning from a meeting of presbytery, to his home at 29 Melville Street in Edinburgh's West End, on 9 February 1831. Thomas Chalmers preached one of his funeral sermons, and he was buried the churchyard of St Cuthbert's Church, Edinburgh.
Thomson's major works were:A Catechism for the Instruction of Communicants, Edinburgh, 1808.
Lectures Expository and Practical, 2 vols. Edinburgh, 1816.
Lovers of Pleasure more than Lovers of God, Edinburgh, 1818; edited, with an introduction, by Robert Smith Candlish, Edinburgh, 1867.
Sermons on Infidelity, London, 1821.
A Collection in Prose and Verse for Use in Schools, Edinburgh, 1823.
Sermons on Hearing the Word, Edinburgh, 1825.
The Scripture History, Bristol, 1826.
Scripture History of the New Testament, London, 1827.
Sermons on various Subjects, Edinburgh, 1829.
Sermons and Sacramental Exhortations, Edinburgh, 1831.
The Doctrine of Universal Pardon, Edinburgh, 1830.
Thomson edited and wrote in the Edinburgh Christian Instructor, which he founded in 1810. He used its pages to make a prominent reply in 1829 to the United Secession Church minister Andrew Marshall in the early stages of the "voluntary crisis" on church establishment, which led to the disruption of 1843. The Instructor was edited after his death by Marcus Dods who was another major contributor.
Thomson contributed to David Brewster's Edinburgh Encyclopædia, of which he was part proprietor. The founding group around 1807 of the project comprised Brewster, Thomson, and some others on the "whig evangelical" wing of the Kirk that Thomson represented. He wrote 43 articles for the Encyclopædia.
In 1802 Thomson married Jane Carmichael, who survived him and had by him ten children; of those, seven survived their father. The eldest son was John Thomson (1805–1841) the composer.