Pieter Codde was baptised in Amsterdam on 11 December 1599. He was the fourth of nine children of Maria Jansdr. and Jacob Pietersz. Codde, who held the post of 'paalknecht' (responsible for merchants and shippers) in the Amsterdam regency. Nothing is known of Pieter's training, though his early work, primarily portraits, suggests that he studied under a portrait painter. Although it has been suggested, there is nothing to indicate that Frans Hals was his teacher. It is possible that Codde received his training from either Berem van Someren or Cornelis van der Voort, both portrait painters. By the time he was married to Marritge Aerents on 27 October 1623, he was identified as an independent painter. His earliest dated painting, a portrait, was produced in 1626. That he was already making genre paintings at this time is apparent from a 'Dance Scene' dated 1627 (Paris, Musée du Louvre). The painter also played a role in Amsterdam's literary life, for the 1627 tragedy 'Tyrus' by Elias Herckmans was dedicated to him. In 1635 Codde lay in chains for a night in the 'stadhuis'. His affair with a maid had come to light, and led a short time later to the collapse of his marriage. An inventory of his entire estate was drawn up on 5 February 1636. Codde made his will on 8 October 1669. He died nine years later in his house on the Keyzersgracht, which he had bought on 7 January 1657, and was buried on 12 October 1678 in Amsterdam's Oude Kerk.
In the 1630s, Codde concentrated on genre painting, but after the mid-1640s he turned to portraits and a few history paintings. After 1645 he rarely dated his work, but it is likely that he was still active in the 1650s. On commission from the Amsterdam citizens' militia, in 1637 he completed a guard portrait, the 'Magere Compagnie', that Frans Hals had begun four years before, but had not finished, owing to disagreements. Together with Willem Duyster, who is repeatedly named as his pupil, he left his mark on genre painting in Amsterdam in the first half of the seventeenth century.