Tools / Color Codes
Minecraft colours text with codes: a sign and one character. The game itself reads the section sign §; plugins and their configs almost always use & instead and turn it into § for you. Since Java Edition 1.16 you can also use any hex colour.
Want a gradient or a custom hex colour instead? Make it in the generator and copy it in the format your plugin reads.
Open the Hex Gradient GeneratorThe 16 colour codes
| Code | Colour | Name | Hex |
|---|---|---|---|
&0 | Blackblack | #000000 | |
&1 | Dark Bluedark_blue | #0000AA | |
&2 | Dark Greendark_green | #00AA00 | |
&3 | Dark Aquadark_aqua | #00AAAA | |
&4 | Dark Reddark_red | #AA0000 | |
&5 | Dark Purpledark_purple | #AA00AA | |
&6 | Goldgold | #FFAA00 | |
&7 | Graygray | #AAAAAA | |
&8 | Dark Graydark_gray | #555555 | |
&9 | Blueblue | #5555FF | |
&a | Greengreen | #55FF55 | |
&b | Aquaaqua | #55FFFF | |
&c | Redred | #FF5555 | |
&d | Light Purplelight_purple | #FF55FF | |
&e | Yellowyellow | #FFFF55 | |
&f | Whitewhite | #FFFFFF |
The small name under each colour is the one used in JSON text ("color":"dark_aqua") and in MiniMessage tags (<dark_aqua>). The same codes work with §: §c is the same red as &c. Codes are not case-sensitive, so &C works too.
Formatting codes
| Code | Effect | MiniMessage | JSON |
|---|---|---|---|
&l | Bold | <bold> | "bold": true |
&o | Italic | <italic> | "italic": true |
&n | Underline | <underlined> | "underlined": true |
&m | Strikethrough | <strikethrough> | "strikethrough": true |
&k | Obfuscated (“magic”): the letters keep changing | <obfuscated> | "obfuscated": true |
&r | Reset: back to the default colour, no formatting | <reset> | – |
Order matters. A colour code switches off all formatting before it, so put the colour first: &c&lSale is bold red, while &l&cSale is only red. Every time the colour changes, write the formatting again: &c&lBig &6&lSale.
§ or &?
The game reads only the section sign §. You cannot type it in vanilla chat, and it is awkward to type on most keyboards, so plugins use & in their configs and commands and replace it with § before the text reaches the player. Use & in plugin configs unless the plugin's documentation says otherwise.
In a YAML config, a value that starts with & must be in quotes: prefix: "&c&lShop". Without them, YAML reads the & as an anchor and the code disappears. The Config Checker finds and fixes those lines.
Players can only use colour codes in chat when a plugin allows it. EssentialsX, for example, gives that right through permissions.
Hex colours (Java Edition 1.16 and later)
Since Java Edition 1.16, text can have any of 16.7 million colours, written as a hex value such as #FF5555. Plugins spell them in different ways:
| Format | Example | Used by |
|---|---|---|
&#RRGGBB | &#FF5555Shop | Many plugin configs, including EssentialsX, CMI and TAB |
| MiniMessage | <#ff5555>Shop, <gradient:#ff5555:#8a0a0d>Shop</gradient> | Paper's own text format (Adventure) and plugins built on it |
&x&R&R&G&G&B&B | &x&F&F&5&5&5&5Shop | Plugins that turn & into § |
§x§R§R§G§G§B§B | §x§F§F§5§5§5§5Shop | How Spigot and Paper store hex inside legacy text |
{#RRGGBB}, <#RRGGBB> | {#FF5555}Shop | Some plugins; check your plugin's documentation |
| JSON text | {"text":"Shop","color":"#ff5555"} | Vanilla commands such as /tellraw and /title |
All of these are the same red as &c, because &c is #FF5555. Players on Java Edition versions before 1.16 cannot see hex colours.
Colour codes in the server MOTD
The MOTD in server.properties uses § codes, and the § sign can get garbled when the file is saved. Write it as \u00A7 instead, which always works, and use \n for the second line:
motd=\u00A7c\u00A7lLethium \u00A77Survival\n\u00A7eNow open
The Hex Gradient Generator writes a whole gradient motd= line for you. If your server software shows hex codes in the MOTD as plain text, stick to the 16 colours above or use a MOTD plugin.
Bedrock Edition
Bedrock Edition uses the same §0 to §f colours and adds §g (Minecoin Gold). Newer versions add more colours named after materials, such as iron, gold, diamond and amethyst. Bedrock has no underline or strikethrough, and there §m and §n are two of those material colours.
Bedrock does not support hex colours. Bedrock players who join a Java server through Geyser see the nearest standard colour instead.
Questions
What are the Minecraft color codes?
&0 black, &1 dark blue, &2 dark green, &3 dark aqua, &4 dark red, &5 dark purple, &6 gold, &7 gray, &8 dark gray, &9 blue, &a green, &b aqua, &c red, &d light purple, &e yellow and &f white. The formatting codes are &l bold, &o italic, &n underline, &m strikethrough, &k obfuscated and &r reset.
Why does my colour code show up as text?
Either the plugin does not translate & codes for that text, or a YAML value starting with & is not in quotes. Put the text in double quotes, and check the plugin's documentation for the format it reads.
Why does bold stop after a colour code?
A colour code resets all formatting. Write the colour first and the formatting after it, and repeat the formatting after every new colour: &c&lBig &6&lSale.
How do I use hex colours in Minecraft?
On Java Edition 1.16 or later, write them in the format your plugin reads, such as &#FF5555 or MiniMessage <#ff5555>. In /tellraw, use "color":"#ff5555". The Hex Gradient Generator writes all of these for you.
Do colour codes work on Bedrock Edition?
The § codes 0 to f work on Bedrock, which also has extra colours of its own. Hex colours, underline and strikethrough do not.