Mary Shelley was the daughter of Mary Wollstonecraft and William Godwin (to whom Frankenstein was dedicated). Godwin's novel, Caleb Williams was an important influence on the work. Frankenstein is one of the best known of the gothic canon, famously written when the author was only 19, after she had spent a summer at the Villa Diodati with Shelley, Byron and Polidori. Few people believed it could be her work and suspected it was really written by Shelley.
Mary Shelley's life was haunted with tragedy; her mother died only 11 days after her birth and her own first child died 12 days after birth. The next year, 1816, as Frankenstein was being written, Mary's half-sister, Fanny, and Shelley's wife, Harriet, both committed suicide. Mary then lost two other children and her husband. In Frankenstein, Mary explores some of these harrowing experiences of birth, death, guilt, and self-loathing. The character of the brilliant but selfish Victor Frankenstein, who abandons his creation and is indirectly responsible for killing those he loves, owes much to Mary's husband Percy Bysshe Shelley. Shelley abandoned his first wife and two children and was recklessly irresponsible with Mary and theirs, insisting they move house only days after she had given birth (the baby died), and when the children were sick (Clara died of dehydration on a wagon journey). William, too, might have lived had Shelley not ignored his doctor's advice.
It is interesting to note that the servant girl who is wrongfully executed for murder in Frankenstein is called Justine, like the sexually abused innocent in de Sade's novel. Both Lewis and Byron possessed copies of this novel and may have discussed it at the Villa Diodati. Another curiosity is the use of the name William for the monster's first victim. Mary's father and half brother were both named William and so was her baby son. She herself would have been called William had she been the boy child her parents were anticipating.
The experiments of Erasmus Darwin, as discussed by Shelley and Polidori, were also an influence on Frankenstein. Darwin was said to have preserved a piece of vermicelli in a glass case, till by some extraordinary means it began to move with voluntary motion.
Shelley was acquainted with many writers, including Samuel Taylor Coleridge whose poetry made a great impression on her, and Thomas Lovell Beddoes. Washington Irving, author of The Legend of Sleepy Hollow, was a temporary romantic interest.