It depends on the Sonic and Flash you use, some versions of Sonic are faster than some versions of Flash. Seeing as there may be about over 50 versions of Flash I can't really give you an honest answer. Just know that some versions of Flash are slower than Sonic, some are faster than Sonic.
Fans often wonder who is faster, Sonic or Flash. Whether it's Barry Allen or Wally West, The Flash is the fastest speedster in the DC universe. Of course, Sonic the Hedgehog is the fastest being in his video game universe and he would make other speedsters jealous.
For sustained runs, Sonic clocks in at 767 miles per hour and his max speed reached is 186,000 miles per second, or in other words, the speed of light. Sonic can't sustain running at the speed of light, but he can regularly run faster than the speed of sound.
As a New God, the Black Racer is understandably faster than the Flash and is capable of speeds that allow him to run straight through Darkseid. During the Final Crisis, the Black Racer even took Darkseid as a substitute for Barry, as this was one of the ways that the Justice League used to defeat the evil New God.
Superhuman speed: Because of the low-key manner in which Wally created the original Flash's accident, Kid Flash was exceptionally slower than his mentor, at speeds approaching the speed of sound.
In a competition of speed between the Blue Blur and the Scarlet Speedster, it will take more than math and science to really comprehend their overall speed. However, taking all things we know into account, Flash would win a typical race against Sonic the Hedgehog and come out as the faster of the two.
Although Sonic possesses superhero-like speed that's essentially capable of stopping time, the frenetic action of the games is replaced with the speed limits of American highways, as a significant chunk of “Sonic the Hedgehog” settles into a road trip movie.
In short, Sonic was already pretty fast (for a hedgehog) when he first encountered Dr Robotnik. Robotnik provided him with "power sneakers" and allowed him to train on his "kinetic gyratoscope", resulting in Sonic being able to run at super-sonic speed.
As Dark Sonic, Sonic demonstrates light-speed movements, high enough to tear through a robot multiple times within a second simply by dashing through it, while not even being visible.
Despite his small appearance, Sonic the Hedgehog has a max speed of 186,000 miles per second and travels at a speed of 767 miles per hour. His light-speed shoes allow him to run faster than the speed of light and fight the evil genius who wants to use him in an experiment.
Dash is impressive and can outrun bullets and run on water (Making him around Speed of Sound.) but it's nothing compared to Sonic. Classic Sonic was able to run so fast he time traveled (FTL=Faster than Light) and he's outrun a Black Hole until he ran out of room to run.
In the series Flash Forward, it was determined that Wally West is the fastest being in the whole Multiverse.
Reverse Flash easily takes this due to his bs and insane paradox immunity. Nothing Sonic has or can do is going to be able to put him down for good, and Reverse Flash shares, more or less, the same abilities and powers the other Flashes have, meaning this will be a literal repeat of Wally vs Sonic no matter what.
The two heroes have raced several times since then, in the comics, cartoons and movies. As a general rule, the comics claim that The Flash is the faster hero, with Barry Allen, Wally West and even an octogenarian Jay Garrick having outrun Superman over the years.
Though better and more winning than what might have been expected, Sonic's a little too unwitting to outrun its own self.
Sonic does not need any technological enhancements to create his super-speed - he's able to run fast with or without his shoes- but the Power Sneakers are nonetheless a crucial part of his equipment.
infinite speed is: The ability to move infinite distance in finite time without the aid of teleportation. This implies that Sonic's speed is far above infinite speed since he can reach speeds higher than that. However he does have speed feats that are on Inaccessible level tho.
Sonic's only weakness is that he cannot swim, sinking like a rock if plunged to a deep body of water. The reason for this is because Yuji Naka had a misunderstanding about hedgehogs not being able to swim. The only exception is that he can swim in the Sonic the Hedgehog Adventure Gamebooks.
Sonic loses his speed when lightning strikes a nearby Combot, but regains it when he obtains three rings.
Conceptual Manipulation: With Chaos Energy, Sonic is able to rewrite or destroy the very concepts that shape reality. As shown as when the Chaos Force and Illumina were erased during Sonic's attempt to reverse the Super Genesis Wave, as they are both confirmed to no longer exist in the Post-Super Genesis Wave timeline.
Mario's determination, strength, and willpower are unlike any human being, though, and given certain circumstances, Mario would easily beat Sonic. This is reliant on his power-ups, power of the elements, and his allies, though, while Sonic doesn't really need anything except his blinding speed.
Although Shadow isn't as fast as Sonic, he isn't too far behind. Without his shoes, however, he's not nearly as fast. The aforementioned power levels of Shadow have all been him at his basic form. Due to his natural ability to harness chaos energy, though, Shadow can far exceed his usual abilities.
With tremendous willpower, Superman manages to push past the Flash right at the finish line and take home the victory, forcing Lex to donate a billion dollars to charity as promised.