Minecraft Nether Portal Calculator
Four short steps: say where you are, type your position, build where the calculator points, and check that the two portals link. Java Edition, 1.16.2 and up.
Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft. The rules on this page are Java Edition's, from the game's own portal code, and a future version can change them. The portal picture is Mojang's, the Minecraft Wiki's animated render.
How the maths works
The Nether is a small copy of the Overworld. Every block you walk down there is eight blocks up top. Walk 100 blocks in the Nether, pop back up, and you have moved 800 blocks at home. That is why people dig a tunnel through the Nether between their bases: you travel eight times further for the same walk.
So to find your spot in the Nether, divide your X and Z by 8. To go the other way, multiply them by 8. Your height, Y, is never divided. It stays exactly the same number.
One catch. The game only deals in whole blocks, so it always rounds down, and that includes minus numbers: -100 divided by 8 is -12.5, and the game calls that -13, not -12. The calculator rounds the same way the game does, so what you see is where you land.
Why portals link to the wrong place
Walking into a portal does not always build you a new one. The game works out where you ought to come out, has a look around that spot for a portal that is already there, and only builds a fresh one if it finds nothing.
How far it looks is the bit that catches people out: 16 blocks each way in the Nether, 128 each way in the Overworld. Everything shrinks by eight on the way in, so two portals about a hundred blocks apart at home land within 16 blocks of each other in the Nether. That is close enough for the second one to send you to the first one's Nether portal, which is why two doors at home so often open into the same room.
The cure is room. Keep your Nether portals more than 32 blocks apart and no pair can steal another pair's traffic. Step 4 above checks both trips for any two portals you have already built.
FAQ
Divide x and z by 8 and round down to the next whole block; leave y alone. Going the other way, multiply x and z by 8. Overworld 800, 64, 0 is Nether 100, 64, 0, and Overworld -100 is Nether -13, because -12.5 rounds down.
Because a portal already stood inside the square the game searches: 16 blocks each way in the Nether, 128 in the Overworld, at any height. The game takes the nearest existing portal by straight-line distance and only generates a new one when that square is empty. Two Overworld portals about a hundred blocks apart end up within 16 blocks of each other in the Nether, so they share one Nether portal for exactly this reason.
Built right on their converted spots, Nether portals need more than 16 blocks between them on x or z, and Overworld portals more than 128. Built anywhere inside their squares, double that: 32 in the Nether and 256 in the Overworld, and no pair can catch the other's traffic.
Not for the maths: y is copied across, never divided. The search square ignores height too, so a portal at any y inside it is found; height only breaks ties, since the game picks the nearest in a straight line. Where it does matter is the Nether roof: the game never generates a portal above y 127 there, so an Overworld portal high in the mountains gets a Nether portal lower down. A portal it has to force in lands between y 70 and 118.
Because the game does. A position is a block, and the block a point sits in is found by rounding down, even for negative numbers: -12.5 is in block -13. Rounding to the nearest would put the spot one block out half the time, and for a portal built at the edge of the square that is the difference between linking and not.
The 1:8 ratio and the rounding are the same everywhere. The search square is not: Bedrock looks 128 blocks each way in both dimensions, and Java did the same in the Nether before 1.16.2, which is where the old advice to keep hubs 1,024 Overworld blocks apart comes from. The checker and the distances on this page are Java 1.16.2 and up, and the command is Java's.