This happens when the level.dat file is corrupted. You can try the following to restore it from backup.
- Browse to the world folder in .minecraft/saves/
- Delete or rename level.dat.
- Rename level.dat_old (this is a backup file) to level.dat.
- Start Minecraft and check to see if the world appears.
If the above doesn’t work it means the backup file is also corrupted. Unfortunately this means player data, world seed and spawn locations won’t be recoverable
You may be able to recover your structures though!
- Create a new world with the same name as the old one. If you know the previous world seed enter it now.
- Copy its level.dat file over the corrupted file.
- Start Minecraft (you will see both the old and the new worlds now) and open the old world. You’ll probably appear in a different place
- Look around for your buildings. If you know your base co-ordinates then head there.
- If it’s working, excellent! If you created the world with a different seed you may see some chunk border issues, but the game should run as expected.