What is the story of Sonic the Hedgehog
There are different storys for Sonic, the American story, and the European story (Japan does not really have a story for him).
American:
A blue Mobian hedgehog who is the fastest in the universe born in Mobius on day 162, 3220 Sonic's full name is "Olgilvie Maurice Hedgehog". He loves chili dogs. He's not the smartest but he's got plenty of heart. His only weakness is that sometimes he doesn't think before he goes into action. Sonic is the son of Jules and Bernie Hedgehog and is the nephew of Sir Charles the hedgehog. His parents, uncle, and dog were all roboticized by Dr. Ivo Robotnik (AKA Julian Kintobor) but they all still have free will and a mind of their own. His best friends are Miles "Tails" Prower and Knuckles the Echinda. He's also friends with the Freedom Fighters. In the Future year 3243 on Mobius, Sonic and Sally tied the knot and got married. The Kingdom of Acorn was currently under the rule of King Sonic and Queen Sally, who were married and had two children named Princess Sonia and Prince Manik.
EuropeanSonic explains to his animal friends how Robotnik, who has been terrorizing them, was actually once Dr. Ovi Kintobor, a benevolent scientist who only wanted to save the world from evil. Discovering his hidden laboratory before the transformation, Kintobor is stunned to find the small, brown, prickly hedgehog calling himself Sonic. They quickly become friends, and Kintobor shows Sonic around his lab, introducing him to the Retro-Orbital Chaos Compressor (R.O.C.C. for short). Maintained by Containment Rings (which are meant to be the rings one collects in the games), the R.O.C.C. is powered by six Chaos Emeralds floating within, tasked to absorb all the evil energy on the planet Mobius. However, without the final seventh emerald, the R.O.C.C. remains in a state of flux.
In the interim, Kintobor decides to study Sonic's speed, putting him on an experimental treadmill meant to gauge how quickly he could run. In no time, Sonic reaches the speed of sound, causing the treadmill to explode and turning his hue from dirty brown to a brilliant blue. Kintobor says it must be the "cobalt effect," and makes him a pair of frictionless shoes to allow Sonic to keep on hitting these speeds.
One fateful day, however, Kintobor asked Sonic to bring him a soda and a hardboiled egg, and due to the doctor's clumsiness, spilled the soda onto the control panel of the R.O.C.C., infusing him with the total collected evil energy stored within. The transformation, aided by the hardboiled egg, caused Kintobor to take on the shape of the egg, completing the process to turn the gentle doctor into the villainous Dr. Ivo Robotnik.