von Troppau-Ratibor;[note 1] c. 1440–1483 in Wodzisław Śląski) was a member of the Opavian branch of the Bohemian Přemyslid dynasty.
John IV was the elder son of Duke Nicholas V of Krnov and his wife, Margaret Clemm of Ellguth.
John IV and his younger brother Wenceslaus III were still minors when their father died in 1452.
Because of this, King Matthias Corvinus of Hungary took John IV prisoner in 1474 and forced him to cede Krnov.
John's sister Barbara (d. 1510), who had married Duke Jan IV of Oświęcim in 1475, objected to Matthias Corvinus against the shameful treatment of her brothers and the theft of her father's inheritance.