Jan IV of Oświęcim (Polish: Jan IV oświęcimski; 1426/1430 – by 21 February 1497), was a Duke of Oświęcim during 1434–1456 (until 1445 with his brothers as co-rulers) and Duke of Gliwice from 1465 to 1482.
He was the third son of Duke Casimir I of Oświęcim by his first wife Anna, daughter of Duke Henry VIII of Żagań.
At the time of his father's death in 1434 Jan IV was still a minor, so was placed under the care of his older brother Wenceslaus I.
In 1441, Wenceslaus I agreed to become a vassal of the King of Poland in exchange for the rights to govern the Duchy of Zator (it would be given to them in 1440 and in 1441 Wacław would officially become a vassal). This step was also followed by Jan IV and his brother Przemysław.
On 19 January 1445 was made the formal division of the Duchy between Casimir I's sons. Despite the fact that he was the youngest brother, Jan IV received Oświęcim, the capital of the Duchy, and the towns of Kęty, Żywiec and half of Gliwice.
Since the beginning of his reign Jan IV joined in adventurous politics with his Silesian cousin. One of his first decisions was not recognized the purchase of Siewierz by the Bishop of Kraków, Zbigniew Oleśnicki. This has led to increased tensions between him and the Polish nobles, even resulting in some border wars (common for that period in medieval Europe). The struggle for Siewierz lasted until 1447, when Jan IV finally accepted the ownership of the Bishop.
In 1448 it seemed that the Jan IV's anti-Polish politics were definitively ended when he signed a border agreement with Kingdom of Poland: however, soon their relations worsened. In 1452, and for unknown reasons, Duke Przemysław of Toszek attack Siewierz. The Polish troops, under the command of Piotr Szafraniec, used this as an excuse to attack Jan IV, and sieged his castle of Barwałd. The Duke of Oświęcim saved his lands only after the payment of 2,000 fines to Piotr Szafraniec. But Jan IV, after these humiliating conditions, refused to surrender, and with the plague over the Poland, he looted Polish borderlands, advanced over Lesser Poland and even approached Kraków, the Polish capital itself, on a daring raid.