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.

ColourCodeIn commandsHexClosest block
Blackblackshadow #000000Black concreteΔE 3.8
Dark bluedark_blueshadow #00002APurple concreteΔE 28.0
Dark greendark_greenshadow #002A00Lime concreteΔE 18.4
Dark aquadark_aquashadow #002A2AStripped warped stemΔE 10.3
Dark reddark_redshadow #2A0000Redstone blockΔE 4.2
Dark purpledark_purpleshadow #2A002AMagenta concreteΔE 15.9
Goldgoldshadow #3F2A00Yellow concreteΔE 9.3
Greygrayshadow #2A2A2ASmooth stoneΔE 3.7
Dark greydark_grayshadow #151515DeepslateΔE 1.2
Blueblueshadow #15153FPurple woolΔE 32.1
Greengreenshadow #153F15Emerald blockΔE 31.2
Aquaaquashadow #153F3FDiamond blockΔE 9.8
Redredshadow #3F1515Red mushroom blockΔE 16.1
Light purplelight_purpleshadow #3F153FMagenta woolΔE 31.5
Yellowyellowshadow #3F3F15Gold blockΔE 22.5
Whitewhiteshadow #3F3F3FSnow 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.

FormatCodeFieldLooks like
ObfuscatedobfuscatedMinecraft
BoldboldMinecraft
StrikethroughstrikethroughMinecraft
UnderlineunderlinedMinecraft
ItalicitalicMinecraft
ResetNone: set a format to falseMinecraft

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

Ready to pasteClick a line to copy it

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:

Two coloured lines on a signClick a line to copy it

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.

ColourCodeHex
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.

Read next