Fix a corrupted level.dat and restore level.dat_old

A world that vanished from the list or fails to load often has a damaged level.dat. Check it, restore the automatic backup, or rebuild it from a new world.

A world can disappear from the singleplayer list, show up without its name, or fail with an error when you open it. The terrain is usually fine: chunks live in region files, separate from level.dat. What broke is the small file that tells the game how to load everything else. A crash or power cut while saving, a full disk, or a sync tool locking the file can all leave it half-written.

First, copy the world folder

Before trying anything, copy the entire world folder somewhere else. Every step below replaces files, and you want to be able to start over.

Check whether level.dat is really damaged

Drop level.dat onto the editor.

  • It opens and you see a Data compound with sensible values: the file is readable. The problem is elsewhere, often a mod or data pack the world needs. Read the game's log for the real error.
  • It opens but looks wrong, for example an empty Data or missing LevelName and Version: the file was written incompletely.
  • The editor can't read it, or the file is 0 bytes: it is damaged.

In the last two cases, move on to the backup.

Restore level.dat_old

Each time Minecraft saves level.dat, it keeps the previous version next to it as level.dat_old. That copy is usually only minutes older.

  1. Close Minecraft.
  2. Rename level.dat to level.dat_broken. Keep it; you may need it later.
  3. Copy level.dat_old and rename the copy to level.dat.
  4. Open the new level.dat in the editor to check it reads correctly and has a Data compound.
  5. Start Minecraft and open the world.

On Windows, turn on file name extensions (File Explorer, View, File name extensions) so you can see the real names. Otherwise you may end up with level.dat.dat.

If both files are damaged

You can borrow a level.dat from a new world and adjust it.

  1. In the same Minecraft version, create a new world with the same seed, if you know it, and the same game mode. Quit it straight away.
  2. Copy the new world's level.dat into the damaged world's folder.
  3. Open it in the editor and set LevelName, GameType, allowCommands and the difficulty to match the old world. The spawn point can be moved too.
  4. Open the world and check it.

What you can lose, and what you keep

The answer depends on the version, because Java 26.1 split level.dat into several files.

Data1.21.11 and older26.1 and later
Singleplayer inventory and positionIn level.dat: lost with itSafe in players/data
Game rulesIn level.dat: reset to defaultsSafe in data/minecraft/game_rules.dat
SeedIn level.dat: taken from the new worldSafe in data/minecraft/world_gen_settings.dat
Terrain, builds, chestsSafe: stored in region files

With an older world and an unknown seed, new chunks will generate with a different seed than the old ones. Explored areas stay as they were, but expect sharp borders where new terrain meets old.

Other damaged files

The same rescue works for player files: <uuid>.dat_old sits next to each <uuid>.dat. For files in data, such as maps or the scoreboard, deleting a broken file makes the game start that data from scratch, which is often acceptable.

Avoiding it next time

  • Quit worlds with Save and Quit to Title, and wait for the world list before closing the game.
  • Keep worlds out of folders that cloud sync tools lock while uploading, or pause syncing while you play.
  • Back up regularly. A copy of the whole world folder is all it takes.

Ready to edit?Open the file in the editor: every value keeps its NBT type and the file is saved in its original format.