How to Use Coordinates in Minecraft Commands
Minecraft uses three coordinate systems in commands. Absolute coordinates (X Y Z) refer to a fixed point in the world. Relative coordinates (~ ~ ~) are offset from the current position -- ~5 means 5 blocks east of where you are. Local coordinates (^ ^ ^) are relative to the direction you are facing. You can find your current coordinates by pressing F3 on Java Edition or enabling Show Coordinates on Bedrock.
The X, Y, Z axes
Minecraft uses a three-axis coordinate system:
X (east/west): increases going east, decreases going west. Y (up/down): increases going up, decreases going down. Sea level is Y=64. The world height ceiling in Java 26.2 is Y=320; the floor (bedrock) is Y=-64. Z (south/north): increases going south, decreases going north.
When a command asks for coordinates, it always wants them in X Y Z order with spaces between: 100 64 -200
How to find your current coordinates
Java Edition: Press F3 (or Fn+F3 on some laptops) to open the debug screen. Your coordinates appear as "XYZ:" followed by three numbers. The "Block" line shows the exact block you are standing in.
Bedrock Edition: Go to Settings > Game and enable "Show Coordinates". Your current X, Y, Z appear in the top-left corner of the screen at all times.
Both editions: running the command /tp ~ ~ ~ in the chat will display your current coordinates in the output message.
Absolute coordinates
Absolute coordinates refer to a fixed point in the world, regardless of where you are standing.
Example -- teleport to the world origin:
/tp @p 0 64 0
Example -- place a diamond block at a specific location:
/setblock 128 70 -300 diamond_block
Use absolute coordinates when you want to target a specific, permanent location -- for example, the position of your base or a landmark.
Relative coordinates with ~
The tilde (~) means "relative to the command executor's current position". ~ alone means 0 offset (the current position on that axis). ~5 means 5 blocks in the positive direction on that axis. ~-3 means 3 blocks in the negative direction.
Example -- teleport yourself 10 blocks upward:
/tp @p ~ ~10 ~
Example -- place a block 5 blocks in front of the command block (positive Z direction):
/setblock ~ ~ ~5 stone
Relative coordinates are the most common in practice because they work regardless of where you are in the world.
Local coordinates with ^
The caret (^) means "relative to the direction the executor is facing". The three values represent left/right, up/down, and forward/backward relative to your look direction:
^ ^ ^1 -- one block directly in front of you, regardless of which way you face. ^ ^2 ^ -- two blocks directly above the point in front of you.
Example -- summon a zombie directly in front of you:
/summon zombie ^ ^ ^3
Local coordinates cannot be mixed with ~ or absolute values in the same command -- all three must be ^ if you use any of them.
Practical examples
Fill a 10x10 area of stone at your feet:
/fill ~-5 ~ ~-5 ~5 ~ ~5 stone
Teleport to a fixed destination (your base at 200, 65, 300):
/tp @p 200 65 300
Summon a mob 5 blocks ahead of where you are looking:
/summon creeper ^ ^ ^5
Place a block directly below you:
/setblock ~ ~-1 ~ grass_block
Frequently asked questions
What is the difference between ~ and ^?
~ (tilde) is relative to the world axes -- ~5 always means 5 blocks east regardless of which way you face. ^ (caret) is relative to the direction you are looking -- ^5 means 5 blocks directly in front of your face.
What Y coordinate is sea level in Minecraft?
Sea level in Java 26.2 is Y=64. The world floor (bedrock) is at Y=-64 and the build height ceiling is Y=320. In Bedrock Edition the world ranges from Y=-64 to Y=320 as well since the 1.18 update.
Can I mix ~ and ^ in the same command?
No -- if you use any ^ coordinate, all three coordinates must use ^. You cannot mix ~ and ^ in the same set of coordinates. You can freely mix ~ with absolute numbers (e.g. ~5 64 ~-3 is valid).
How do I find the coordinates of a block I can see?
On Java Edition, the F3 debug screen shows the coordinates of the block your crosshair is targeting in the 'Targeted Block' line. On Bedrock, tap the block and check the coordinate display, or look at the block in your world with coordinates enabled.
Why does my /fill command say the area is too large?
The /fill command in Java 26.2 is limited to 32,768 blocks at a time. If your fill area exceeds this, split it into multiple smaller /fill commands or use a datapack.