Kesha says she "almost died" before seeking help in a rehab clinic for an eating disorder in 2014.

The Tik Tok hitmaker, 30, says a lack of self-confidence can lead people into a spiral of negative feelings and that's just what happened to her, according to the Daily Mail.

"If you feel a certain way about yourself, your body - it can kill you. I almost died. I came closer than I ever knew," she revealed during Refinery 29's Reclaiming the Internet SXSW panel in Austin, Texas.

Read more:
Schumer: Trolls make me 'powerful'
Fans go wild about Sheeran's dirty-sounding hashtag


She continued: "By the time I entered rehab, they were surprised I hadn't had a stroke - because I hadn't consumed enough. I'm not ashamed anymore. It's emotional because it's a deep-rooted disease. It can really affect your self-worth."

The 30-year-old singer revealed she tries to avoid reading negative comments about herself online but admits it is difficult to avoid them.

She added: "I try to limit myself in terms of reading comments because there can be a million positive ones, but I always gravitate towards the one negative one. I hold on to that and I internalize it and I know it's an unhealthy habit. I've stopped reading comments.

"I was making trolls, I was making bullies, I was making people I had never met before - who were projecting their insecurities on me, on the internet - I was making them the truth, the higher power."

Kesha recently took to the web to share a heartfelt PSA with the National Eating Disorders Association.

She joined up with the organization to encourage those suffering from the life threatening problem to get the help that they need.

The We R Who We R hit-maker has been treated for both anorexia and bulimia in the past.

Kesha is still in the throes of an ongoing legal battle to end her professional ties with music producer Dr Luke.

She has accused him of sexually abusing and blasting her about her weight.