Cotman was born in Norwich, England, on 16 May 1782, the eldest son of a prosperous silk merchant and lace dealer, and was educated at the Norwich School. He showed a talent for art from an early age and would often go out on frequent drawing trips into the surrounding countryside. His father intended him to go into the family business but instead, intent on a career in art, he moved to London in 1798, initially making a living through commissions from print-sellers. He came under the patronage of Dr. Thomas Monro, physician to Bridewell and the Bethlehem Hospital, whose house in Adelphi Terrace was a studio and a meeting place for artists. There Cotman made the acquaintance of J. M. W. Turner, Peter de Wint and Thomas Girtin who became an influential figure in his artistic development. He joined a sketching club started by Girtin, and went on drawing expeditions to Wales and Surrey.
In 1800, aged 18, Cotman exhibited at the Royal Academy for the first time, showing five scenes of Surrey and one of Harlech Castle. He probably spent the summers of 1800 and 1801 touring Wales, as he showed Welsh scenes at the academy in 1801 and 1802. In 1800 he was awarded an honorary palette by the Society of Arts. He continued to exhibit at the academy until 1806, and went on several extended drawing trips through England and Wales. In the three summers of 1803–5 he stayed with the Cholmeley family at Brandsby Hall in Yorkshire. On the last of these three visits to Yorkshire, he made a series of watercolours of the River Greta.
While based in London, Cotman had spent some time in the city of his birth, and in September 1802 advertised his services as teacher of drawing in the Norwich Mercury. In 1806 he returned to live in Norwich and joined the "Norwich Society of Artists", exhibiting 20 works, including six portraits, at the society's exhibition in 1807, and 67 works, including some oils, in 1808. In 1811 he became president of the society.
In 1809, Cotman married Ann Mills, a farmer's daughter from Felbrigg. They were to have five children. His main living came from teaching art and one of his students, the local antiquary Dawson Turner, became a good friend, introducing him to many pupils and collaborating on one of his books. As part of his teaching Cotman operated a kind of subscription library of watercolours, which his pupils took home to copy. Many of his works bear numbers related to this scheme. In 1811, his first set of etchings was published; all but one of the subjects were architectural, mostly buildings in Yorkshire. He followed this with a set of 60 etchings of ancient buildings in Norfolk, published in ten parts between 1812 and 1818. In 1817 he visited Normandy with Dawson Turner, making drawings of buildings, and went there again in 1818 and 1820. Two years later he published a set of 100 etchings based on sketches he made there. After these visits the character of his paintings changed, the later ones being brighter in colour.
From 1812 to 1823, Cotman lived on the coast at Great Yarmouth where he studied shipping and mastered the form of waves. Some of his finest marine pieces date from this time. He returned to Norwich in 1824, hoping to improve his financial position, and moved into a large house in St Martin's Plain, opposite the Bishop's Palace, where he built up a collection of prints, books, armour and many models of ships to aid his compositions. He showed work from 1823 to 1825 at the Norwich Society of Artists' annual exhibitions. In 1825, Cotman became an Associate of the Royal Society of Painters in Watercolours and was a frequent exhibitor until 1839. However he was driven to despair by his constant financial struggles.
In January 1834, Cotman was appointed Master of Landscape Drawing at King's College School in London, partly on the recommendation of J. M. W. Turner. In 1836, his son Miles Edmund was appointed to assist him. Dante Gabriel Rossetti was one of his pupils. In London, Cotman was friends with a number of artists including James Stark, George Cattermole, Samuel Prout and Cornelius Varley. In 1836, he became an honorary member of the Institute of British Architects. In 1838, all of his etchings were published by Henry George Bohn including "Liber Studiorum".
Cotman died in July 1842, and was buried in the cemetery at St. John's Wood Chapel. All his works and collection of prints and books were sold by auction at Christie's, realising just over £525 – a relatively paltry sum. His sons, Miles Edmund Cotman and John Joseph Cotman, became painters of note. Cotman's name is used as a trademark by Winsor & Newton for a range of artist's watercolour materials.