The level.dat file stores your world's settings and player data

Level.dat is a single file that Minecraft creates for every world you start. It holds the core information that makes your world work: the world name, the game mode (Survival, Creative, Hardcore), the time of day, the weather, and which player created it. Without this file, Minecraft cannot recognize the folder as a valid world.

The file sits in your world folder — the same folder that contains all your terrain data, structures, and player inventory files. When you load a world, Minecraft reads level.dat first to know what settings to apply. If the file gets corrupted or deleted, your world becomes unplayable, though the actual terrain data usually survives.

Key Takeaways

  • Level.dat is a binary file that stores world name, game mode, spawn point, time, and weather for each world.
  • The file lives in your world folder and must be present for Minecraft to recognize the world as valid.
  • Corrupted level.dat files can be recovered using backup copies or third-party repair tools designed for Minecraft.
  • You can edit level.dat with NBT editors to change world settings like game mode or difficulty without starting over.
  • Java Edition and Bedrock Edition store level.dat in different locations and formats, so tools are not interchangeable between versions.

Where to find level.dat on your computer

The location depends on which version of Minecraft you play. In Java Edition, navigate to your .minecraft folder (hidden by default on Windows and Mac), then open the folder named after your world. Level.dat sits directly inside that folder alongside folders named region, playerdata, and data.

On Windows, the .minecraft folder is usually at C:\Users\[Your Username]\AppData\Roaming\.minecraft. On Mac, it is in ~/Library/Application Support/minecraft. On Linux, it is in ~/.minecraft. If you cannot see the AppData folder on Windows, enable "Show hidden files" in View options.

In Bedrock Edition (Windows 10/11, console, mobile), the world data is stored differently and level.dat is harder to access directly. Bedrock worlds are usually managed through the game itself rather than by editing files manually.

What happens when level.dat gets corrupted

A corrupted level.dat file usually means Minecraft cannot load the world at all. You may see an error message saying the world is damaged or unreadable. The terrain data underneath — all your buildings, terrain generation, and block placements — is usually still intact in the region files, but you cannot access it without a working level.dat.

Corruption happens most often when Minecraft crashes while saving, when your computer loses power during a save, or when antivirus software interferes with file writing. It can also occur if you move or copy the world folder while the game is running.

Recovering a corrupted level.dat file

The fastest recovery method is to restore from a backup. If you have a backup of your world folder from before the corruption happened, replace the broken level.dat with the one from the backup. Most backup tools (including Windows File History and Mac Time Machine) can restore individual files from previous dates.

If you have no backup, you can try using an NBT editor like NBTExplorer or Minecraft Region Fixer. These tools can sometimes read and repair a partially corrupted level.dat, or they can generate a new one using the settings from your region files. Download the tool, point it at your world folder, and follow its repair or recovery option. Success depends on how badly the file was damaged.

As a last resort, you can create a new level.dat by starting a new world with the same name and settings, then replacing only the level.dat file while keeping your original region folders. This preserves your terrain and buildings but resets some world data like the spawn point and time of day.

Editing level.dat to change world settings

You can use an NBT editor to change world settings without starting over. Common edits include switching from Survival to Creative mode, changing the difficulty, moving the spawn point, or adjusting the world border. Open your level.dat in an NBT editor like NBTExplorer, find the setting you want to change (such as GameType for game mode), edit the value, and save.

Game mode values are: 0 for Survival, 1 for Creative, 2 for Adventure, and 3 for Spectator. Difficulty values are: 0 for Peaceful, 1 for Easy, 2 for Normal, and 3 for Hard. After editing and saving, load the world in Minecraft and the changes take effect immediately.

Be cautious when editing — a mistake can corrupt the file again. Always make a backup copy of level.dat before opening it in an editor, and only change the specific value you intend to modify.

Level.dat in Java Edition versus Bedrock Edition

Java Edition stores level.dat as a binary NBT file that you can edit with third-party tools. Bedrock Edition uses a different format (levelname.txt and level.dat with different structure) that is harder to modify manually. Tools designed for Java Edition will not work on Bedrock worlds, and vice versa.

If you play on multiple platforms, keep this in mind when moving worlds or troubleshooting. A Java Edition world cannot be directly converted to Bedrock format — you would need to use a conversion tool like Chunker or World Converter, and even then, some features may not transfer perfectly.

Backing up your level.dat to prevent loss

The simplest prevention is to enable automatic backups. In Java Edition, you can use the backup feature in launchers like MultiMC or Prism Launcher, which automatically save copies of your worlds at regular intervals. Alternatively, use your operating system's built-in backup tool: Windows File History, Mac Time Machine, or Linux rsync scripts.

Manual backups are also quick: periodically copy your entire world folder to an external drive or cloud storage. If you play on a server, ask the server owner about their backup schedule — most servers back up worlds daily or weekly.

Frequently Asked Questions

Can I delete level.dat and regenerate it?

You can delete it, but Minecraft will not automatically regenerate it. Instead, the world becomes unplayable. You must either restore from a backup or use an NBT editor to create a new one. If you want to reset world settings, use an editor to modify the existing level.dat rather than deleting it.

What is the difference between level.dat and level.dat_old?

Level.dat_old is a backup copy that Minecraft creates automatically before saving changes to level.dat. If the current level.dat becomes corrupted during a save, you can sometimes restore by renaming level.dat_old to level.dat. This file is overwritten each time Minecraft saves, so it is only useful immediately after corruption occurs.

Why does my world say it is corrupted even though level.dat looks fine?

Corruption can also occur in the region files (the actual terrain data) rather than level.dat itself. If level.dat is intact but Minecraft still will not load the world, try using Minecraft Region Fixer to scan and repair the region files. You can also check the game log for specific error messages that point to which file is actually broken.

Can I copy level.dat from one world to another?

You can, but it will overwrite the destination world's settings. The terrain data stays separate (stored in region files), so copying level.dat changes the name, game mode, and spawn point of the destination world while keeping the terrain. This is useful if you want to convert a world to Creative mode or change its name without regenerating the terrain.

Is level.dat the same on single-player and multiplayer servers?

Yes, the format is identical. Multiplayer servers use the same level.dat file to store world settings. The difference is that servers also store player data separately in the playerdata folder, whereas single-player worlds store your inventory in level.dat itself. Editing level.dat on a server affects all players on that server.