He was the son of Dr. James Boyd, born at Auchinleck Manse, Ayrshire, on 3 November 1825. After receiving his elementary education at Ayr, he studied at King's College School and the Middle Temple, London, with thoughts, apparently, of being an English barrister. "I am the only kirk minister," he once said, "who is a member of the Middle Temple." Returning to the university of Glasgow, he qualified for the ministry of the national church, gaining high distinction in philosophy and theology, and securing several prizes for English essays. He graduated B.A. at Glasgow in April 1846, and at the end of 1850 was licensed as a preacher by the presbytery of Ayr.
For several months Boyd was assistant in St. George's parish, Edinburgh, and on 18 September 1851 he was ordained parish minister of Newton-on-Ayr, where he succeeded John Caird. In 1854, he became minister of Kirkpatrick-Irongray, near Dumfries. Here he remained five years, maturing his pulpit style, and, writing under his initials of "A. K. H. B.," steadily gaining reputation in Fraser's Magazine with his Recreations of a Country Parson. Both as a parish minister and as a literary man he attracted attention, and was sought after for vacant charges.
In April 1859, Boyd was appointed to the parish of St. Bernard's, Edinburgh, and found the presbytery much exercised on the question of decorous church service, raised by the practice and advocacy of Dr. Robert Lee. Boyd seems to have intervened little in the controversy, but he sympathised with the desire for a devout and graceful form of worship, and he was afterwards a prominent member of the Churcli Service Society. In 1864 the university of Edinburgh conferred on him the honorary degree of D.D.
In 1865, Boyd succeeded Dr. Park as minister of the first charge, St. Andrews, finding in the post the goal of his ecclesiastical ambition. "Never once, for one moment," he said, "have I wished to go elsewhere." Boyd at St. Andrews was probably better known beyond Scotland than any other presbyterian divine of his day. He had friends among the leaders of the English clergy and men of letters, and his writings were widely read in America.
Soon after settling in St. Andrews Boyd urged the question of an improved ritual in the services of the national church, and in 1866, on the initiative of his presbytery, a committee was appointed by the general assembly to prepare a collection of hymns.
The hymnal compiled by the committee, with Boyd as convener, was published in 1870, and enlarged in 1884. This work made Boyd prominent, and St. Andrews University conferred on him the degree of LL.D. in April 1889.
In May 1890, he was appointed moderator of the general assembly.
He performed his duties assiduously and well, and, as was said at the time, "with archiepiscopal dignity." His closing address was published as Church Life in Scotland: Retrospect and Prospect (Edinburgh, 1890). One of his last public services was the reopening, on 11 July 1894, of the renovated church of St. Cuthbert's, Edinburgh — one of the oldest ecclesiastical edifices in Scotland — his address on the occasion being adequately archaiological, and graced with a fine literary flavour. Early in 1895, he was seriously ill, but recovered, only to lose the devoted wife who had nursed him back to health. In the winter of 1898–1899, he had a recurrence of ill-health and went to Bournemouth to recruit. Here he resumed work on sermons and essays, but in the evening of 1 March 1899 he died of misadventure, having taken carbolic lotion (a 1-in-40-parts mixture of carbolic acid in water) in mistake for a sleeping-draught.
He was interred in the Eastern Cemetery of St Andrews (south of the cathedral), against the south wall, with his first wife.
Boyd married, in 1854, Margaret Buchanan, eldest daughter of Captain Kirk (71st regiment) of Carrickfergus, Ireland. She predeceased him in 1895.
In 1897, he married, for the second time, Janet Balfour, daughter of Mr. Leslie Meldrum, Devon, Clackmannan, She survived him, with five sons and one daughter of his first wife's family.
Clear, precise, and definite in his habits, Boyd, both professionally and socially, was entirely unconventional and independent. A close and shrewd observer, with quick grasp of character and a humorous sense tinged with cynicism, he was always fresh and attractive — and not seldom brilliant — as preacher, writer, or conversationalist. His sermons were literary and practical rather than dogmatic; his essays, although often commonplace in thought and expression, caught the attention by their common sense, their easy allusiveness, and transparency of style; and his brisk unflagging talk was enriched with endless and apposite anecdotes, although it was not devoid of a certain overbearing element. "I came to the conclusion," says Sir Edward Russell, "that he was almost, if not quite, the greatest raconteur I had ever known" (That Reminds Me, p. 135).
His best books resemble his conversation, and his autobiographical reminiscences are exceptionally realistic and outspoken.
An excerpt from Recreations of a Country Parson, selected and introduced by Paul Collins, appears in the boxed literary magazine Dancing Star, vol 26 (2002) as a 12-page standalone booklet titled "Early Morning at the Station".