Dryden was born in the village rectory of Aldwincle near Thrapston in Northamptonshire, where his maternal grandfather was Rector of All Saints. He was the eldest of fourteen children born to Erasmus Dryden and wife Mary Pickering, paternal grandson of Sir Erasmus Dryden, 1st Baronet (1553–1632) and wife Frances Wilkes, Puritan landowning gentry who supported the Puritan cause and Parliament. He was a second cousin once removed of Jonathan Swift. As a boy Dryden lived in the nearby village of Titchmarsh, Northamptonshire where it is likely that he received his first education. In 1644 he was sent to Westminster School as a King's Scholar where his headmaster was Dr. Richard Busby, a charismatic teacher and severe disciplinarian. Having recently been re-founded by Elizabeth I, Westminster during this period embraced a very different religious and political spirit encouraging royalism and high Anglicanism. Whatever Dryden's response to this was, he clearly respected the Headmaster and would later send two of his sons to school at Westminster.
As a humanist public school, Westminster maintained a curriculum which trained pupils in the art of rhetoric and the presentation of arguments for both sides of a given issue. This is a skill which would remain with Dryden and influence his later writing and thinking, as much of it displays these dialectical patterns. The Westminster curriculum included weekly translation assignments which developed Dryden's capacity for assimilation. This was also to be exhibited in his later works. His years at Westminster were not uneventful, and his first published poem, an elegy with a strong royalist feel on the death of his schoolmate Henry, Lord Hastings from smallpox, alludes to the execution of King Charles I, which took place on 30 January 1649, very near the school where Dr. Busby had first prayed for the King and then locked in his schoolboys to prevent their attending the spectacle.
In 1650 Dryden went up to Trinity College, Cambridge. Here he would have experienced a return to the religious and political ethos of his childhood: the Master of Trinity was a Puritan preacher by the name of Thomas Hill who had been a rector in Dryden's home village. Though there is little specific information on Dryden's undergraduate years, he would most certainly have followed the standard curriculum of classics, rhetoric, and mathematics. In 1654 he obtained his BA, graduating top of the list for Trinity that year. In June of the same year Dryden's father died, leaving him some land which generated a little income, but not enough to live on.
Returning to London during The Protectorate, Dryden obtained work with Cromwell's Secretary of State, John Thurloe. This appointment may have been the result of influence exercised on his behalf by his cousin the Lord Chamberlain, Sir Gilbert Pickering. At Cromwell's funeral on 23 November 1658 Dryden processed with the Puritan poets John Milton and Andrew Marvell. Shortly thereafter he published his first important poem, Heroic Stanzas (1658), a eulogy on Cromwell's death which is cautious and prudent in its emotional display. In 1660 Dryden celebrated the Restoration of the monarchy and the return of Charles II with Astraea Redux, an authentic royalist panegyric. In this work the interregnum is illustrated as a time of anarchy, and Charles is seen as the restorer of peace and order.