I generated a world with a free game inspired by Minecraft, then opened its save file. The world has 222 million blocks. The cubes take 11.2 MB, and the whole database file is 14 MB. Stored the obvious way, those blocks would weigh 888 MB. This guide shows where the other 98 percent goes, with the numbers I measured and the code to measure your own world.
NOT AN OFFICIAL MINECRAFT PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT. The measurements come from VoxeLibre on the Luanti engine. Where Minecraft differs, the text says so and cites its documentation.
The shape of the world
A world like this is not one giant object. It is cut into cubes of 16 blocks on each side, 4,096 blocks per cube, and the game only keeps the cubes near you. Walk to a place nobody has visited and the game generates the cubes there. That is why the world feels endless: nothing exists on disk until someone goes there.
Minecraft cuts its chunks into sections of the same size, 16 x 16 x 16. In the main world a chunk is 16 blocks wide, 16 deep and 384 tall.
The obvious size
My world has 54,188 cubes, which is 221,954,048 blocks. This game spends 4 bytes on each block: 2 for its type, 1 for light and 1 for extra data. That makes 16,384 bytes per cube, and 54,188 cubes would take 887,816,192 bytes, about 888 MB.
On disk the cubes take 11,197,091 bytes, about 11.2 MB. That is 79 times smaller, and nothing was thrown away. The database that holds them adds its own keys and pages, so the whole file is 14 MB after cleaning it up (17 MB as the game left it).
Most cubes are boring
The first trick is to notice that most cubes are uniform. I sampled 3,000 random cubes: 69 percent contain one single kind of block, and most of those are air above the ground. The median cube takes 48 bytes in the file, for 4,096 blocks. The game does not store 4,096 identical blocks. It stores the block once, and the fact that it fills the cube.
A palette
Cubes that are not empty still repeat a lot. Each cube keeps a short list of the block types it really contains, its palette. On average the list has 3 entries. Instead of a name for every block, the cube writes a small number that points into the list.
With 3 entries two bits are enough per block. In my calculation, packing the numbers shrinks an average cube from 16,384 bytes to about 800. Minecraft uses the same idea: each section keeps a palette of block states and an array of packed indexes, as the Minecraft Wiki describes.
Counting repeats
The third trick is to count repeats instead of writing them out: stone, stone, stone, stone becomes stone times four. Terrain comes in layers, so identical blocks sit in long streaks. In my sample an average cube has only 96 runs of identical blocks out of 4,096. At 3 bytes per run that would be about 290 bytes, before any real compression. That figure is my own calculation, not a format the game uses.
Compression
General-purpose compressors hunt for repeated patterns on their own. This game uses zstd. Classic Minecraft uses zlib, and the Minecraft Wiki lists LZ4 as an option that can be enabled in the server settings. After everything, the average cube in my save takes 216 bytes, lighting included, about 76 times smaller than the obvious 16,384. The busiest cube I found, a cliff, took 3,417 bytes.
Finding a cube
There is one more problem: finding a cube among 54,188. Minecraft groups 32 x 32 chunks into one region file. The file starts with a table of 1,024 entries, one per chunk, and the entry for the chunk at x and z is number x + 32 z. It says where the chunk starts, counted in 4 KiB sectors, and how many sectors it takes.
No searching, just a calculation: an array index, like the jump of a hash table, with coordinates as the key. The game I measured keeps its cubes in a database table with the position as the key and finds them through an index instead.
A billion blocks
At the rate I measured, 0.05 bytes per block, one billion blocks would take about 50 MB of cube data. That is an estimate: oceans make cubes simpler, and caves and ores make them busier. The idea holds anyway: you pay for what is different, not for what is there.
Measure your own world
A Luanti world keeps its cubes in map.sqlite (on macOS: ~/Library/Application Support/minetest/worlds/<name>/). This needs Node.js 24 or newer:
import {DatabaseSync} from 'node:sqlite';
const db = new DatabaseSync('map.sqlite', {readOnly: true});
const {n, bytes} = db.prepare('SELECT count(*) AS n, sum(length(data)) AS bytes FROM blocks').get();
console.log(n, 'cubes,', bytes, 'bytes,', Math.round(n * 4096 * 4 / bytes), 'times smaller than 4 bytes per block');
Cheat sheet
- A cube is 16 x 16 x 16 = 4,096 blocks. Only visited cubes exist on disk.
- Uniform cubes cost almost nothing: one block type and “fills the cube”.
- A palette turns names into small numbers; with 3 entries, 2 bits per block.
- Counting repeats beats writing them, because terrain comes in layers.
- A compressor squeezes what is left: zstd here, zlib in classic Minecraft.
- Region file entry = x + 32 z; the entry points to 4 KiB sectors.
Sources
- Minecraft Wiki, “Chunk format”: sections of 16 x 16 x 16 blocks, palette and packed block states: https://minecraft.wiki/w/Chunk_format
- Minecraft Wiki, “Region file format”: 32 x 32 chunks, 4 KiB sectors, 1,024-entry header, compression types (zlib, LZ4): https://minecraft.wiki/w/Region_file_format
- Luanti engine, world format notes (
doc/world_format.mdin the source repository): https://github.com/luanti-org/luanti - VoxeLibre, the game used for the measurements (GPLv3; textures based on Pixel Perfection by XSSheep): https://git.minetest.land/VoxeLibre/VoxeLibre
- Measured on one macOS machine, 2026-11-03, with
tools/voxel-measure.mjs: 54,188 cubes, 3,000 sampled for the per-cube figures.
Glossary
- Chunk or cube
- A small block of the world that is loaded and saved as a unit. Here it is 16 x 16 x 16 blocks, which is 4,096 blocks.
- Palette
- A short list of the block types a cube really contains. Each block then stores a small number that points into the list.
- Run-length encoding
- Writing a repeated value once together with how many times it repeats.
- zstd, zlib, LZ4
- General-purpose compressors. They find repeated patterns by themselves and trade speed against size.
- Region file
- In Minecraft, one file that holds 32 x 32 chunks and starts with a table of 1,024 entries.
- Sector
- A 4 KiB piece of a region file. Each chunk takes a whole number of sectors.
- Seed
- The number a world generator starts from. The same seed and settings give the same terrain.
- Naive size
- The size if every block took a fixed number of bytes, with no tricks.
- Overhead
- The space a container uses for its own bookkeeping, such as a database's keys and pages.
Practice
Try these before opening the answers.
How many blocks are in a 16 x 16 x 16 cube?
16 x 16 x 16 = 4,096 blocks.
A cube uses a palette of 5 entries. How many bits does each block need, and how many bytes for 4,096 blocks?
5 entries need 3 bits (2 bits only reach 4 entries). 4,096 x 3 / 8 = 1,536 bytes, plus the palette itself.
In a region file, which table entry holds the chunk at x = 10 and z = 2?
10 + 32 x 2 = 74, so entry 74 of the 1,024.
At 4 bytes per block, how big are 1,000 cubes stored the obvious way?
4 x 4,096 x 1,000 = 16,384,000 bytes, about 16.4 MB.
Frequently asked questions
How does Minecraft store an almost infinite world in a small file?
It only saves the chunks that have been generated, and it stores each 16 x 16 x 16 section with a palette of block types and a packed array of small indexes, then compresses the chunk. Regions of 32 x 32 chunks live in one file.
Is the Minecraft world really infinite?
No. It feels endless because chunks are generated when you reach them, but the world has limits. Nothing about an unvisited place exists on disk.
Why is most of a world so cheap to store?
Most cubes are uniform, usually empty air above the ground, and a uniform cube needs one block type and a note that it fills the cube. In the world I measured, the median cube took 48 bytes.
Are these measurements from Minecraft itself?
No. They come from VoxeLibre, a free game inspired by Minecraft that runs on the Luanti engine, because its save file can be opened with a few lines of code. Minecraft's own format is documented on the Minecraft Wiki and follows the same ideas, with differences that this guide points out.
Keep this guide: free PDF
9 pages with the diagrams, the code, a glossary and practice questions, ready to print or save.
Free, 9 pages. The email is optional: leave it empty and the PDF downloads anyway. If you add it, I send new guides and nothing else. Privacy
