The 22-year-old was out of contract at the Globe Arena but because of his age, the Shrimps have received youth training compensation for him.
Mullin joined Morecambe in the summer of 2014 on a short-term deal after starting his career as a trainee at Huddersfield, and soon earned himself a three-year contract.
He scored eight goals in that first season, including a double in a 2-1 win at Cambridge.
In 2015/16, Mullin found the back of the net 10 times, as he did last season.
During his time at Morecambe, he made 67 starts and 73 substitute appearances.
Mullin is the third signing made by new Swindon boss David Flitcroft, the Wiltshire outfit currently rebuilding their squad ready for League Two after relegation.
He told Swindon's official website: "I had a great three years with Morecambe, it was an invaluable experience.
“Coming to a bigger club like this is great and everything is bigger, the town is bigger and there are more fans so there is going to be pressure.
"I’m relishing it and I can’t wait to start."
Mullin is the second player to depart Morecambe of late after coming out of contract - Ryan Edwards joined Plymouth Argyle for an undisclosed compensation fee earlier this month.