
World file format explained · Bedrock · Advanced
How Minecraft Bedrock Stores Worlds: LevelDB Keys, .ldb, and .log Files Explained
Unlike Java Edition's grid of region files, Minecraft Bedrock Edition stores its entire world inside a high-performance key-value database called LevelDB. Understanding how `.ldb` files, `.log` files, and binary chunk keys work is essential for advanced debugging, world recovery, and low-level NBT editing. Because our browser-based tools process these database files locally on your device without ever uploading them, you can safely inspect and modify complex world records with zero server lag or privacy risks.
What you need
- A Minecraft Bedrock Edition world folder or .mcworld archive
- A complete backup copy of your world folder stored in a safe location
- Access to our browser-based LevelDB Inspector and Bedrock NBT Editor tools
Step by step
1Back Up and Locate the Bedrock World Structure
Before inspecting or modifying any database records, duplicate your entire world folder to create a safe backup. Open your Bedrock world directory and verify the top-level files: `level.dat` (which holds global rules and player spawn data), `levelname.txt`, and the critical `db/` subfolder. Unlike Java Edition, which separates dimensions into different folders, Bedrock packs the Overworld, Nether, and The End together inside this single `db/` directory. Having a backup ensures that if a database index becomes misaligned during manual editing, you will not permanently lose your build.
Tip: Always close Minecraft completely before copying or opening a world folder so the database finishes writing active data to disk.
2Examine the .ldb, .log, and MANIFEST Files in the db/ Folder
Navigate inside the `db/` folder to view the raw LevelDB structure. You will see several `.ldb` files (sorted tables holding the bulk of your terrain and entities), a `.log` file (the write-ahead log capturing the most recent unsaved changes in plain binary before compaction), and a `MANIFEST` file (which tracks the active file versions and database states). You will also see a `CURRENT` file, which is a simple text pointer telling the game which `MANIFEST` file is currently valid. If you are using our browser tool, select Open world folder or .zip -> LevelDB Inspector to load this entire directory into memory locally.
Tip: In older Bedrock versions, `.ldb` files sometimes used the `.sst` extension, though they function identically.
3Decode Chunk Coordinates and Dimension IDs from Binary Keys
In the LevelDB Inspector, browse the list of raw hexadecimal keys that index every piece of data in the world. Chunk keys are strictly structured by byte length: the first 4 bytes represent the Chunk X coordinate as a 32-bit signed Little-Endian integer, followed by 4 bytes for the Chunk Z coordinate. If the chunk belongs to the Nether (Dimension 1) or The End (Dimension 2), an additional 4-byte Little-Endian integer is inserted right after the Z coordinate; Overworld chunks completely omit these 4 dimension bytes to save space. Our tool automatically translates these 8-byte and 12-byte prefixes so you can search for specific chunk coordinates directly.
Tip: To calculate a chunk coordinate from a block coordinate, divide the block X or Z by 16 and round down towards negative infinity.
4Identify Record Type Tags and Subchunk Prefixes
Look at the single byte immediately following the coordinate and dimension bytes in any chunk key; this is the Tag byte that defines what kind of data the record holds. For example, hex tag `0x2F` (decimal 47) indicates a Subchunk Terrain Prefix, `0x31` (49) holds Block Entities like chests and signs, and `0x32` (50) stores pending Tick Lists. If the tag is `0x2F`, one extra byte is appended to the very end of the key to represent the Subchunk Y index (ranging from `-4` to `19` in modern worlds to cover Y `-64` to `320`). Click on any `0x2F` record in the LevelDB Inspector to view its raw palette of block states and 16x16x16 voxel grid.
Tip: If you are unsure which tag corresponds to a specific mechanic in a new update, check the tag translation dropdown inside the LevelDB Inspector.
5Inspect Little-Endian NBT Records and Global Keys
Not all LevelDB keys start with chunk coordinates; several use human-readable ASCII strings to store global or player states. Filter the key list for strings like `~local_player` (your singleplayer inventory and position), `portals`, `mobevents`, or `AutonomousEntities`. When you click one of these keys, or a `0x31` Block Entity key, use the Bedrock NBT Editor view to parse the binary value. Bedrock encodes all NBT numbers in Little-Endian format (least significant byte first) and compresses the database blocks using Zlib, which our browser tool decompresses on the fly so you can edit values cleanly and save a new `.zip` or world folder.
Tip: When editing `level.dat` in the Bedrock NBT Editor, remember it carries an 8-byte header (4 bytes for version, 4 bytes for payload size) before the root compound tag begins.
How it works
LevelDB relies on a Log-Structured Merge-tree (LSM) architecture, which is optimized for fast sequential writes on mobile devices and consoles. When you break a block or open a chest, Minecraft does not immediately hunt down and overwrite an existing `.ldb` file. Instead, it appends the update to the active `.log` file and holds it in memory. Once the log reaches a specific size threshold, LevelDB flushes it into a newly numbered `.ldb` table and runs background compaction to merge duplicate keys and discard outdated chunk records.
Because LevelDB is purely a flat key-value store with no built-in concept of 3D space, Minecraft simulates a relational hierarchy by concatenating binary integers into the key name. By placing Chunk X, Chunk Z, and the Dimension ID at the very front of the key, all records for a single 16x16 column of the world sort next to each other alphabetically in byte order. This allows the game engine to load an entire chunk by performing a fast sequential iterator scan from the chunk's base coordinate key through all of its attached tag bytes.
Inside the values, Bedrock deviates from Java Edition in two major ways: endianness and subchunk palette storage. While Java uses Big-Endian networking order for its NBT, Bedrock writes Little-Endian integers directly matching modern CPU architectures, avoiding byte-swapping overhead. Furthermore, subchunk records (`0x2F`) do not use NBT for block layouts; they use a bit-packed array paired with an inline block-state NBT palette, typically starting with a version byte (such as version 8 or 9) that dictates how many layers of blocks (like waterlogging) exist in that 16x16x16 cube.
Common mistakes
- Deleting `.log` or `MANIFEST` files assuming they are just crash reports or temporary junk; deleting them destroys recent progress and renders the `.ldb` database unreadable.
- Manually editing a single `.ldb` file in a standard hex editor, which invalidates internal CRC checksums and triggers LevelDB to discard the entire table as corrupted.
- Forgetting the 8-byte header when manually parsing `level.dat`, which causes standard NBT parsers to fail on the very first byte.
- Confusing Overworld keys with Nether or End keys by reading the 9th byte as the record Tag without checking whether the key is 9 bytes (Overworld) or 13 bytes (Nether/End) long.
FAQ
Why do I see multiple .ldb files instead of files named after region coordinates like r.0.0.mca?
LevelDB sorts and groups data by key order across tiered tables rather than spatial region files. A single `.ldb` file can contain chunks from the Overworld, the Nether, and player inventories all mixed together depending on when they were last modified and compacted.
How does Bedrock store modern entity data if tag 0x32 is no longer used for mobs?
Modern Bedrock versions decoupled entities from chunk keys to prevent entity loss during chunk border movement. Mobs and dropped items are now indexed using an `actorprefix` key paired with a unique 8-byte Actor Digest ID, while chunks keep a separate digest list pointing to which actors currently reside inside them.
Can I recover a world if the CURRENT file is missing or blank?
Yes. Because the `CURRENT` file is just a plain text file containing the filename of the latest `MANIFEST` (for example, `MANIFEST-000014` followed by a newline), you can inspect your `db/` folder to find the highest-numbered manifest file and recreate the `CURRENT` text file to match it.
Minecraft Bedrock Edition worlds use a LevelDB database inside the `db/` folder that combines Little-Endian coordinate keys, single-byte record tags, and Zlib-compressed NBT payloads across `.ldb` and `.log` files to deliver fast cross-platform storage.