The club was formed by a group of friends from the Heart of Midlothian Quadrille Assembly Club. The group of friends bought a ball before playing local rules football at the Tron from where they were directed by a local policeman to The Meadows to play. Local rules football was a mix of rugby and football as we know it. In December 1873 a match was held between XIs selected by Mr Thomson from Queens Park and Mr Gardner from Clydesdale at Raimes Park in Bonnington. This was the first time that Association rules had been seen in Edinburgh. Members from the dance club viewed the match and in 1874 decided to adopt the association rules. The new side was Heart of Mid-Lothian Football Club. The exact date of the club’s formation was never recorded; however, 1874 is regarded as the year of formation as it was when association rules were taken on, although Tom Purdie claimed the club was formed in 1873. The earliest mention of Heart of Midlothian in a sporting context is a report in The Scotsman newspaper from 20 July 1864 of The Scotsman vs Heart of Mid-Lothian at cricket. It is not known if this was the same club who went on to form the football club, but it was common for football clubs in those days to play other sports as well.
The club took its name from the Heart of Midlothian jail, which was demolished in 1817 but was kept fresh in the mind by Walter Scott’s novel The Heart of Midlothian.