Sir William Schwenck Gilbert (18 November 1836 – 29 May 1911) was an English dramatist, librettist, poet and illustrator best known for his collaboration with composer Arthur Sullivan, which produced fourteen comic operas. The most famous of these include H.M.S. Pinafore, The Pirates of Penzance and one of the most frequently performed works in the history of musical theatre, The Mikado. The popularity of these works was supported for over a century by year-round performances of them, in Britain and abroad, by the repertory company that Gilbert, Sullivan and their producer Richard D'Oyly Carte founded, the D'Oyly Carte Opera Company. These Savoy operas are still frequently performed in the English-speaking world and beyond.
Gilbert's creative output included over 75 plays and libretti, and numerous short stories, poems and lyrics, both comic and serious. After brief careers as a government clerk and a lawyer, Gilbert began to focus, in the 1860s, on writing light verse, including his Bab Ballads, short stories, theatre reviews and illustrations, often for Fun magazine. He also began to write burlesques and his first comic plays, developing a unique absurdist, inverted style that would later be known as his "topsy-turvy" style. He also developed a realistic method of stage direction and a reputation as a strict theatre director. In the 1870s, Gilbert wrote 40 plays and libretti, including his German Reed Entertainments, several blank-verse "fairy comedies", some serious plays, and his first five collaborations with Sullivan: Thespis, Trial by Jury, The Sorcerer, H.M.S. Pinafore and The Pirates of Penzance. In the 1880s, Gilbert focused on the Savoy operas, including Patience, Iolanthe, The Mikado, The Yeomen of the Guard and The Gondoliers.
In 1890, after this long and profitable creative partnership, Gilbert quarrelled with Sullivan and Carte concerning expenses at the Savoy Theatre; the dispute is referred to as the "carpet quarrel". Gilbert won the ensuing lawsuit, but the argument caused hurt feelings among the partnership. Although Gilbert and Sullivan were persuaded to collaborate on two last operas, they were not as successful as the previous ones. In later years, Gilbert wrote several plays, and a few operas with other collaborators. He retired, with his wife Lucy, and their ward, Nancy McIntosh, to a country estate, Grim's Dyke. He was knighted in 1907. Gilbert died of a heart attack while attempting to rescue a young woman to whom he was giving a swimming lesson in the lake at his home.
Gilbert's plays inspired other dramatists, including Oscar Wilde and George Bernard Shaw, and his comic operas with Sullivan inspired the later development of American musical theatre, especially influencing Broadway librettists and lyricists. According to The Cambridge History of English and American Literature, Gilbert's "lyrical facility and his mastery of metre raised the poetical quality of comic opera to a position that it had never reached before and has not reached since".