He was educated at the City of London School before studying at the Royal College of Chemistry (now part of Imperial College, London), where he was appointed Honorary Assistant to Augustus von Hofmann. He conducted much of his early research in a laboratory at his home where, during his Easter vacation in 1856, he attempted to synthesise quinine, based on a suggestion from von Hofmann that this anti-malaria drug might be synthesizable from coal tar. In the course of this research, he instead obtained aniline purple, a dark precipitate which was found to easily dye materials. Named mauveine, this was the first synthetic dye.
Against the wishes of von Hofmann, he patented mauveine and left school to set up a dyeworks in West London to mass produce his discovery. This venture was hugely successful, and over the next several years, Perkin discovered and marketed other synthetic dyes including Britannia Violet and Perkin's Green. Local lore has it that the color of the nearby Grand Union Canal changed from week to week depending on the activity of Perkin's dyeworks. In 1869, Perkin found a method to commercially produce alizarin, a brilliant red dye then produced from the madder plant, from anthracene, but the German chemical company BASF patented the same process one day before he did. Over the next few years, Perkin found his research and development efforts increasingly eclipsed by the German chemical industry, and in 1874, he sold his factory and retired from business, already a very wealthy man.
William Perkin continued active research in organic chemistry for the rest of his life. He later found syntheses for coumarin, one of the first synthetic perfumes, and cinnamic acid, this latter preparation becoming known as the Perkin reaction. He died in 1907.