Joseph Ferdinand Sonnleithner (3 March 1766 – 25 December 1835) was an Austrian librettist, theater director archivist and lawyer. He was the son of Christoph Sonnleithner, brother of Ignaz von Sonnleithner and uncle of Franz Grillparzer and Leopold von Sonnleithner. He was a personal friend and attorney of Ludwig van Beethoven, and he wrote numerous librettos, among them, Beethoven's stage opera Fidelio, Faniska by Luigi Cherubini and Agnes Sorel by Adalbert Gyrowetz.
Sonnleithner began working for the Viennese court in 1787, first at Joseph II's private office and later in the chancellery. From 1796 to 1796 he published the Wiener Theater-Almanach, and in 1802 he became partner in the Kunst und Industrie-Comptoir publishing house. For a short period from February to August 1804 he served as artistic director of the Theater an der Wien, and from 1804 to 1814 as secretary of court theaters in Vienna. He was also a leading figure in the Viennese musical life in the first decades of the nineteenth century and consequently one of the founders of the Gesellschaft der Musikfreunde, serving as its first secretary starting in 1812.
Sonnleithner was one of the earliest collectors of folksongs and information on their composers in Austria, a project which, though never fulfilled, formed the basis of a new musical encyclopedia. He, his nephew Grillparzer and Franz Schubert were close friends. For his treasured collection of oil paintings from the Baroque period on, which is now kept in the Gesellschaft der Musikfreunde, he also commissioned a special portrait of Schubert from the artist Anton Depauly.