A number of newspapers had claimed that the self-obsessed Defence Against The Dark Arts teacher was based upon her first husband, a Portuguese journalist.
But a spokesperson for the author told CBBC Newsround: "JK Rowling says categorically that Gilderoy Lockhart is not based on her ex-husband."
The newspaper claims came after JK's appearance at the Edinburgh International Book Festival.
She is now married to Neil Murray, and is expecting her third child next year.