The writings, printed in Newsweek this week, are from the upcoming book "Journals," which contains letters and diary entries from the 1980s until 1994, when Cobain shot himself to death at age 27 in his Seattle home.
While some of the entries are rambling or humorous, they reveal a man tortured by drug addiction and illness.
" ... I decided to use heroine (sic) on a daily basis because of an ongoing stomach ailment that I had been suffering from for the past five years and had literally taken me to the point of wanting to kill myself," Cobain wrote in a diary entry while in a rehabilitation clinic.
"I bought a gun but chose drugs instead," he wrote later.
Although Nirvana helped put the Seattle grunge sound on the musical map, Cobain didn't like being grouped with the other bands. He apparently had particular disdain for fellow Seattle band Pearl Jam, sometimes criticized for having a similar sound as Nirvana.
"There are a lot of bands who claim to be alternative and theyre nothing but stripped down, ex sunset strip hair farming bands of a few years ago. I would love to be erased from our association with Pearl Jam or the Nymphs and other first time offenders."
The Newsweek excerpts include many references to drug use.
In one letter to a friend that was never sent, Cobain writes: "As you may have guessed by now Ive been taking to a lot of drugs lately It might be time for the Betty Ford clinic or the Richard Nixon library to save me from abusing my enemic, rodent-like body any longer."
In another unsent letter, written to fans while he was in rehab, he derides reports that he is suicidal and drug-addicted.
"I am not a junkie ... Ive had a rather unconclusive and uncomfortable stomach condition for the past three years ... I decided to relieve my pain with small doses of heroine for a walloping 3 whole weeks," he writes.
"It was a stupid thing to do and Ill never do it again and I feel real sorry for anyone who thinks they can use heroine as a medicine because um, duh, it don't work."
But Cobain could not stop using heroin. A few months before he died, he wrote: "I remember someone saying if you try heroine once you'll become hooked. Of course I laughed and scoffed at the idea but I know believe this to be very true."
Also included among the writings are a love letter to his wife, Courtney Love, and an angry, unsent letter to his estranged father.
The 288-page book is to be released Nov. 4 by Riverhead books. The writings were sold by David Vigliano, who represented Cobain's estate.
Also due this fall is a Nirvana musical retrospective containing unreleased material from the band.