Rowling has disclosed that the manuscript for The Private Joke was in the luggage rack of her train from Manchester to London when she dreamt up the character.
Writing in a Sunday newspaper essay, she has admitted she kept writing the first novel while working on the first Potter novel, The Philosopher’s Stone.
The Edinburgh-based author has recalled her early writing experiences ahead of the release of The Christmas Pig, her first children’s book since the final Potter novel, Deathly Hallows, in 2007.
Writing in The Sunday Times, Rowling recalls writing her own stories from the age of six, but says she was “quite secretive” about the work she produced outside the classroom.
She adds: “Only my bin and I know exactly what was in the short stories I churned out as a child and a teen, not to mention the novels that shrivelled up and died after a couple of chapters.”
Rowling spent five years working on the the first Potter novel and the idea of a series of books after she dreamt up the character on a delayed train journey in 1990.
In her essay, Rowling recalls: “In my early twenties I wrote quite a lot of a very bad novel called The Private Joke.
"I regularly abandoned it for months at a time to write other things, then picked it up again.
"Part of the manuscript was sitting up in the luggage rack when, aged 25, I was travelling by train from Manchester to London, and the idea for a very different kind of book hit me: that of a boy who didn’t realise he was a wizard and was taken off to magic school.
"The idea of writing for children had never occurred to me before, not because I thought it was in any way less than writing for adults – I read varciously as a child and still count certain children’s books among my favourites – but because my childhood wasn’t very happy.
"I’m not one of those who craves a return to a delightfully carefree youth. For me, childhood was a time of anxiety and insecurity.
"Yet the idea for Harry Potter came to me in a rush of exhilaration, and all I could think was how much I’d love to write it, how much fun it would be to build up that hidden world.
"I kept writing The Private Joke alongside The Philosopher's Stone for a while until it dawned on me, to paraphrase the iconic Sesame Street song, that one of these things is better than the other, and I finally put The Private Joke out of its misery.”
Rowling spent nine years working on The Christmas Pig, which is billed as “a page-turning adventure about one child’s love for his most treasured toy,” finishing the book during lockdown.
She writes in the essay: “I finished it at a time when the pandemic was still raging and I was unusually aware of the need for human connection. I think that’s why I kept imagining it being read aloud when I worked on it, something I’ve never done with any other book.”