Updated:

Java: press F3

F3 opens the debug screen. The XYZ: line on the left is your position; press F3 again to close it. On many laptops and Macs you need to hold Fn while pressing F3.

LineMeaning
XYZ:Your exact position, with decimals
Block:The block you stand in, as whole numbers
Facing:The direction you face: north, south, east or west

Use the whole numbers from Block: in commands. Recent versions let you choose which lines the debug screen shows, so check those settings if coordinates are missing.

No coordinates on a server

When the reducedDebugInfo game rule is on (reduced_debug_info in Java 1.21.11+), F3 hides your position. Survival servers sometimes do this on purpose to stop players sharing locations.

# Java 1.21.11+
/gamerule minecraft:reduced_debug_info false
# Java 1.21.10 and earlier
/gamerule reducedDebugInfo false

Only operators can change it. On someone else's server, ask an admin.

Bedrock: setting or command

Turn on Show Coordinates in the world settings to keep your position in the top-left corner. It works the same on Switch, phones, tablets, PlayStation and Xbox. You can also use a command:

/gamerule showcoordinates true

Set it to false to hide them. The setting works without cheats; the command needs cheats on.

Reading X, Y and Z

AxisMeaning
XEast and west. Grows going east, shrinks going west.
YHeight. In the Overworld it runs from Y=-64 to Y=319 (1.18+).
ZSouth and north. Grows going south, shrinks going north.

One block in the Nether equals 8 in the Overworld. To link portals, build the Nether portal at the Overworld X and Z divided by 8.

Using coordinates in commands

/tp @s 100 64 -200
/tp @s ~ ~10 ~

The first line goes to a fixed point; the second moves you 10 blocks up from where you are. ~ means "relative to my position"; see relative and local coordinates. On Java you can also print your position with /data get entity @s Pos.

Keeping track of places

Common questions

Check your command

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