After discovering a small, blue, fast hedgehog, a small-town police officer must help him defeat an evil genius who wants to do experiments on him.
Sonic The Hedgehog arrives on Earth after being forced to leave his home due to villains wanting him for his superspeed powers. He enjoys his time there but is lonely until he meets Sheriff Tom Wachowski. After Sonic’s powers cause a major blackout, he is pursued by mad scientist Dr. Robotnik. Sonic tries to use his bag of rings to teleport him to a new home, but he loses them through a ring portal to San Francisco after Tom finds him and tranquilizes him. He reluctantly helps Sonic go find them after Robotnik finds them and tries to catch them.
After evading Robotnik and a few other problems, Tom gets help from his wife Maddie to help Sonic get home. They find the rings, but Robotnik finds them using one of Sonic’s quills to power his technology. Sonic gets Tom and Maddie to safety as he is chased across the globe by Robotnik, until they end up back in the Wachowskis’ home in Green Hills. Tom helps Sonic fight back against Robotnik, and they use a ring to send him to a mushroom planet.
Sonic stays on Earth with Tom and Maddie, but Robotnik is making plans to go back to Earth using Sonic’s quill. Meanwhile, Tails the fox arrives on Earth to find Sonic.
Sonic, an extraterrestrial blue hedgehog who can run at supersonic speeds, finds himself sought after by a tribe of echidnas for his power. His guardian, Longclaw the Owl, gives him a bag of rings that can create portals to other planets, using one to send him to Earth while she protects him from the echidnas, and also gives Sonic a map to a planet filled with mushrooms to use if he finds trouble on Earth. Ten years later, Sonic enjoys a secret life near the town of Green Hills, Montana, but longs to make friends. He idolizes the local sheriff, Tom Wachowski, and his veterinarian wife, Maddie, unaware the pair are planning to relocate to San Francisco soon, as Tom has been hired by the San Francisco Police Department.
One night, Sonic becomes upset over his loneliness when playing baseball by himself, and runs at supersonic speed as a result, inadvertently triggering an electromagnetic pulse that knocks out power across the Pacific Northwest. Roboticist and scientific genius Doctor Robotnik is enlisted by the United States Department of Defense to uncover the source of the outage. Robotnik discovers and tracks Sonic, who hides in the Wachowskis’ shed. Tom discovers Sonic and accidentally shoots him with a tranquilizer, causing him to send his bag of rings through a portal to San Francisco. Tom reluctantly agrees to help Sonic before Robotnik arrives at the Wachowskis’ house and the two flee. As the pair evade Robotnik, who labels Tom a domestic terrorist, they slowly bond, with Tom learning about Sonic’s desire for a real friend.
Robotnik comes across one of Sonic’s quills, discovering the power in it has the potential to fuel his robots, and becomes obsessed with capturing Sonic. As he tracks them down, Tom discusses his plans to leave Green Hills, which Sonic disapproves of. Shortly after defeating a robot sent by Robotnik, an explosion injures Sonic. Arriving at San Francisco, Tom brings him to Maddie, who revives him. While Tom explains about their situation to Maddie, Sonic receives a new pair of sneakers from Maddie’s niece. The group heads to the Transamerica Pyramid, where Sonic’s bag of rings landed, and recover them. Robotnik arrives in a hovercraft and attacks them, forcing Sonic to use a ring to send Tom and Maddie back to Green Hills.
Sonic flees from Robotnik, who uses the power of Sonic’s quill to match his speed. The two engage in a chase across the world, ultimately returning to Green Hills. Robotnik incapacitates Sonic, but Tom and the other townsfolk intervene, allowing Sonic to regain his strength and reclaim his lost energy. Overcoming Robotnik, Sonic defeats him by sending him to the mushroom planet. Following the incident, Tom and Maddie decide to stay in Green Hills and let Sonic live with them. The US government erases all evidence of the events, including records of Robotnik’s existence. Meanwhile, an insane Robotnik, still in possession of Sonic’s quill, begins plotting his revenge.
In a mid-credits scene, Tails, an extraterrestrial fox, emerges from a ring portal in search of Sonic.
The film opens with Sonic the Hedgehog (Ben Schwartz) narrating about his life. He lived in the Green Hill Zone under the care of an owl called Longclaw (Donna Jay Fulks). Because of his superspeed powers, Longclaw urges Sonic to keep his powers hidden, but he loves being able to go as fast as he can. He attracts the attention of a tribe of echidnas, who attack Longclaw’s home. To keep him safe, she gives Sonic a bag of rings that will transport him wherever he needs to go, and she sends him through a ring to Earth. Sonic tries to run back to her, but the portal closes as she holds off the tribe.
Ten years later, Sonic has been hanging out in Green Hills, Montana, living in a cave by himself. He spies on Sheriff Tom Wachowski (James Marsden) and his wife Maddie (Tika Sumpter), whom he has nicknamed “Donut Lord” and “Pretzel Lady” because they’re always eating those. The only person in town who has seen Sonic is a town loon named Crazy Carl (Frank C. Turner), who calls Sonic “the blue devil.” Tom has recently applied to a job in San Francisco, and he has been accepted, but he knows it would be a to ask Maddie to move out there for him.
Sonic watches a little league game going on, and later plays on the field by himself. Although he has fun, he truly feels lonely. He runs across the field and creates an electromagnetic pulse powerful enough to knock out the power across the Pacific Northwest. Tom’s fellow officer Wade (Adam Pally) is receiving calls at the station from everyone in town, and he alerts Tom to the situation.
The Department of Defense suspects something dangerous going on, so they reluctantly enlist the aid of brilliant but arrogant scientist Dr. Robotnik (Jim Carrey). He arrives with his assisstant Stone (Lee Madjoub) and assumes authority over Major Bennington (Neal McDonough). Robotnik unleashes his horde of drones to scope out the area to find any trace of Sonic. The drones find one of his footprints, and Robotnik sets out to find the little hedgehog.
Sonic sees the army men hunting for him, so he runs to get everything from his cave as he prepares to toss a ring to take him to a mushroom planet. He ends up in the Wachowskis’ garage. Tom overhears him after talking about the blackout to Maddie, who is staying with her sister Rachel (Natasha Rothwell). Tom finds Sonic and hits him with a tranquilizer dart. A dazed Sonic sees Tom’s San Francisco t-shirt and drops one ring, opening a portal to the top of the Transamerica Pyramid building, and Sonic drops his bag of rings down there.
Tom brings Sonic inside and asks him a bunch of questions. Robotnik tracks Sonic’s location to the Wachowski house and forces his way inside after hearing a noise and then finding one of Sonic’s quills. Sonic reveals himself and freaks out Robotnik, leading Tom to punch him in the face and run away with Sonic. Robotnik takes the quill and has Tom declared a terrorist to have him become a wanted man.
Tom reluctantly agrees to take Sonic to San Francisco to get his rings back. They stop at a gas station where Tom uses a payphone to talk to Wade, who knows he’s in trouble. Unfortunately, Robotnik has already gotten to the station with his goons and knows Wade is talking to Tom. Sonic gets out of the car to check out the bar across the street. Tom finds him there, and although he urges Sonic to leave, Sonic wants to have fun before he goes home. They play darts and square dance before getting into a confrontation with some big guys, leading to a bar brawl. Sonic takes advantage of things by using his speed to mess with others before he and Tom have to resume running. They end up staying in a hotel where they bond as friends, but after Sonic falls asleep, Tom sees a news report of himself affirming his new criminal status.
Robotnik and Stone inspect the scene of the bar fight and is able to track Tom and Sonic’s location. They talk about Tom wanting to move out of Green Hills since he doesn’t feel like a real cop there, while Tom notes that Sonic just wants a real friend. He pursues them on the road using a vehicle of his own invention. After the two see this, Sonic taps into his powers after he gets emotional, and he manages to roll quickly against the vehicle to knock it over. It turns out to be some kind of nesting doll of drones as smaller drones come out to attack. They finally manage to destroy it, causing Robotnik to start freaking out over his failures to catch them, but Sonic is injured in the explosion. He then applies Sonic’s quill to his tech to provide him with the same power and speed.
Sonic and Tom finally arrive in San Francisco to Rachel’s house. Rachel doesn’t like Tom and is always trying to get Maddie to dump him, but Rachel’s daughter JoJo (Melody Niemann) likes him just fine. They meet Sonic after Maddie (who is a vet) tries to treat him, and JoJo gives him a fresh pair of sneakers after seeing that his are worn out. Knowing Rachel will give them problems, they tie her up and take her car to go to the Transamerica building.
The three make their way to the rooftop and find the bag of rings, but before Sonic can go, Robotnik and his drones find them. Sonic pushes Tom and Maddie off the roof and uses his speed to destroy Robotnik’s drones. He rushes down to toss a ring to transport Tom and Maddie back to Green Hills safely (well, mostly). Robotnik then chases Sonic as he uses his rings to go across the globe before winding up back in Green Hills. Robotnik knocks Sonic out, nearly killing him. Before Robotnik can proceed to do more damage, Tom steps in the way and says Sonic is his friend. This revives Sonic and gives him a power surge, just as the other Green Hills citizens stand in to defend him. Sonic fights back against Robotnik, and has Tom sneak up on the mad scientist and open a ring behind him. Sonic rolls hard and smashes Robotnik’s ship, sending him through the ring into the mushroom planet.
Sonic decides to stay on Earth, while Tom and Maddie decide to stay in Green Hills. A government agent shows up at the Wachowski home to reward them for their heroics…with an Olive Garden gift card. They also keep any information on the incident, as well as Robotnik, hidden. Tom and Maddie then show Sonic that they made a space for him in their attic for him to stay, recreating it to look like the room in his cave. Sonic is happy to be part of a real family.
In the mushroom planet, Robotnik has totally lost his mind and is now bald with a crazy moustache (just like his video game appearance). He still has Sonic’s quill and is making plans to return to Earth with it.
During the credits, another creature appears on Earth: Tails the fox (Colleen O’Shaugnessey). He is there to track Sonic down, and he uses his double tail to fly off and find him.