The Swiss Criminal Code (SR/RS 311, German: Strafgesetzbuch (StGB), French: Code pénal suisse (CP), Italian: Codice penale svizzero (CP), Romansh: Cudesch penal svizzer) is a portion of the third part (SR/RS 3) of the internal Swiss law ("Private law - Administration of civil justice - Enforcement") that regulates the criminal code in Switzerland.
With its entry into force on 1 January 1942, all cantonal legislation that contradicted the new Criminal Code was abolished.
This especially included the civilian death penalty, which was still in force in some cantons, as well as the criminalization of gay sex.
The most recent significant revision took effect in 2007 and introduced the possibility to convert short prison sentences (less than one year) into fines, calculated using a day-rate based on the "personal and economic situation of the convict at the time of the verdict", with an upper limit set at CHF 3000 per day of the sentence.
The Federal Council in October 2010 announced its intention to revert to the earlier system, and all large parties expressed at least partial support.