Convert block coordinates to chunk coordinates and back — for the Overworld, the Nether and the End, which all use different scales.
The world is divided into chunks — square regions the game loads and unloads as the player moves. In the Overworld a chunk covers 16×16 blocks; in the Nether it's 8×8, because the world is compressed horizontally there.
You get a chunk coordinate by dividing the block coordinate by 16 (or 8 in the Nether) and rounding down. The reverse conversion is a multiplication.
Knowing these coordinates lets you locate biomes, structures and mob spawn points, and set up chunk loading correctly.
Pick the dimension — the Nether uses half the scale.
Enter a block coordinate to find its chunk.
Enter a chunk number to find the starting block of that chunk.
Use the result in locate and teleport commands.
Travelling through a portal divides X and Z by 8. The world is physically the same size, but the coordinate scale differs.
The world is infinite in both directions, so chunks are numbered negatively too — chunk -1 starts at block -16.
Usually you're reading a chunk coordinate but entering a block coordinate, or you've used the Overworld scale in the Nether. Use 8 for the Nether and round down.
One chunk spans 16 blocks in this dimension.
Chunk for this block
187
Block for this chunk
2992
Position inside the chunk
8
Counted from 0 up to 16
A chunk is 16×16 blocks in the Overworld and 8×8 in the Nether. Mixing up the scales is the usual reason a structure search finds nothing.