Margaret Bayard was born on 20 February 1778 in rural Pennsylvania, the seventh of eight children born to Colonel John Bubenheim Bayard (1738–1807) and the former Margaret Hodge (1740–1780). At the time of her birth during the Revolutionary War, her father was serving with George Washington at Valley Forge. One of her first cousins was Rev. Charles Hodge (1797–1878). Her mother died in 1780, when Margaret was a toddler. Her father remarried to Mary (née Grant) Hodgson (d. 1785), a widow of John Hodgson of South Carolina. She died in 1785. John Bayard married again to Johannah White (d. 1834), sister of General Anthony Walton White (1750–1803).