The 76-year-old Oscar-nominee returned the money to publishers Hodder & Stoughton as he changed his mind about writing the book, said the Hollywood Reporter.
"I put nine months aside to do it, and I got a very handsome advance. Then I sent the money back," McKellen said at a literary festival.
"It was a bit painful. I didn't want to go back into my life and imagine things that I hadn't understood so far. The privacy of my life I don't quite understand myself, and it has nothing to do with what I do for a living. So there you go, I'm sorry," he said.