The legality of cannabis varies from country to country. Possession of cannabis is illegal in most countries and has been since the beginning of widespread cannabis prohibition in the late 1930s. However, possession of the plant in small quantities has been decriminalized in many countries and sub-national entities in several parts of the world. For example, cannabis in Canada will be legal for recreational use if legislation is passed in spring 2017. On 10 December 2013, Uruguay became the first country in the world to legalize the sale, cultivation, and distribution of cannabis. Open sales are "illegal, but not punishable", at "coffeeshops" in the Netherlands if certain rules are followed. In the United States, federal law prohibits possession or sale of marijuana for any purpose, but the Obama Administration has refrained from prosecuting users and dealers operating in compliance with state (see Legality of cannabis by U.S. jurisdiction), territory, and Indian reservation laws which permit medical or recreational marijuana.
The medicinal use of cannabis is legal in a number of countries, including Canada, the Czech Republic and Israel. Medical cannabis in the United States is legal in 29 states as of December 2016.
Some countries have laws which are not as vigorously prosecuted as others, but apart from the countries which offer access to medical marijuana, most countries have penalties ranging from lenient to very severe. Some infractions are taken more seriously in some countries than others in regard to the cultivation, use, possession or transfer of cannabis for recreational use. A few jurisdictions have lessened penalties for possession of small quantities of cannabis, making it punishable by confiscation and a fine, rather than imprisonment. Some jurisdictions/drug courts use mandatory treatment programs for young or frequent users, with freedom from narcotic drugs as the goal and a few jurisdictions permit cannabis use for medicinal purposes. Routine drug tests to detect cannabis are most common in the United States, and have resulted in jail sentences and loss of employment even for medical use. In most European countries, privacy and labor laws prevent such testing for job applicants. Simple possession can carry long jail sentences in some countries, particularly in parts of East Asia and Southeast Asia, where the sale of cannabis may lead to life imprisonment or execution.