Police will carry out testing using mouth swabs for any motorist they suspect of drug driving or who has been involved in an accident or stopped for a traffic offence.
This will make it easier to hold drug drivers to account as there will no longer be a requirement to prove that someone was driving in an impaired manner.
There will be a zero tolerance approach to the eight drugs most associated with illegal use, including cannabis, heroin and cocaine.
Drugs associated with medical use will have limits based on impairment and road safety.
Justice Secretary Humza Yousaf said: “Driving a vehicle while under the influence of drugs is simply not acceptable. The consequences of causing a collision while under the influence can be devastating.
“I am grateful to Police Scotland, the Scottish Police Authority, and the Crown Office and Procurator Fiscal Service for their hard work to prepare for the new laws coming into force.
“Alongside our stringent drink driving limits, these new curbs will ensure Scotland’s law enforcement agencies have the most robust powers in the UK to tackle impaired and unsafe driving in order to keep people safe.”
Chief Superintendent Stewart Carle, head of road policing for Police Scotland, added: “With our partners, we are committed to reducing road casualties and deplore the devastating consequences of drug driving on victims, their families and communities.
“This new legislation gives the police powers to detect, at the roadside, those selfish motorists who risk the lives of others and themselves by driving after taking illegal substances.”