The Black Sabbath singer says he was in a "dark place" but has been sober for 44 days.
In a message posted Tuesday on his Facebook page, 64-year-old Osbourne said that "for the last year and a half I have been drinking and taking drugs."
He said "I was in a very dark place" and apologized for his "insane behavior."
Osbourne added: "Just to set the record straight, Sharon and I are not divorcing."
The couple and their children, Jack and Kelly, became reality TV stars a decade ago with MTV series "The Osbournes."
Sharon Osbourne was later a judge on "America's Got Talent"—as well as Ozzy's manager.
Ozzy Osbourne was a founding member of heavy-metal pioneers Black Sabbath, but left the group in 1979.
He has since rejoined, and the band's new studio album "13"—its first with Ozzy for 35 years—is out in June.
The band is due to tour Australia and New Zealand this month and plans European and North American dates later in the year.