A man arrested on suspicion of drink-driving told police that he had cocaine inside his sock.
Russell David, of Walpole Road in Crosland Moor, volunteered the information to the officers after they pulled him over on May 12.
Cannabis was also found during a search of his Ford Ka.
The 34-year-old pleaded guilty to possession of controlled drugs of class A and B.
Police stopped his car at just before 7pm on Colne Road in Huddersfield.
Prosecutor Alex Bozman told Kirklees magistrates that while speaking to David the officers could smell cannabis in his car.
They searched the vehicle and found two small self-seal bags containing cannabis.
David told them that he had a cannabis addiction and also had some cocaine hidden inside his sock.
Ian Whiteley, mitigating, said that his client was originally stopped on suspicion of drink-driving and provided a breath test.
David was under the limit for his but then volunteered that he had the drugs on him for his own personal use.
Magistrates fined him £140 and ordered him to pay £85 costs and £30 victim surcharge.
The drugs will be forfeited and destroyed.