The stronghold of Racibórz by the Oder River dating back to the 11th century was first mentioned by Gallus Anonymous, who described in his chronicle a battle of 1108 between the knights of Bolesław III Wrymouth and Moravians for power over that settlement. The name of the town comes most probably from the German name Racibor (a germanised form: Ratibor), which means "fighting at war" or "eager to fight".

Its convenient location at the crossroads of trade routes from Bohemia and Moravia to Cracow and Ruthenia facilitated the development of the settlement, which was the seat of a castellany in the 12th century. From 1172 to 1532, Racibórz was the actual capital of an autonomous duchy. About 1200, Mieszko I Tanglefoot established the first mint, which issued coins with the Slavic inscription "milost"[1.1]. The settlement was granted municipal rights under the Flemish law about 1217.

The 13th century saw the rapid growth of Racibórz as a large centre of commerce and craft (drapery and weaving). The city had deposits of salt and hosted the largest grain market in Upper Silesia. In 1241, Racibórz managed twice to resist the invasion of the Tatars. At the time, the settlement was already fortified and protected by a moat from the south and west side. With the passage of time, the Flemish law ceased to respond to the needs of the rapidly developing centre and was replaced in 1299 by the Magdeburg law, which entrusted power over the town to a council composed of the richest bourgeois.

In 1327, Duke Leszek (1306–1336) paid homage to King John of Bohemia, whereby Racibórz came under the sovereignty of Bohemia and started to share the political fortunes of Silesia. In 1331, the Duchy of Racibórz was taken over by a cadet branch of the Bohemian dynasty of Przemyslids. 190 years thereafter, it was incorporated into the district of Opole under the rule of Jan II the Good, the last living representative of that Silesian branch of the Piast dynasty. In 1532, Racibórz came under the direct rule of the Habsburgs, who reigned in Silesia after Louis II of Bohemia and Hungary died heirless (1526). The town fell into decline in the 17th century, when it was destroyed by the Swedes on several occasions in the Thirty Years' War.

The conquest of Silesia by Prussia in 1741 started a period of major political, economic, cultural and social transformations. Towards the end of 18th century, Racibórz started to grow rapidly with the weaving and food industry playing a dominant role. Its development accelerated after a railway line linking Racibórz to Vienna was built in 1846. Despite rampant germinasation, the town became a mainstay of Polish culture in the 19th century. It was a home to the Polish-Upper Silesian Society (1886–1939), Polish bookshop, "Strzecha" Polish House. A Polish magazine was also published in Racibórz.

Although numerous inhabitants of Racibórz took part in the Silesian Uprising in the years 1919–1921, the town remained part of Germany following the plebiscite in 1921. The partition of the Racibórz poviat, criss-crossed by the borders with Czechoslovakia and Poland, lead to the decline of the town as an industrial centre lying at the crossroads of trade routes. During the Second World War, the Germans established a top-security prison, three forced labour camps and a camp for displaced Poles in Racibórz.

On 31 March 1945, after fierce fighting, the city was captured the Soviet Army. About 80% of its buildings were destroyed at the time. In the first decade after the war, Racibórz was incorporated into Poland under the Yalta and Potsdam Agreements, rebuilt and extended as a major industrial centre. The Racibórz poviat became part of the Silesian Voivodeship ( of the Opole Voivodeship in the years 1950–1975 and of the Katowice Voivodeship in the years 1975–1998).