Born with a heart defect, Swanson underwent a number of operations as a youngster, including a heart bypass at the age of thirteen. After overcoming his health problems, Swanson played for Hutchison Vale and Leith Athletic before joining Berwick Rangers, making his debut at the start of the 2005–06 season. Playing the majority of Scottish Third Division matches that season, a knee injury restricted him to just three league appearances the following season when Berwick were promoted to the Scottish Second Division, although he started the 2007–08 season injury-free.
Dundee United
Swanson completed a move to the Scottish Premier League with Dundee United on 1 January 2008 after agreeing terms in October 2007, having previously turned down a move to Hamilton Academical. Making his debut the following day as a substitute in the 4–1 win over Hearts, Swanson scored his first goal for United in a 2–0 victory over Motherwell in March 2008, going on to feature in a number of matches that season. In 2008–09, Swanson was used mainly as a substitute, starting in only seven of his 30 league appearances. In the 2009–10 season, Swanson started United's opening three league matches, assisting three of the club's four goals in the process. His good performances for United meant that Swanson was selected for the Scotland squad in October 2011. Soon afterwards, however, Swanson strained a medial ligament. At the end of the 2011–12 season, Swanson's contract expired and he opened talks with Championship side Peterborough United over a possible move to England.
Peterborough United
On 6 June 2012, Swanson signed a two-year contract with English Championship club Peterborough United after making over 100 appearances for Dundee United.
Coventry City
On 3 July 2014, Swanson signed a two-year contract with Coventry City after rejecting a new contract at Peterborough United. Swanson signed on loan for St Johnstone for the latter part of the 2014–15 season on 3 February 2015. He returned to Coventry City for close season 2015, but had his contract terminated on 1 September 2015 by mutual consent.
Heart of Midlothian
Swanson signed for Heart of Midlothian on 9 September 2015, agreeing a contract to the end of the 2015–16 season.
St Johnstone (second spell)
After just five months with Hearts, Swanson signed for his former side St Johnstone in February 2016 on an 18-month deal. In April 2017, Swanson brought St Johnstone in to disrepute after becoming involved in an on-pitch brawl with teammate Ricky Foster. Both players were suspended by the club and were subsequently fined four weeks' wages.
Hibernian
On 25 April 2017, Hibernian announced that they had signed Swanson on a pre-contract agreement. Injuries restricted his appearances for Hibs in the first part of the 2017/18 season. Swanson was linked with a return to St Johnstone in January 2018, but he decided against this. His contract with Hibs was cancelled on 31 August 2018.
St Johnstone (third spell)
After his release from Hibernian, Swanson resigned for St Johnstone in September 2018, stating that he was "at his happiest" whilst playing for the Perth club. He was released by the club in May 2020.
East Fife
On 30 July 2020, Danny Swanson signed for East Fife, on a two-year deal.