Minecraft color codes
Every Minecraft Java colour and formatting code, as § and as the & chat plugins take, with the colour it draws, its name in commands and the block closest to it. Copy a code from the tables, or write a line in the preview and see it as the chat shows it.
The 16 colour codes
Put a code just before the text it colours. The game reads them after a §; players on a server with a chat plugin type them after an & instead. The name is the one text components and /team take.
| Colour | Code | In commands | Hex | Closest block |
|---|---|---|---|---|
| Black | black | shadow #000000 | Black concreteΔE 3.8 | |
| Dark blue | dark_blue | shadow #00002A | Purple concreteΔE 28.0 | |
| Dark green | dark_green | shadow #002A00 | Lime concreteΔE 18.4 | |
| Dark aqua | dark_aqua | shadow #002A2A | Stripped warped stemΔE 10.3 | |
| Dark red | dark_red | shadow #2A0000 | Redstone blockΔE 4.2 | |
| Dark purple | dark_purple | shadow #2A002A | Magenta concreteΔE 15.9 | |
| Gold | gold | shadow #3F2A00 | Yellow concreteΔE 9.3 | |
| Grey | gray | shadow #2A2A2A | Smooth stoneΔE 3.7 | |
| Dark grey | dark_gray | shadow #151515 | DeepslateΔE 1.2 | |
| Blue | blue | shadow #15153F | Purple woolΔE 32.1 | |
| Green | green | shadow #153F15 | Emerald blockΔE 31.2 | |
| Aqua | aqua | shadow #153F3F | Diamond blockΔE 9.8 | |
| Red | red | shadow #3F1515 | Red mushroom blockΔE 16.1 | |
| Light purple | light_purple | shadow #3F153F | Magenta woolΔE 31.5 | |
| Yellow | yellow | shadow #3F3F15 | Gold blockΔE 22.5 | |
| White | white | shadow #3F3F3F | Snow blockΔE 1.9 |
The closest block is the full, opaque block whose average colour sits nearest the code's, among blocks that stay as placed (nothing that falls, ages or moves), in the version picked in the sidebar. ΔE is the distance between the two colours: the lower, the closer.
The formatting codes
These change how the text is drawn, not its colour. In Java a colour code turns every format off, so write the colour first: §6§l draws bold gold, §l§6 plain gold. §r clears the colour and every format.
| Format | Code | Field | Looks like |
|---|---|---|---|
| Obfuscated | obfuscated | Minecraft | |
| Bold | bold | Minecraft | |
| Strikethrough | strikethrough | Minecraft | |
| Underline | underlined | Minecraft | |
| Italic | italic | Minecraft | |
| Reset | None: set a format to false | Minecraft |
Preview a line
Write a line with & or § codes, or press a code to add it where the cursor is. The preview follows Java's rules and draws the game's colours and shadows, in BlockLab's own font.
Type & or § codes, or press one below.
BlockLab | Welcome, builder! Now open
Where the codes work in Java
Chat
Java's chat box will not take a §: it drops the character from what you type, and one sent anyway disconnects you, even in single player. On a server, a chat plugin such as EssentialsX reads & codes in chat, on signs and in nicknames, for players with the permission. Without a plugin, colour a message with /tellraw, which the preview writes for you.
Signs
Use a dye on a sign to colour all its text, and a glow ink sac to make the text glow, unaffected by light; an ink sac takes the glow off. A dye writes in its own colours, not the codes': red dye draws #FF0000 on a glowing sign and #660000 on a plain one, neither of them the #FF5555 of §c. That is why the table has no dye column. For a colour or a format per word, write the sign's four lines as text components with a command:
Books
A book and quill takes no § either. The pages of a written book are text components, though, so a book made with a command can carry colours and formats.
Server MOTD
The motd line of server.properties, the message under the server's name in the multiplayer list, reads § codes. Write each § as \u00A7, which reads the same whatever encoding the file is saved in, and restart the server. The preview writes the whole line.
Commands and data packs
Text components, written in commands as JSON before Java 1.21.5 and as SNBT since, take the colour names above in their color field, and any colour as "#RRGGBB" since 1.16. Bold, italic and the other formats are fields of their own, and shadow_color sets the shadow since 1.21.4./tellraw, /title, /bossbar, written books, signs, text displays and custom names all take them.
Resource packs, worlds and servers
§ codes work in a resource pack's language files, splashes.txt and the description in pack.mcmeta. They also work in a world's name (LevelName in level.dat, or the world folder's name) and in a server's name in the multiplayer list (Namein servers.dat), the two files edited with an NBT editor.
Typing §
- Windows: Alt+21 on the numeric keypad with most US and UK keyboards, or Alt+0167 with others.
- Mac with a US keyboard: Option+6 (Option+5 on US Extended).
- Linux: Compose, s, o, or Ctrl+Shift+U, a7, Enter.
- In JSON text:
\u00A7.
Bedrock Edition
Bedrock takes § codes almost anywhere you type: chat, books, signs, anvils and more, though party chat censors a message that uses them. It draws some of the 16 colours in other shades (grey is #C5C5C5 there), and a format survives a colour code, so the order does not matter. Its §m and §n are colours: strikethrough and underline are Java only. These are the colours only Bedrock has, as of Bedrock 26.50; the material ones are for armour trim tooltips.
| Colour | Code | Hex |
|---|---|---|
| Minecoin goldNot on PlayStation | #EFCE16 | |
| Quartz | #D9CCB8 | |
| Iron | #A9B4B7 | |
| Netherite | #8F727D | |
| Redstone | #EE222C | |
| Copper | #C87363 | |
| Gold | #FFBF1E | |
| Emerald | #13A045 | |
| Diamond | #5FECFF | |
| Lapis | #577BFF | |
| Amethyst | #B66CDD | |
| Resin | #FF6A00 | |
| Party blue | #8BB3FF |
Questions
How do you type the § sign?
On Windows, hold Alt and type 21 (or 0167) on the numeric keypad. On a Mac with a US keyboard, press Option+6. On Linux, press Compose, then s, then o, or Ctrl+Shift+U, then a7 and Enter. Java's chat, signs and books do not take it, though: use & with a chat plugin there, or a command.
What is the difference between § and & codes?
§ is the code the game reads. & is how players type the same codes on a server with a chat plugin such as EssentialsX, which turns &6 into §6 before the game sees it. Vanilla Java does not read & codes.
Why does my text lose its bold after a colour code?
In Java, a colour code turns every format off. Put the colour first and the format after it: §6§l is bold gold, §l§6 plain gold. Bedrock keeps the format either way.
Can Minecraft text use hex colours?
Not with a § code: vanilla Java has none for hex. Text components take any colour as #RRGGBB since Java 1.16, for example {"text":"Hi","color":"#FF8800"} in /tellraw. On a server, EssentialsX reads &#FF8800 in chat since its version 2.18.0, for players with the permission.
How do you colour the text on a sign?
In Java, use a dye on the sign: all its text takes the dye's colour, and a glow ink sac makes it glow. For a colour or a format per word, write the sign's text as text components with /data merge block. On Bedrock, type § codes on the sign itself.