The Fill Command Replaces Blocks in a Rectangular Area at Once
The fill command in Minecraft lets you replace all blocks in a rectangular space with a single block type instantly. Instead of placing blocks one at a time, you specify two opposite corners of a box, choose what block to fill it with, and the command does the work. This is much faster than manual building and is the standard way to clear large areas, create flat terrain, or build the frame of a structure.
The command works in both Java Edition and Bedrock Edition, though the syntax differs slightly between them. You type the command into the chat window, and it executes immediately. The fill command is one of the most useful tools for building projects that would take hours by hand.
Key Takeaways
- The fill command requires two corner coordinates, a block type, and a mode — the basic syntax is /fill x1 y1 z1 x2 y2 z2 blockname.
- You can find your current coordinates by pressing F3 on Java Edition or enabling coordinates in the world settings on Bedrock.
- The replace mode lets you swap one block type for another without affecting surrounding blocks, which is useful for editing existing structures.
- The outline mode shows you the filled area in a preview before it happens, so you can cancel if the coordinates are wrong.
Finding Your Coordinates Before You Fill
Before you run a fill command, you need to know the coordinates of two opposite corners of the area you want to fill. On Java Edition, press F3 to open the debug screen. Look for the line that says "XYZ" — those three numbers are your current position. Write them down or remember them, then walk to the opposite corner of the area you want to fill and write down those coordinates too.
On Bedrock Edition, coordinates are not shown by default. Open your world settings, scroll down to "Show Coordinates", and turn it on. You will see your X, Y, and Z position in the top left corner of the screen. Walk to each corner and record the numbers the same way.
The Y coordinate is height — Y 64 is sea level in most Minecraft worlds, and higher numbers go up. The X and Z coordinates are horizontal position. You do not need to be exact about which corner is which; the fill command will work with any two opposite corners.
The Basic Fill Command Syntax
The fill command follows this pattern: /fill x1 y1 z1 x2 y2 z2 blockname. Replace x1, y1, z1 with the coordinates of the first corner, x2, y2, z2 with the second corner, and blockname with the block you want to fill with. For example, if you want to fill a space from coordinates 100 50 200 to 150 60 250 with stone, you would type:
/fill 100 50 200 150 60 250 stone
Block names are lowercase and have no spaces — use oak_wood not "oak wood", dark_oak_leaves not "dark oak leaves". If you are unsure of a block's exact name, you can look it up in the Minecraft wiki or test with a common block like dirt or stone first. Press Enter to run the command, and the entire rectangular area will fill instantly.
Using Replace Mode to Change Only Certain Blocks
By default, the fill command replaces every block in the area, including air. If you want to change only one type of block and leave everything else alone, add replace blockname at the end. The syntax becomes: /fill x1 y1 z1 x2 y2 z2 newblock replace oldblock.
For example, if you have a structure made of dirt and want to turn all the dirt to stone without touching the air around it, you would type:
/fill 100 50 200 150 60 250 stone replace dirt
This is useful when editing existing builds — you can swap materials without erasing the empty space. Replace mode also works with multiple block types if you use the syntax correctly, though most of the time you will be replacing one specific block.
Preview Your Fill with Outline Mode
If you are not sure your coordinates are correct, you can use outline mode to see a preview before the command actually fills anything. Add outline at the end of your command: /fill x1 y1 z1 x2 y2 z2 blockname outline.
When you run this, the area will be outlined with a glowing border so you can see exactly what will be filled. The blocks themselves do not change. If the outline is wrong, press Escape and try different coordinates. If it looks right, run the command again without the outline word and it will fill for real.
Outline mode is especially helpful when you are working with large areas or when your coordinates are approximate. It saves you from filling the wrong space and having to undo it with another fill command.
Hollow Mode for Creating Walls and Boxes
The hollow mode fills only the outer layer of your rectangular area, leaving the inside empty. This is the fastest way to create a box frame or the walls of a building. The syntax is: /fill x1 y1 z1 x2 y2 z2 blockname hollow.
For example, to create a stone box frame from coordinates 100 50 200 to 150 60 250, you would type:
/fill 100 50 200 150 60 250 stone hollow
Only the outer surface blocks will be stone; everything inside stays as air. This is much faster than building walls by hand and is commonly used to create the skeleton of a building before adding interior details. You can combine hollow with other modes in some cases, though outline and hollow together do not work.
Common Mistakes and How to Fix Them
The most common mistake is typing the block name wrong. If you type /fill 100 50 200 150 60 250 oak_log and nothing happens, the block name is probably misspelled. Check the Minecraft wiki for the exact spelling — it is almost always lowercase with underscores instead of spaces. Try a simple block like stone or dirt to test if the command itself is working.
Another mistake is swapping X and Z coordinates or getting the height wrong. If the filled area appears somewhere unexpected, check that you copied the coordinates correctly from the debug screen. The order matters: always type x first, then y, then z. If you filled the wrong area, you can undo it by running the fill command again with air as the block type.
If the command does not run at all, make sure you are in Creative mode or have cheats turned on. Survival mode does not allow commands unless you enable cheats when creating the world. On Bedrock, you may need to turn on "Command Blocks" in the world settings as well.
Frequently Asked Questions
Can I use the fill command in Survival mode?
Only if you turn on cheats when you create the world. Open world settings, find "Cheats", and toggle it on. Once cheats are on, you can use any command in Survival mode. This does not disable achievements on Java Edition, but it does on Bedrock.
What if I fill the wrong area and want to undo it?
Run the fill command again with air as the block type to clear it. For example, /fill 100 50 200 150 60 250 air will erase whatever you just filled. If you filled a huge area by accident, this is the fastest way to fix it.
How do I fill with a block that has a specific state, like a stair facing a direction?
Add the state in square brackets after the block name. For example, /fill 100 50 200 150 60 250 oak_stairs[facing=west] fills with oak stairs facing west. The exact states depend on the block — check the wiki for the block you want to use.
Does the fill command work across different dimensions?
No. The fill command only works in the dimension you are currently in. If you want to fill an area in the Nether, you must be in the Nether when you run the command.
What is the maximum size area I can fill at once?
Technically there is no hard limit, but filling extremely large areas (millions of blocks) can lag or crash your game. Most practical builds use fill commands for areas under 100,000 blocks. If your game stutters, the area was too large.