Harnett was born in Clonakilty, County Cork, Ireland during the time of the potato famine. Shortly after his birth his family emigrated to America, settling in Philadelphia. Becoming a United States citizen in 1868, he made a living as a young man by engraving designs on table silver, while also taking night classes at the Pennsylvania Academy of the Fine Arts and later, in New York, at Cooper Union and at the National Academy of Design. His first known oil painting, a still life, dates from 1874.
The style of trompe l'oeil painting that Harnett developed was distinctive and inspired many imitators, but it was not without precedent. A number of 17th century Dutch painters, Pieter Claesz. for instance, had specialized in tabletop still life of astonishing verisimilitude. Raphaelle Peale, working in Philadelphia in the early 19th century, pioneered the form in America. What sets Harnett's work apart, besides his enormous skill, is his interest in depicting objects not usually made the subject of a painting.
Harnett painted musical instruments, hanging game, and tankards, but also painted the unconventional Golden Horseshoe (1886), a single rusted horseshoe shown nailed to a board. He painted a casual jumble of second-hand books set on top of a crate, Job Lot, Cheap (1878), as well as firearms and even paper currency. His works sold well, but they were more likely to be found hanging in a tavern or a business office than in a museum, as they did not conform to contemporary notions of high art.
Harnett spent the years 1880?C1886 in Europe, staying in Munich from 1881 until early 1885. Harnett's best-known paintings, the four versions of After The Hunt, were painted between 1883 and 1885. Each is an imposing composition of hunting equipment and dead game, hanging on a door with ornate hinges at the right and keyhole plate at the left. These paintings, like the horseshoe or currency depictions mentioned earlier, are especially effective as trompe l'oeil because the objects occupy a shallow space, meaning that the illusion is not spoiled by parallax shift if the viewer moves.
Overall, Harnett's work is most comparable to that of the slightly younger John F. Peto. The two artists knew each other, and a comparison can be made between two paintings featuring violins. Harnett's Music and Good Luck from 1888 shows the violin hanging upright on a door with ornate hinges and with a slightly torn piece of sheet music behind it. The elements are arranged in a stable, deliberate manner. Peto's 1890 painting shows the violin hanging askew, as well as chipped and worn, with one string broken. The sheet music is dog-eared and torn around the edges, and placed haphazardly behind the instrument. The hinges are less ornate, and one is broken. Harnett's objects show signs of use but are well preserved, while Peto's more humble objects are nearly used up.
Crippling rheumatism plagued Harnett in his last years, reducing the number but not the quality of his paintings. He died in New York City in 1892. Other artists who painted similar compositions in Harnett's wake include his contemporary John Haberle and successors such as Otis Kaye and Jefferson David Chalfant.