<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3ARegion_file_format</id>
	<title>Minecraft:Region file format - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3ARegion_file_format"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Region_file_format&amp;action=history"/>
	<updated>2026-04-21T22:19:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Region_file_format&amp;diff=93145&amp;oldid=prev</id>
		<title>SyncBot: Sync: new page from Minecraft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Region_file_format&amp;diff=93145&amp;oldid=prev"/>
		<updated>2026-04-21T11:09:28Z</updated>

		<summary type="html">&lt;p&gt;Sync: new page from Minecraft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{cleanup}}&lt;br /&gt;
{{outdated|edition=java|As of [[Minecraft:Java Edition 1.2.1|1.2.1]], this format is no longer used.}}&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Region file format&amp;#039;&amp;#039;&amp;#039; is the [[Wikipedia:Binary file|binary file format]] for storing Java Edition [[Minecraft:chunk]]s from [[Minecraft:Java Edition Beta 1.3|Beta 1.3]] to [[Minecraft:Java Edition 1.1|1.1]]. Each file stores a group of 32×32 chunks called a &amp;#039;&amp;#039;&amp;#039;region&amp;#039;&amp;#039;&amp;#039;.{{Efn|A total of 1024 chunks can be stored in the format, covering an area of 512×512 blocks.&amp;lt;ref&amp;gt;{{Citation|url=https://www.mojang.com/2012/02/new-minecraft-map-format-anvil/|title=New Minecraft Map Format, “Anvil”|author=[[Minecraft:Jens Bergensten|Bergensten, Jens]]|website=Mojang.com|date=February 14, 2012|archive-url=https://web.archive.org/web/20120302221152/https://www.mojang.com/2012/02/new-minecraft-map-format-anvil/|quote=Maximum build height has been increased to 256 (was 128)|archive-time=March 2, 2012}}&amp;lt;/ref&amp;gt;}} The format took the place of the [[Minecraft:Java Edition Alpha level format|Alpha level format]], which had been in use since the [[Minecraft:Infdev]] development phase, where chunks were stored in individual files on the file system. The file does not begin with a [[Minecraft:wikipedia:Magic_number_(programming)#In_files|magic number]], unlike [[Minecraft:wikipedia:List_of_file_signatures|other file formats]], and begins directly with the header. The format has been superseded by the [[Minecraft:Anvil file format]]; however, the Anvil file format made changes only to the [[Minecraft:chunk format]] and changed the region file extensions from &amp;quot;.mcr&amp;quot; to &amp;quot;.mca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The system is based on McRegion,&amp;lt;ref&amp;gt;http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/mods-discussion/1346703-mod-mcregion-v5-optimized-saves-1-2_02#p2619453&amp;lt;/ref&amp;gt; a mod by [http://www.minecraftforum.net/members/Scaevolus Scaevolus], also known for his development of the Optimine project.&amp;lt;ref&amp;gt;https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/1272374-v1-3-optimine-fps-boost-optimization-updated&amp;lt;/ref&amp;gt; The McRegion format was adopted nearly unchanged, except for the addition of a table of chunk update timestamps. [[Minecraft:JahKob]] has claimed that this format is up to 7 times faster than the previous system.&amp;lt;ref&amp;gt;http://www.pcgamer.com/minecraft-dev-diary-new-block-magic-fiddles/&amp;lt;/ref&amp;gt; The difference in a world&amp;#039;s total file size between the Region file format and the Alpha level format is negligible.&lt;br /&gt;
&lt;br /&gt;
{{Anchor|Region files|Region file location}}&lt;br /&gt;
&lt;br /&gt;
== Location ==&lt;br /&gt;
&amp;lt;i&amp;gt;Region files&amp;lt;/i&amp;gt; are found in your [[Minecraft:Java Edition level format|Java Edition world]] directory in the following directories:&lt;br /&gt;
* &amp;lt;i&amp;gt;directory&amp;lt;/i&amp;gt;/entities&lt;br /&gt;
* &amp;lt;i&amp;gt;directory&amp;lt;/i&amp;gt;/poi&lt;br /&gt;
* &amp;lt;i&amp;gt;directory&amp;lt;/i&amp;gt;/region&lt;br /&gt;
Where &amp;lt;i&amp;gt;directory&amp;lt;/i&amp;gt; may refer to the Minecraft world save directory.&lt;br /&gt;
&lt;br /&gt;
In which, the region files will take the form &amp;lt;code&amp;gt;r.&amp;#039;&amp;#039;x&amp;#039;&amp;#039;.&amp;#039;&amp;#039;z&amp;#039;&amp;#039;.mcr&amp;lt;/code&amp;gt;.&lt;br /&gt;
Or when referring to the [[Minecraft:Anvil file format]], the same but with the &amp;lt;code&amp;gt;.mca&amp;lt;/code&amp;gt; file extension instead.&lt;br /&gt;
&lt;br /&gt;
The X and Z position of a region file is determined through the floor of dividing the chunk [[Minecraft:coordinates]] by 32.&lt;br /&gt;
For example, a chunk at (30, -3) would be in the region (0, -1), and the chunk at (1500, -600) would be at (46, -19).&lt;br /&gt;
&lt;br /&gt;
Written in code, this is more commonly achieved through performing an [[Wikipedia:Arithmetic shift|Arithmetic shift]] 5 bits to the right.&lt;br /&gt;
Note that an &amp;#039;&amp;#039;arithmetic shift&amp;#039;&amp;#039; is different from a [[Wikipedia:Logical shift|Logical shift]].&lt;br /&gt;
Most programming languages will perform this when using a [[Minecraft:wikipedia:Signed number representations|signed integer]].&lt;br /&gt;
&lt;br /&gt;
Where getting the block position will be as simple as using 512 instead of 32. (&amp;lt;math&amp;gt;32\cdot16&amp;lt;/math&amp;gt;)&lt;br /&gt;
And when shifting using 9 instead of 5. (&amp;lt;math&amp;gt;\text{log}_2\left(512\right)&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Why bit shifting is used over standard division, even when using integers has to do that&lt;br /&gt;
integer division will &amp;#039;&amp;#039;only&amp;#039;&amp;#039; result in floored division if the integer is positive.&lt;br /&gt;
If the integer is negative, which it will be 50% of the time, the result is rounded up as opposed to rounded down.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
{{:Calculators/Chunk coordinates}}&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A region file is built-up out of sectors. These sectors are 4KiB large,&lt;br /&gt;
which is equal to the common [[Minecraft:wikipedia:Page (computer memory)|memory page]] size for [[Minecraft:wikipedia:Kernel (operating system)|operating system kernels]].&lt;br /&gt;
The entire file is sector-aligned, and the total size should thus be a multiple of 4KiB.&lt;br /&gt;
If the file isn&amp;#039;t aligned to this boundary there is a possibility that it is corrupt.&lt;br /&gt;
&lt;br /&gt;
The file has a header of two tables containing the chunk data.&lt;br /&gt;
Sectors following these tables may be allocated to a chunk.&lt;br /&gt;
When a chunk is newly created, or grows in sectors, the code will look for this number of sequential sectors that are free.&lt;br /&gt;
If it fails to find this, the chunk will be appended to the end of the file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; data-description=&amp;quot;Sector-level layout of the Region file&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Sector&lt;br /&gt;
! 0, 1&lt;br /&gt;
! 2...&lt;br /&gt;
|-&lt;br /&gt;
! Description&lt;br /&gt;
| Header, contains payload metadata.&lt;br /&gt;
| Payload data and unused sectors.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
The first two sectors of the file contain the two headers, occupying one sector each.&lt;br /&gt;
The first table containing the position data of the chunks in the region file itself, the second providing timestamps for the last update of said chunks.&lt;br /&gt;
&lt;br /&gt;
These tables compose of a 1024 element list (&amp;lt;math&amp;gt;32^2&amp;lt;/math&amp;gt;) containing [[Minecraft:wikipedia:big-endian|big-endian]], 32-bit integers.&lt;br /&gt;
Each chunk has a corresponding X and Z position.&lt;br /&gt;
This is computed through floored division, and taking the [[Minecraft:wikipedia:modulo|modulo]] of the &amp;lt;i&amp;gt;index&amp;lt;/i&amp;gt;, here represented as &amp;quot;&amp;lt;i&amp;gt;i&amp;lt;/i&amp;gt;&amp;quot;&lt;br /&gt;
* &amp;lt;math&amp;gt;x=i\mod{32}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;z=\left\lfloor\frac{i}{32}\right\rfloor&amp;lt;/math&amp;gt;&lt;br /&gt;
With the reverse being done here:&lt;br /&gt;
* &amp;lt;math&amp;gt;i=x+32z&amp;lt;/math&amp;gt;&lt;br /&gt;
Ensuring X and Z are constrained to a value from 0..31 (inclusive), i.e. the result of a modulo of 32.&lt;br /&gt;
&lt;br /&gt;
To read the position data out of the first table will require reading bytes &amp;lt;math&amp;gt;4i&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;4i+4&amp;lt;/math&amp;gt; (exclusive).&lt;br /&gt;
The same can be done for the location data, but adding 1024 to both results.&lt;br /&gt;
&lt;br /&gt;
The location data is stored with a specific format, with the first 3 bytes referring to&lt;br /&gt;
the &amp;lt;i&amp;gt;offset in sectors&amp;lt;/i&amp;gt; from the &amp;lt;i&amp;gt;start of the file&amp;lt;/i&amp;gt;.&lt;br /&gt;
The last, and least significant byte giving us &amp;lt;i&amp;gt;the size in sectors&amp;lt;/i&amp;gt; of the chunk&amp;#039;s data.&lt;br /&gt;
&lt;br /&gt;
This implicitly means that the maximum amount of sectors for a chunk is 255, and thus 1MiB.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; data-description=&amp;quot;Byte-level layout of location data&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Byte&lt;br /&gt;
! 0&lt;br /&gt;
! 1&lt;br /&gt;
! 2&lt;br /&gt;
! 3&lt;br /&gt;
|-&lt;br /&gt;
! Description&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | Offset&lt;br /&gt;
| Length&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
Chunk data begins with a (big-endian) four-byte signed length field that indicates the exact length of the remaining chunk data in bytes. The following byte indicates the compression scheme used for chunk data, and the remaining (length-1) bytes are the compressed chunk data.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; always pads the last chunk&amp;#039;s data to be a multiple-of-4096B in length (so that the entire file has a size that is a multiple of 4KiB). &amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; does not accept files in which the last chunk is not padded. Note that this padding is not included in the length field.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; data-description=&amp;quot;Chunk data bytes&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! byte&lt;br /&gt;
! 0&lt;br /&gt;
! 1&lt;br /&gt;
! 2&lt;br /&gt;
! 3&lt;br /&gt;
! 4&lt;br /&gt;
! 5...&lt;br /&gt;
|-&lt;br /&gt;
! description&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; | length (in bytes)&lt;br /&gt;
| compression type&lt;br /&gt;
| compressed data (length-1 bytes)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are currently five defined compression schemes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; data-description=&amp;quot;Compression schemes&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! value&lt;br /&gt;
! method&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| GZip (RFC1952) (unused in practice)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Zlib (RFC1950)&lt;br /&gt;
|-&lt;br /&gt;
|3&amp;lt;sup&amp;gt;since a version before 1.15.1&amp;lt;/sup&amp;gt;&lt;br /&gt;
|Uncompressed&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|[[Minecraft:wikipedia:LZ4 (compression algorithm)|LZ4]] (since [[Minecraft:24w04a]], enabled in [[Minecraft:server.properties]])&lt;br /&gt;
|-&lt;br /&gt;
|127&lt;br /&gt;
|Custom compression algorithm (since [[Minecraft:24w05a]], for third-party servers)&lt;br /&gt;
A namespaced string must follow representing the algorithm used. The string is preceded by its length, encoded as an unsigned 16-bit integer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The uncompressed data is in [[Minecraft:NBT format]] and follows the information detailed on the [[Minecraft:chunk format]] article; if compressed with compression scheme 1, the compressed data would be the same as the on-disk content of an Alpha chunk file. Note that chunks are always saved using compression scheme 2 by the official client.&lt;br /&gt;
&lt;br /&gt;
If the value of compression scheme increases by 128, the compressed data is saved in a file called &amp;lt;code&amp;gt;c.&amp;#039;&amp;#039;x&amp;#039;&amp;#039;.&amp;#039;&amp;#039;z&amp;#039;&amp;#039;.mcc&amp;lt;/code&amp;gt;, where x and z are the chunk&amp;#039;s coordinates, instead of the usual position.&lt;br /&gt;
&lt;br /&gt;
== Migration and level.dat ==&lt;br /&gt;
[[File:Convert.png|thumb|How &amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; looks when converting to the new format.]]&lt;br /&gt;
Beta 1.3 converts any &amp;quot;old&amp;quot; chunks into region files before loading the world, rather than incrementally, as they are loaded during play. As part of the conversion, &amp;lt;code&amp;gt;level.dat&amp;lt;/code&amp;gt; is updated with TAG_Int(&amp;quot;version&amp;quot;) (note case) set to 19132. Beta 1.3 also introduces a new level name field, TAG_String(&amp;quot;LevelName&amp;quot;). A new TAG_Byte(&amp;quot;Sleeping&amp;quot;) was introduced in player TAG_Compounds - level.dat in singleplayer, [player name].dat in multiplayer that indicates whether the player is in a bed. It has value of 1 (true) or 0 (false). In [[Minecraft:Java Edition Beta 1.8|Beta 1.8]], TAG_Int(&amp;quot;GameType&amp;quot;) was added. In [[Minecraft:Java Edition 1.0.0|1.0.0]], TAG_byte(&amp;quot;hardcore&amp;quot;) was added.&lt;br /&gt;
&lt;br /&gt;
The format of [[Minecraft:Java Edition level format#level.dat format|level.dat]] is otherwise unchanged.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
*[[Minecraft:Chunk format/McRegion|McRegion chunk format]]&lt;br /&gt;
*[[Minecraft:Java Edition level format]]&lt;br /&gt;
*[[Minecraft:Chunk format]]&lt;br /&gt;
*[[Minecraft:Anvil file format]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[https://web.archive.org/web/20120314044006/http://www.mojang.com/2011/02/minecraft-save-file-format-in-beta-1-3/ Mojang announcement of new region format; Jeb helping tool-makers]&lt;br /&gt;
*[http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/mods-discussion/1346703-mod-mcregion-v5-optimized-saves-1-2_02 McRegion]&lt;br /&gt;
*[http://pastebin.com/niWTqLvk RegionFile in Java]&lt;br /&gt;
*[http://pastebin.com/jvZ1yhAd RegionFileCache in Java]&lt;br /&gt;
*[https://dinnerbone.com/minecraft/tools/coordinates/ Find region file from coordinates]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
{{Fnlist}}&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
The community has developed programs to work with region files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%&amp;quot; data-description=&amp;quot;Region file editors&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
! Screenshot&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/mods-discussion/1346703-mod-mcregion-v5-optimized-saves-1-2_02 McRegion]&lt;br /&gt;
| This mod optimizes how chunks are stored on the disk, meaning pauses to load or save a chunk as the player moves around a world become much shorter and less noticeable.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1261480-minecraft-region-fixer Minecraft Region Fixer]&lt;br /&gt;
| This tool is a python script that tries to fix problems in region files. It can find some typical errors (corrupted chunks, wrong located chunks, too many entities problems), and can fix these errors in various ways (deleting the chunks, replacing them with a backup copy, or relocating the chunk). This is a command-line application.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [http://minecraft.tournier.org MCA2NBT]&lt;br /&gt;
| A simple Unix command-line utility to convert a &amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; .mca region file (in anvil format) to a directory with the same basename containing an uncompressed NBT file for each of its chunks.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [https://lotr-minecraft-mod-exiles.fandom.com/wiki/Minecraft_Region_Scanner Region Scanner]&lt;br /&gt;
| A [[Minecraft:Java Edition 1.7.10]] (only) Java command line utility to analyze and mass edit region files&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
{{Navbox Java Edition technical|general}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
[[Minecraft:de:Spielstand-Speicherung/Region Format]]&lt;br /&gt;
[[Minecraft:fr:Format de fichier Région]]&lt;br /&gt;
[[Minecraft:ja:Regionファイルフォーマット]]&lt;br /&gt;
[[Minecraft:nl:Regio bestandsformaat]]&lt;br /&gt;
[[Minecraft:zh:区域文件格式]]&lt;/div&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
</feed>