William II was Count of Hainaut from 1337 until his death. He was also Count of Holland and Count of Zeeland. He succeeded his father, Count William I of Hainaut, and married in 1334 to Joanna, Duchess of Brabant, the daughter and heiress of John III, Duke of Brabant, but had no issue.
William fought in France as an ally of the English. He went on crusade against the Saracens and the Lithuanians. He besieged Utrecht, because his one-time favorite bishop, John van Arkel of Utrecht, had turned against him. He died at Warns, near Stavoren, during one of the battles of Warns against the Frisians in 1345.
William was succeeded by his sister, Margaret of Hainaut, who was married to Louis IV, Holy Roman Emperor. Hainaut, Holland and Zeeland became a part of the imperial crown domains.