Minecraft colours text with two-character codes: a section sign followed by a number or letter. There are sixteen colours and six formatting codes, and where you can use them depends on where you are typing.
The codes themselves
Colours run 0 through 9 and a through f, from black up to white. Formatting adds bold, italic, underline, strikethrough, obfuscated and reset. The full table with hex values and one-click copy is on our Minecraft color codes page, including a live preview so you can see the result before you paste it anywhere.
Order matters more than people realise
A colour code clears any formatting that came before it. Write the colour first and the formatting second, or the formatting silently disappears. Aqua bold is the aqua code followed by the bold code — the other way round gives you plain aqua text.
Where they work
On servers running Spigot, Paper or similar, most plugins accept codes written with an ampersand in config files and translate them for you. That is how rank prefixes, MOTDs and join messages get their colour.
The server MOTD in server.properties cannot hold a raw section sign, so it uses an escaped form instead. Switch the copy format on our codes page to MOTD and every code copies out already escaped and ready to paste.
On signs, colour comes from dye rather than codes in normal survival play: right-click the sign with any dye and the text takes that colour. Glow ink sacs add an outline that makes signs readable in the dark. Codes on signs are a command-block and datapack technique, not something you type in survival.
Books, anvils and item names
Renaming an item in an anvil accepts formatting on servers where plugins allow it, which is how shops end up with brightly coloured item names. In single player vanilla, item names stay plain unless you use commands.
Try before you paste
The colour code page has a live preview that reproduces the game’s actual behaviour, including the reset rule and the scrambling obfuscated code. Type your MOTD or your rank prefix there first and you will not have to restart a server to find out you got it wrong.