Formulas
| Value | Formula | Range or example |
|---|---|---|
| Chunk X (or Z) | floor(block ÷ 16) | Block −1 → chunk −1 |
| Position in chunk | block − chunk × 16 | 0 to 15 |
| First block of the chunk | chunk × 16 | Chunk −1 → block −16 |
| Last block of the chunk | chunk × 16 + 15 | Chunk −1 → block −1 |
| Region X (or Z) | floor(chunk ÷ 32) | Chunk −1 → region −1 |
| Position in region | chunk − region × 32 | 0 to 31 |
| Section | floor(Y ÷ 16) | Y −64 → section −4, Y 319 → section 19 |
| Region file | r.<region X>.<region Z>.mca | r.-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) | Chunk | Position in chunk | Chunk spans | Region |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 to 15 | 0 |
| 15 | 0 | 15 | 0 to 15 | 0 |
| 16 | 1 | 0 | 16 to 31 | 0 |
| -1 | -1 | 15 | -16 to -1 | -1 |
| -16 | -1 | 0 | -16 to -1 | -1 |
| -17 | -2 | 15 | -32 to -17 | -1 |
| 511 | 31 | 15 | 496 to 511 | 0 |
| 512 | 32 | 0 | 512 to 527 | 1 |
| -513 | -33 | 15 | -528 to -513 | -2 |
| 1000 | 62 | 8 | 992 to 1007 | 1 |
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.