Cavnic is a mining town situated in the valley of the same name, 26 km east of Baia Mare, in Maramureş County, northern Romania. The town covers 47.17 km², at altitudes ranging from 500 to 1050 meters above sea level.
Cavnic was first documented in 1336, as Capnic. It was named after the river, which got its name from a Slavic word, kopanе, which refers to digging. Mining activity in the area dates back to the Roman age.
The town was destroyed by the Ottomans in 1460 and by the Tatars in 1717, but the Tatars invasion ended with their defeat from the people of Cavnic, making from it the last Tartar invasion to ever take place in Romania..
In the 1910 Census of the Kingdom of Hungary, Kapnikbánya (as it was then called) was in Szatmár county, Nagybánya district. It then had a population of 3517, out of which 1864 were Hungarians, 49 were Germans and 1604 were Romanians. 1497 identified as Catholic, 1890 as Greek Catholic, and 89 as Jewish.
The town's mines tended to close and reopen, often not remaining operational for any great length of time. In the 1970s, however, Cavnic underwent a great deal of development. Two ski slopes were built at Icoana, and the town gained motels, boardinghouses and a hotel to take advantage of its touristic potential.