Marvell was born in Winestead-in-Holderness, East Riding of Yorkshire, near the city of Kingston upon Hull, the son of a Church of England clergyman also named Andrew Marvell. The family moved to Hull when his father was appointed Lecturer at Holy Trinity Church there, and Marvell was educated at Hull Grammar School. A secondary school in the city, the Andrew Marvell Business and Enterprise College, is now named after him.
At the age of 13, Marvell attended Trinity College, Cambridge and eventually received a BA degree. A portrait of Marvell attributed to Godfrey Kneller hangs in Trinity College's collection.
Afterwards, from the middle of 1642 onwards, Marvell probably travelled in continental Europe. He may well have served as a tutor for an aristocrat on the Grand Tour, but the facts are not clear on this point. While England was embroiled in the civil war, Marvell seems to have remained on the continent until 1647. In Rome in 1645 he probably met the Villiers brothers, Lord Francis and the 2nd Duke of Buckingham, as well as Richard Flecknoe, about whom he would later on write a satirical poem. It is not known exactly where his travels took him except that Milton later reported that Marvell had mastered four languages, including French, Italian and Spanish.
Marvell's first poems, which were written in Latin and Greek and published when he was still at Cambridge, lamented a visitation of the plague and celebrated the birth of a child to King Charles I and Queen Henrietta Maria. He only belatedly became sympathetic to the successive regimes during the Interregnum after Charles I's execution on 30 January 1649. His "Horatian Ode", a political poem dated to early 1650, responds with lament to the regicide even as it praises Oliver Cromwell's return from Ireland.
Circa 1650–52, Marvell served as tutor to the daughter of the Lord General Thomas Fairfax, who had recently relinquished command of the Parliamentary army to Cromwell. He lived during that time at Nun Appleton Hall, near York, where he continued to write poetry. One poem, "Upon Appleton House, To My Lord Fairfax", uses a description of the estate as a way of exploring Fairfax's and Marvell's own situation in a time of war and political change. Probably the best-known poem he wrote at this time is "To His Coy Mistress".
During the period of increasing tensions leading up to the First Anglo-Dutch War of 1653, Marvell wrote the satirical "Character of Holland," repeating the then current stereotype of the Dutch as "drunken and profane": "This indigested vomit of the Sea,/ Fell to the Dutch by Just Propriety."
He became a tutor to Cromwell’s ward, William Dutton, in 1653, and moved to live with his pupil at the house of John Oxenbridge in Eton. Oxenbridge had made two trips to Bermuda, and it is thought that this inspired Marvell to write his poem Bermudas. He also wrote several poems in praise of Cromwell, who was by this time Lord Protector of England. In 1656 Marvell and Dutton travelled to France, to visit the Protestant Academy of Saumur.
In 1657, Marvell joined Milton, who by that time had lost his sight, in service as Latin secretary to Cromwell's Council of State at a salary of £200 a year, which represented financial security at that time. Oliver Cromwell died in 1658. He was succeeded as Lord Protector by his son Richard. In 1659 Marvell was elected Member of Parliament for Kingston-upon-Hull in the Third Protectorate Parliament. He was paid a rate of 6 shillings, 8 pence per day during sittings of parliament, a financial support derived from the contributions of his constituency. He was re-elected MP for Hull in 1660 for the Convention Parliament.
The monarchy was restored to Charles II in 1660. Marvell avoided punishment for his own co-operation with republicanism, and he helped convince the government of Charles II not to execute John Milton for his antimonarchical writings and revolutionary activities. The closeness of the relationship between the two former colleagues is indicated by the fact that Marvell contributed an eloquent prefatory poem, entitled "On Mr. Milton's Paradise Lost", to the second edition of Milton's epic Paradise Lost. According to a biographer: "Skilled in the arts of self-preservation, he was not a toady."
In 1661 Marvell was re-elected MP for Hull in the Cavalier Parliament. He eventually came to write several long and bitterly satirical verses against the corruption of the court. Although circulated in manuscript form, some finding anonymous publication in print, they were too politically sensitive and thus dangerous to be published under his name until well after his death. Marvell took up opposition to the 'court party', and satirised them anonymously. In his longest verse satire, Last Instructions to a Painter, written in 1667, Marvell responded to the political corruption that had contributed to English failures during the Second Anglo-Dutch War. The poem did not find print publication until after the Revolution of 1688–9. The poem instructs an imaginary painter how to picture the state without a proper navy to defend them, led by men without intelligence or courage, a corrupt and dissolute court, and dishonest officials. Of another such satire, Samuel Pepys, himself a government official, commented in his diary, "Here I met with a fourth Advice to a Painter upon the coming in of the Dutch and the End of the War, that made my heart ake to read, it being too sharp and so true."
From 1659 until his death in 1678, Marvell was serving as London agent for the Hull Trinity House, a shipmasters' guild. He went on two missions to the continent, one to the Dutch Republic and the other encompassing Russia, Sweden, and Denmark. He spent some time living in a cottage on Highgate Hill in north London, where his time in the area is recorded by a bronze plaque that bears the following inscription:
Four feet below this spot is the stone step, formerly the entrance to the cottage in which lived Andrew Marvell, poet, wit, and satirist; colleague with John Milton in the foreign or Latin secretaryship during the Commonwealth; and for about twenty years M.P. for Hull. Born at Winestead, Yorkshire, 31st March, 1621, died in London, 18th August, 1678, and buried in the church of St. Giles-in-the-Fields. This memorial is placed here by the London County Council, December, 1898.
A floral sundial in the nearby Lauderdale House bears an inscription quoting lines from his poem "The Garden". He died suddenly in 1678, while in attendance at a popular meeting of his old constituents at Hull. His health had previously been remarkably good; and it was supposed by many that he was poisoned by some of his political or clerical enemies. Marvell was buried in the church of St Giles in the Fields in central London. His monument, erected by his grateful constituency, bears the following inscription:
Near this place lyeth the body of Andrew Marvell, Esq., a man so endowed by Nature, so improved by Education, Study, and Travel, so consummated by Experience, that, joining the peculiar graces of Wit and Learning, with a singular penetration and strength of judgment; and exercising all these in the whole course of his life, with an unutterable steadiness in the ways of Virtue, he became the ornament and example of his age, beloved by good men, feared by bad, admired by all, though imitated by few; and scarce paralleled by any. But a Tombstone can neither contain his character, nor is Marble necessary to transmit it to posterity; it is engraved in the minds of this generation, and will be always legible in his inimitable writings, nevertheless. He having served twenty years successfully in Parliament, and that with such Wisdom, Dexterity, and Courage, as becomes a true Patriot, the town of Kingston-upon-Hull, from whence he was deputed to that Assembly, lamenting in his death the public loss, have erected this Monument of their Grief and their Gratitude, 1688.
It may be noted that his epitaph pays more tribute to his political career than his poetry.
Marvell also wrote anonymous prose satires criticizing the monarchy and Catholicism, defending Puritan dissenters, and denouncing censorship.
The Rehearsal Transpros'd, an attack on Samuel Parker, was published in two parts in 1672 and 1673.
In 1676, Mr. Smirke; or The Divine in Mode, a work critical of intolerance within the Church of England, was published together with a "Short Historical Essay, concerning General Councils, Creeds, and Impositions, in matters of Religion."
Marvell's pamphlet An Account of the Growth of Popery and Arbitrary Government in England, published in late 1677, alleged that: "There has now for diverse Years, a design been carried on, to change the Lawfull Government of England into an Absolute Tyranny, and to convert the established Protestant Religion into down-right Popery". John Kenyon described it as "one of the most influential pamphlets of the decade" and G. M. Trevelyan called it: "A fine pamphlet, which throws light on causes provocative of the formation of the Whig party".
A 1678 work published anonymously ("by a Protestant") in defense of John Howe against the attack of his fellow-dissenter, the severe Calvinist Thomas Danson, is also probably by Marvell. Its full title is Remarks upon a late disingenuous discourse, writ by one T.D. under the pretence de causa Dei, and of answering Mr. John Howe's letter and postscript of God's prescience, &c., affirming, as the Protestant docrine, that GOd doth by efficacious influence universally move and determine men to all their actions, even to those that are most wicked.
Although Marvell became a Parliamentarian, he was not a Puritan. He had flirted briefly with Catholicism as a youth, and was described in his thirties (on the Saumur visit) as "a notable English Italo-Machiavellian".
Vincent Palmieri noted that Marvell is sometimes known as the "British Aristides" for his incorruptible integrity in life and poverty at death. Many of his poems were not published until 1681, three years after his death, from a collection owned by Mary Palmer, his housekeeper. After Marvell's death she laid dubious claim to having been his wife, from the time of a secret marriage in 1667.
T. S. Eliot wrote of Marvell's style that 'It is more than a technical accomplishment, or the vocabulary and syntax of an epoch; it is, what we have designated tentatively as wit, a tough reasonableness beneath the slight lyric grace'. He also identified Marvell and the metaphysical school with the 'dissociation of sensibility' that occurred in 17th-century English literature; Eliot described this trend as 'something which... happened to the mind of England... it is the difference between the intellectual poet and the reflective poet'. Poets increasingly developed a self-conscious relationship to tradition, which took the form of a new emphasis on craftsmanship of expression and an idiosyncratic freedom in allusions to Classical and Biblical sources.
Marvell's most celebrated lyric, "To His Coy Mistress", combines an old poetic conceit (the persuasion of the speaker's lover by means of a carpe diem philosophy) with Marvell's typically vibrant imagery and easy command of rhyming couplets. Other works incorporate topical satire and religious themes.
His work is referenced in the 1997 British film, The Serpent's Kiss.