Sir William Schwenck Gilbert ( 18 November 1836 â `` 29 May 1911 ) was an English dramatist , librettist , poet and illustrator . He is best known for the comic operas ( or operettas ) that he wrote with Sir Arthur Sullivan . Sir William Schwenck Gilbert ( 18 November 1836 -- 29 May 1911 ) was an English dramatist , librettist , poet and illustrator best known for his fourteen comic operas produced in collaboration with the composer Sir Arthur Sullivan , of which the most famous include H.M.S. Pinafore , The Pirates of Penzance and one of the most frequently performed works in the history of musical theater , The Mikado .