Colored text on Discord is not normal Markdown. It uses ANSI escape codes inside a special code block. This is the most technical formatting option on Discord, but once you understand the pattern, it is easy to reuse. You cannot just type colors like bold or italic. You need to use a specific syntax with escape characters.
This guide covers how to write in color on Discord using ANSI codes for text color, background color, and bold or underlined colored text. For a complete reference of every formatting option, check out The Ultimate Discord Text Formatting Guide.
How Discord ANSI Coloring Works
ANSI coloring on Discord uses three parts:
- A
```ansicode block to activate ANSI mode. - Escape codes inserted before each word or line to set the color.
- A reset code (
[0m) to stop the color so the next text can use a different one.
Every color code starts with an invisible character called the escape character (Unicode U+001B). You cannot type it on most keyboards, so every example on this page includes it in a copy-paste-ready box. The escape character appears as a small symbol before each [ in the copy boxes below. Here is the red-text template:
```ansi [31mThis text is red[0m ```
Click Copy Rules and paste into a ```ansi block. 31 means red, 0 means reset. For the quickest setup, use our free Discord Colored Text Generator instead.
How to Write Colored Text on Discord Desktop
Follow these steps exactly to get colored text working.
Step 1: Open a Code Block
Type ```ansi and press Enter. This tells Discord to interpret ANSI escape codes instead of regular text.
Step 2: Paste or Type the Color Code
Use the escape character followed by the color number and m. Copy this green text example and replace the words:
```ansi [32mYour text here[0m ```
The [0m at the end resets the color so the next text is not also green.
Step 3: Close the Code Block
Type ``` on its own line at the end to close the block.
Complete example for a message with two colors (copy the full block below):
```ansi [31mThis is red[0m [32mThis is green[0m ```
Click Copy Rules and paste directly into Discord. The escape characters are included.
ANSI Color Reference Table
Here are all the text colors you can use on Discord. Copy the block below into a ```ansi block and replace text with your own words.
```ansi [30mtext[0m Gray [31mtext[0m Red [32mtext[0m Green [33mtext[0m Yellow [34mtext[0m Blue [35mtext[0m Pink [36mtext[0m Cyan [37mtext[0m White ```
| Code | Color | Code | Color |
|---|---|---|---|
30 | Gray | 34 | Blue |
31 | Red | 35 | Pink |
32 | Green | 36 | Cyan |
33 | Yellow | 37 | White |
ANSI Background Colors
Codes 40 to 47 add a colored background behind the text. Copy the example below into your ```ansi block.
```ansi [30;41mDark text on red background[0m [30;42mDark text on green background[0m [37;43mWhite text on yellow background[0m [37;44mWhite text on blue background[0m [30;45mDark text on pink background[0m [37;46mWhite text on cyan background[0m ```
The first number after [ (like 30) is the text color. The second number after the semicolon (like 41) is the background color. Most people use 30 (dark gray) or 37 (white) for text on colored backgrounds so the text stays readable. Replace the words and send.
| Code | Usage | Example |
|---|---|---|
40 | [40m Gray bg | Gray bg |
41 | [41m Red bg | Red bg |
42 | [42m Green bg | Green bg |
43 | [43m Yellow bg | Yellow bg |
44 | [44m Blue bg | Blue bg |
45 | [45m Pink bg | Pink bg |
46 | [46m Cyan bg | Cyan bg |
47 | [47m White bg | White bg |
To combine text color and background, use [XX;YYm where XX is the text color (30-37) and YY is the background (40-47). For readable results, use 30 (dark gray) or 37 (white) for text with colored backgrounds. The escape character goes before the bracket, as in all the copy boxes above.
Bold and Underlined Colored Text
Colored text blocks can only be combined with bolding and underlining, and this cannot be done manually. Discord needs several style codes stacked in the exact right order, and getting that right by hand is unreliable. The simplest way is to use our Discord Colored Text Generator: select your colored text, click Bold or Underline, and copy the finished code block into Discord.
ANSI Colors on Discord Mobile
Colored text does not render in the Discord mobile app. Messages sent with ANSI colors appear as plain monochrome text on iOS and Android. The colors are only visible on Discord desktop and web, so build and send colored messages from a desktop or web client.
iOS (iPhone / iPad)
- 1
Copy the full ANSI code example (including the escape characters) from a desktop source.
- 2
Open Discord and type
```ansithen press Return. - 3
Paste the code and replace the example text with your own words.
- 4
Close with
```on a new line and send.
Android
- 1
Save a note with your ANSI templates so you can copy-paste them on mobile.
- 2
Open the note, copy the template, and paste it into a
```ansiblock on Discord. - 3
Edit the pasted text to replace the example words with your own.
- 4
Close the code block and send. The colors render once the message is sent.
ANSI Not Working on Discord? Try These Fixes
Common Issues
- You forgot the
ansilanguage tag. Regular```withoutansidoes not process escape codes. You must type```ansiat the start. - The escape character is missing or wrong. The invisible character before each bracket must be the actual Unicode escape character (U+001B). Copying from a working example is the easiest way to get it right.
- You forgot the reset code. Without
[0mat the end, all text after your colored word stays in that color. Always reset with[0mafter each colored section. - The color code is wrong. Use codes 30 to 37 for text colors and 40 to 47 for backgrounds. Numbers outside this range (like 38 or 39) may not work on Discord.
- You are not inside a code block. ANSI escape codes only work inside
```ansiblocks. Typing them in a regular message shows the raw characters.
ANSI Color Discord FAQ
How do I type colored text on Discord?
```ansi code block with ANSI escape codes. Each color has a number code (31 for red, 32 for green, etc.) preceded by an invisible escape character. Copy a working template and replace the text.What is the escape character for Discord ANSI?
Can I use multiple colors in one message?
[0m between them. For example: [31mred text[0m [32mgreen text[0m with the escape character before each bracket.Does colored text work on Discord mobile?
How do I make text bold and colored at the same time?
Why is my ANSI code showing as raw text instead of colors?
```) instead of an ANSI code block (```ansi). Make sure the language tag is set to ansi, or the escape codes will display as literal text.
