Ranger, 22, was given the boot by Newcastle last season after a string of off-field incidents - including being found guilty of assault.
He is also currently on bail following a rape charge - an allegation he denies - and told the Daily Star: "I know what is expected of me and want to get my career back on track.
"I feel that Swindon will give me a solid platform to realise my potential and help me from going off the rails.
"I want to do my talking on the pitch and perform to the level I know I can. It is time to clean up my act.
"I want to channel my energies back into football and feel the discipline and environment of the club will enable me to do this."
For the big stories and the banter follow us on Twitter: @tribalfootball