The pair, who play in France's Top 14 league, were arrested at 3:00am (0200 GMT) on Saturday outside a nightclub near the Champs Elysees in possession of 2.4 grams (0.08 ounces) of the substance.
They were released from custody on Sunday evening with Williams, 35, due to appear in court at a later date having accepted the charge.
O'Connor faces a fine on the lesser charge of possession, Paris police sources said.
Initial indications from the police investigation suggest Williams bought the drug, although he tested negative for it, while O'Connor, who tested positive, was not involved in the purchase.
Plain-clothes officers saw Williams in a car with two suspected drug dealers while O'Connor was outside and appeared to be acting as a lookout, police said.
When they were challenged, Williams attempted to get rid of the cocaine by throwing it away, added a police source who said the two players had clearly been drinking.
Police said €180 ($190) changed hands in the deal. The pair were detained along with the suspected dealers.
The two players were interviewed by drugs police officers during their spell in custody.
Racing 92 released a statement on Saturday saying their player Williams had been suspended indefinitely, but Toulon said they would wait before deciding whether to discipline O'Connor.
Williams earned 77 New Zealand caps between 2002 and 2012 and plays in the second row. He was part of the All Black team that won the 2011 World Cup.
O'Connor, 26, who plays on the wing or at fullback for Toulon, appeared 44 times for Australia between 2008 and 2013. He made his debut at 18, the second youngest Wallaby in Australian rugby history.