By the charter of King Bela IV, in 1242 Samobor was given the status of a free royal town, which guided its economic and demographic development throughout history. The city enjoyed independence from the feudal lords and had independent internal administration and judiciary.
Throughout its history, the main occupation of the local population has been craftsmanship. Copper and iron ore have been extracted since the 16th century in Rude near Samobor. In addition to the mines in Rude, there were two glass factories, and the population also worked on making potash, which was an important raw material for glass and chemical production. Millers, tanners, hatmakers, shoemakers, glassmakers, locksmiths, blacksmiths, jewellers, crystal makers - over time, some of these professions have disappeared, but some are still alive. Many small products are still handmade in Samobor as glass, ceramics, crystals, gingerbread, candles, souvenirs, metal railings, wooden doors, cosmetics, food packs with local specialities. Although there is no written evidence which could help date the oldest craft guilds in Samobor, it is believed that in the 16th century Samobor had a developed guild scene, and the number of craftsmen was always significant. In 1754 a total of 148 craftsmen from 28 different professions were recorded, and in the 19th century, almost every third Samoborac was a craftsman of some kind.
From 1809 to 1813 Samobor was part of the Napoleonic Illyrian Provinces and was under French rule.