J.K. Rowling’s middle initial was intended to represent Kathleen.
Rowling was born Joanne Rowling and did not originally have a middle name. When Bloomsbury prepared the Harry Potter books for publication, the publisher believed a gender-neutral author name might appeal to young male readers and asked her to use initials.
Rowling selected K for Kathleen, the first name of her paternal grandmother. She therefore became J.K. Rowling in the author identity used on the books, even though Kathleen was not her legal middle name at birth.
Her name is often described as Joanne Kathleen Rowling, but that wording can obscure the publishing history. The K was added for the pen name, and Rowling later used the name J.K. Rowling consistently in public professional life.