For centuries, Karlskoga was a small forest and mining community, not even a parish of its own. In the 17th century fourteen small iron works and eight waterdriven hammers for bar iron were established. Most of these were still operating in the 1860s, but the dominating iron works was the one in nearby Bofors. In 1871, Bofors produced 6,124 metric tons of iron, more than any other plant in Sweden. Karlskoga is also known as the home town to Alfred Nobel (born in 1833), inventor of dynamite and founder of the Nobel Prize. Not far from the town is a Nobel Museum. In 1882, Karlskoga parish/municipality (socken) had 11,184 inhabitants.
Bofors was incorporated in 1873 and has since the 1880s been specializing in the lucrative manufacture of cannon. Karlskoga has spent most of the 20th century as a growing company town to this cannon maker. Only with the demilitarization of the most recent decades has this started to be a problem for the town. In 2001, the municipality had 31,293 inhabitants living on 471 km², of which 8,500 worked for Bofors in 1980 and 2,600 in 1998.