Prime Minister Malcolm Turnbull has spoken of his "lonely" days in boarding school and of how losing the Liberal leadership when in opposition prepared him to become a better leader of his party in government.

In an interview with journalist Mike Munro at a Lifeline event in Sydney on Monday, Mr Turnbull was asked about the "bleakest" days of his childhood during his parents' divorce and whether standing up to "bullies" in school had prepared him for bullies in public life.

"I was lonely," he said.

"I went to boarding school when I was eight. My parents were in the process of splitting up and I was very lonely.