Upon returning to England in 1779, Marsden wrote his History of Sumatra (1783). In 1795, he was appointed second secretary to the admiralty, later rising to the position of first secretary with a salary of £4,000 per annum. He retired in 1807 with a lifetime pension of £1,500 per annum which he subsequently relinquished in 1831. In 1812, he published Grammar and Dictionary of the Malay Language. This was followed by a translation of the Travels of Marco Polo in 1818.
Marsden was a member of many learned societies, and treasurer and vice-president of the Royal Society. In 1834 he presented his collection of oriental coins to the British Museum and his library of books and Oriental manuscripts to King's College London. His other works are Catalogue of Dictionaries, Vocabularies, Grammars and Alphabets (1796), Numismata orientalia (London, 1823-1825), and several papers on Eastern topics in the Philosophical Transactions and the Archaelogia.
He married Elizabeth, the daughter of his friend Sir Charles Wilkins FRS but there was no issue to this marriage. On 6 October 1836 he died as the result of an apoplexy attack and was buried at Kensal Green Cemetery. He left his estate to his kinsman Rev. Canon John Howard Marsden. Elizabeth subsequently married Colonel William Leake FRS on 17 September 1838.