The middle initial in J.K. Rowling’s pen name is K.
Rowling was born Joanne Rowling and did not originally have a recorded middle name. Before publication of Harry Potter and the Philosopher’s Stone, Bloomsbury reportedly wanted a name with two initials because it thought boys might be less likely to choose a book by a woman author.
Rowling selected Kathleen, the name of her paternal grandmother, for the added initial. This produced the author name J.K. Rowling, although the “K” is an initial rather than a word normally expanded on the book covers.
She has also published under Robert Galbraith for her crime fiction. That later pseudonym is separate from the J.K. Rowling name, which remains associated with Harry Potter and several nonfiction and charity-related works.