Hannah Webster was born on September 10th, 1758 in Salisbury, Massachusetts to Hannah Wainwright and her merchant husband, Grant Webster. After her mother died when she was very young, she was sent to boarding school. Reports suggest she was pretty, smart, and well educated. She wrote several articles that were published in local newspapers.
Through these articles, she met the Reverend John Foster of Cambridge, Massachusetts and married him in 1758. They lived in Brighton, Massachusetts and had six children, five of which lived past childhood.
Foster published The Coquette under the penname of "A Lady of Massachusetts" after the birth of her sixth child. She most likely heard the true story of Elizabeth Whitman of Hartford, Connecticut in the July 29, 1788 edition of the Salem Mercury. Foster's book was very successful and went through multiple printings within a few decades. It was published anonymously, and her authorship was posthumously revealed in 1866. Though it was incredibly popular, some of her contemporary critics lambasted the work as straying too far from facts and thought the depiction of Sanford was too roguish.
Foster wrote one other work, The Boarding School; or Lessons of a Preceptress to her Pupils (1798), which was based off her own experiences at boarding school. It was structured like the popular advice manuals of her era; it provided tips and information on reading, writing, sewing, and dance.
Eventually Foster moved to Montreal to live with her daughter, Eliza Cushing. She died on April 17, 1840 at the age of 81.