Updated:

The basic form (Java)

DestinationCommand
Nether/execute in minecraft:the_nether run tp @s 0 70 0
End/execute in minecraft:the_end run tp @s 100 49 0
Overworld/execute in minecraft:overworld run tp @s 0 100 0

The dimension goes after in, and the teleport after run. Using ~ ~ ~ keeps the same coordinate numbers.

Land safely in the Nether

/execute in minecraft:the_nether run spreadplayers 0 0 0 30 under 120 false @s

Fixed coordinates in the Nether often end inside netherrack or over lava. On Java 1.17+, spreadplayers finds solid ground within 30 blocks of 0,0 and below Y=120, so you do not land on the bedrock roof. Give Fire Resistance first to be extra safe.

Where to land in the End

The obsidian platform players arrive on is at X=100, Y=48, Z=0, so tp @s 100 49 0 puts you on top of it. The main island with the dragon is around 0,0.

Nether coordinate conversion

DirectionRuleExample
Overworld → NetherDivide X and Z by 8(800, 64, -1600) → (100, ?, -200)
Nether → OverworldMultiply X and Z by 8(100, ?, -200) → (800, ?, -1600)

Y is not converted. Use this to line up linked portals.

Send other players

/execute in minecraft:the_nether run tp @a 0 70 0

Use @a for everyone or a name for one player. From a command block, @s selects nobody, so use @p or @a.

Build portals by command (Java)

If you want a permanent way in and out instead of a one-off teleport:

# End portal: a 3x3 pad a couple of blocks away
/fill ~2 ~ ~2 ~4 ~ ~4 minecraft:end_portal
# Nether portal: build an obsidian frame (4 wide, 5 tall), then fill the inside
/fill ~ ~ ~3 ~3 ~4 ~3 minecraft:obsidian
/fill ~1 ~1 ~3 ~2 ~3 ~3 minecraft:nether_portal[axis=x]

Bedrock Edition

/execute in nether run tp @s 0 70 0
/execute in the_end run tp @s 100 49 0
/execute in overworld run tp @s 0 100 0

Bedrock 1.19.50 and later support execute in with these dimension names.

Common problems

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.