Duke William II of Bavaria-Straubing KG (5 April 1365—31 May 1417) was also count William IV of Holland, count William VI of Hainaut and count William V of Zeeland. He ruled from 1404 until 1417, when he died from an infection caused by a dog bite. William was a son of Albert I and Margaret of Brieg.
William, allied with the Hooks, was in conflict with his father until 1394. In 1404 he succeeded him as Count of Holland, Zeeland and Hainaut and duke of Bavaria-Straubing.
In 1408 in the Battle of Othée William and John of Burgundy defeated together with Louis VII, Duke of Bavaria the citizens of Liege who revolted against William's brother John of Bavaria, the bishop of Liège. As a result, he was no longer, as count of Hainaut, obliged to pay homage to the bishop. William's reign was marked by internal strife within the county of Holland. In particular, Lord John V of Arkel supported William's enemies in Holland. William conquered Arkel in 1412, at which point John accepted his defeat and Arkel was annexed by Holland.
William claimed Friesland as the count of Holland. Duke William I of Bavaria-Straubing had previously sent five expeditions to conquer Friesland. Only Stavoren was captured in 1398. William II also sent expeditions to the region but Stavoren was regained by the Frisians in 1414. Prior to his death, William ensured his nobles swore allegiance to his only daughter, Jacqueline. Jacqueline was the only child by his wife Margaret of Burgundy, a daughter of Philip the Bold whom he married in 1385, at the Burgundian double wedding in Cambrai, at the same time his sister, Margaret of Bavaria, married John the Fearless.