Henrietta Keddie was born at Cupar, Fife, on 4 March 1827 to Philip Keddie (1793/4–1852), a lawyer, and his wife, Mary, née Gibb (d. 1869), and spent her childhood summers at Grange Farm, outside Elie and Earlsferry, where her father owned a coalmine. She was educated by an older sister, Margaret, and then attended school in Leith for a time.
The family broke up in the 1840s, although the "Grange collieries" continued to operate to some extent up to the early 1860s. In 1848, Henrietta and three of her sisters set up a school in Cupar. In 1869, after the death of her parents and most of her siblings, she and Margaret moved to Blackheath, London, and then to Kensington. Left alone after Margaret's death in 1880, Henrietta went on a continental tour with friends and an adopted daughter in 1884, and then moved to Oxford for twenty years and Bristol for two, before returning to London, where she died in Belsize Park Gardens on 6 January 1914.
Keddie began writing in the 1850s. Her first two novels failed to sell, however. Her first paid story was "Meg of Elibank", based on a local Selkirk tradition, which appeared in Fraser's Magazine in 1856. Some of her earliest publications appeared in Blackwood's Magazine, others in Cornhill Magazine, Good Words and the Sunday Magazine. These efforts introduced her to some writers and intellectuals, such as Dr John Brown, Isabella Bird and Margaret Oliphant. Her circle grew in London to include the historian J. A. Froude, Dinah Craik, Mrs Henry Wood, Jean Ingelow and others.
As a prolific writer of novels under the name Sarah Tytler, Keddie was an exponent of domestic realism, which was notably popular among female readers. Her first novel, The Kinnears. A Scottish Story (1852) went unnoticed, but she began to build up a following, particularly after her move to London. Many of her novels had an 18th-century background, including Citoyenne Jacqueline (1865) set in the French Revolution. In relation to her novel Beauty and the Beast (1884), about a private soldier who inherits a baronetcy, the literary biographer Rosemary Mitchell writes, "Although the plot is sensational, her talent for original and sympathetic characterization is considerable and her perception of the problems of social divisions keen and realistic." Saint Mungo's City (1884, about Glasgow) was unusual in focusing on urban, rather than rural Scotland. Perhaps her most famous book was Logie Town (1887), set in her home village of Cupar.
Keddie's work for children and young people was also popular. Papers for Thoughtful Girls (1862; the 1866 edition had illustrations by the Pre-Raphaelite painter John Everett Millais) and Sweet Counsel. A Book for Girls (1866) covered subjects such as intellect, friendship, self-sacrifice and fashion, revealing "moderately progressive views on women's roles." She also did educational work, such as Musical Composers and their Works (1875) and The Old Masters and their Pictures for the Use of Schools and Learners in Art (1880), and biographical compendia such as Six Royal Ladies of the House of Hanover (1898). Another book of hers was Jane Austen and Her Works (1880), although a later Jane Austen biographer complained that she simply "filled her book with résumés of the novels." Her final work was Three Generations: The Story of a Middle-Class Scottish Family (1911).
The Spectator, reviewing the novel The Blackhall Ghosts on 12 January 1889, had mixed feelings about the characterization: "The writer has made a fine character of Joanna Endicott. Queer she seemed to those who failed to see through her disguise, and she is almost an enigma to us.... However, she is a dignified woman, with deep feelings and a wonderful self-control, and her strange behaviour springs from one overpowering sentiment, the love of home and family. In her the writer has evidently embodied what she believes to be the ideal of a self-reliant, self-controlled woman, animated by a deep-rooted passion. As for her sister Celia, we must frankly say we do not understand her; she is a most extraordinary young lady, and is obviously overdrawn. A more nasty, cruel, and unnatural creature we have never met with in fiction.... Lucy's silliness is probably exaggerated, though she is by far the most natural.... All these portraits require more shading; they are too deeply lined, we might almost say, dug in."