Formulas

ValueFormulaRange or example
Chunk X (or Z)floor(block ÷ 16)Block −1 → chunk −1
Position in chunkblock − chunk × 160 to 15
First block of the chunkchunk × 16Chunk −1 → block −16
Last block of the chunkchunk × 16 + 15Chunk −1 → block −1
Region X (or Z)floor(chunk ÷ 32)Chunk −1 → region −1
Position in regionchunk − region × 320 to 31
Sectionfloor(Y ÷ 16)Y −64 → section −4, Y 319 → section 19
Region filer.<region X>.<region Z>.mcar.-1.0.mca

In code, the same values come from an arithmetic right shift on integer coordinates: block >> 4 gives the chunk and chunk >> 5 gives the region, both rounding down correctly for negative numbers.

Examples

X and Z use the same formulas, so one column is enough.

Block X (or Z)ChunkPosition in chunkChunk spansRegion
0000 to 150
150150 to 150
161016 to 310
-1-115-16 to -1-1
-16-10-16 to -1-1
-17-215-32 to -17-1
5113115496 to 5110
512320512 to 5271
-513-3315-528 to -513-2
1000628992 to 10071

Where region files are

A Java Edition world has three folders of region files with the same naming:

  • region: blocks and block entities.
  • entities: mobs, items, armour stands and other entities.
  • poi: points of interest such as beds, bells and villager workstations.

To convert a coordinate without doing the maths, use the Chunk Calculator.