The K in J.K. Rowling represents Kathleen, her paternal grandmother’s name.
Rowling was born Joanne Rowling in 1965, and her birth name did not originally include a middle name. Bloomsbury reportedly wanted a name that would appeal to boys as well as girls for the Harry Potter books, so Rowling adopted initials for publication. She chose K in honor of her grandmother Kathleen.
The author is therefore commonly styled J.K. Rowling, although the initial is not derived from a middle name assigned at birth. This distinction is often missed because the abbreviation looks like a conventional first-and-middle-initial combination.
Rowling has also used other publishing identities. Her crime novels appear under Robert Galbraith, while works such as The Casual Vacancy were published under J.K. Rowling. Her public name and her pen names belong to different publishing contexts, but the K in her best-known name has the same family origin.