Duke Wilhelm in Bavaria (Wilhelm Pfalzgraf und Herzog von Zweibrücken-Birkenfeld zu Gelnhausen; 10 November 1752 – 8 January 1837) was a German prince of the House of Wittelsbach.Born into a non-ruling cadet branch of the widely branched House of Wittelsbach, Wilhelm was Count Palatine of Birkenfeld-Gelnhausen between 1789 and 1799 and first Duke in Bavaria from 16 February 1799 until his death in 1837. He never ruled over his own principality, but from 17 December 1803 to 20 March 1806 he was titled Duke of Berg.