The cheats listed below are for the Sega Mega Drive and Genesis versions of Sonic the Hedgehog. Unless stated, they are not guaranteed to work in other versions or compilations including Sonic the Hedgehog.
At the title screen enter:
Up, Down, Left, Right. Then hold A and press Start. This will take you to the level select screen where you can jump into any stage you want, as well as access Sonic the Hedgehog’s hidden sound test.