Skip to content
DiscordFonts

How to Write Colored Text in Discord (Easy 2026 Guide)

· 7 min read

You can write colored text in Discord, even though there's no color button anywhere in the app. The trick is a special code block called ANSI, which lets you paint words red, green, blue, yellow and more, right inside a normal message.

If you've ever seen someone post a bright red warning or a rainbow-style announcement in a server, this is how they did it. In this guide you'll learn exactly how ANSI works, get a full color chart, and copy ready-made examples you can paste straight into Discord.

Want to skip the codes? Jump to the copy-paste examples. Every one has a copy button that includes the hidden escape character, so it works the moment you paste it.

Discord colored text examples: red, green, yellow, blue, pink and cyan text, bold and underlined text, background colors, and green and red diff lines
How ANSI and diff code blocks look on Discord desktop.

How colored text in Discord works

Discord uses Markdown for formatting. Wrapping text in three backticks (```) creates a code block, and adding a language name after the backticks tells Discord how to highlight it. When that language is ansi, Discord reads special color instructions inside the block and shows your text in color.

Every color instruction has the same shape:

[ESC][FORMAT;COLORm

  • ESC is an invisible “escape” character (Unicode U+001B). You can't type it on a normal keyboard, which is why most people copy it from an example.
  • FORMAT is a number for style: 0 = normal, 1 = bold, 4 = underline.
  • COLOR is a number from 30 to 37 for text color, or 40 to 47 for background color.
  • m closes the instruction. Everything after it takes the new color until you change it or reset it with [ESC][0m.

So [ESC][1;31m means “bold red”, and [ESC][0;34m means “normal blue”.

How to write colored text in Discord, step by step

  1. Open a message box in any server channel or DM on Discord desktop or in your browser.
  2. Start an ANSI code block. Type three backticks followed by ansi, then press Shift + Enter to go to a new line.
  3. Add a color code. Paste the escape character followed by your format and color, for example [ESC][1;32m for bold green.
  4. Type your text right after the m.
  5. Reset the color (optional). Add [ESC][0m before any text you want back in the default color.
  6. Close the code block with three more backticks on a new line, then press Enter to send.

Your finished message looks like this before you send it:

Bold green text
```ansi
ESC[1;32mThis text is bold green
```

The fastest way to get the escape character is to hit Copy on any example in this article, then change the words to your own.

Discord ANSI color codes chart

Discord supports 8 text colors, 8 background colors and 3 formats. Mix them freely, separated by semicolons.

Text colors

CodeColorExample
30Gray[ESC][0;30m
31Red[ESC][0;31m
32Green[ESC][0;32m
33Yellow[ESC][0;33m
34Blue[ESC][0;34m
35Pink[ESC][0;35m
36Cyan[ESC][0;36m
37White[ESC][0;37m

Background colors

CodeColorExample
40Firefly dark blue[ESC][0;40m
41Orange[ESC][0;41m
42Marble blue[ESC][0;42m
43Greyish turquoise[ESC][0;43m
44Gray[ESC][0;44m
45Indigo[ESC][0;45m
46Light gray[ESC][0;46m
47White[ESC][0;47m

Formats

CodeEffect
0Normal (also resets everything)
1Bold
4Underline

To combine all three, list them in one instruction. For example, [ESC][1;4;33;40m gives bold, underlined yellow text on a dark blue background.

Copy-paste colored text examples

Hit Copy on any block below, paste it into Discord, and change the words to your own. The hidden escape character comes along with it.

Red warning message

Red warning
```ansi
ESC[1;31mWARNING: Read the rules before posting!
```

Server announcement with mixed colors

Server announcement
```ansi
ESC[1;33mANNOUNCEMENTESC[0m
ESC[0;37mGame night starts at ESC[1;32m8 PMESC[0;37m this Friday.
```

Highlighted text with a background

Highlighted text
```ansi
ESC[0;37;45m New role unlocked! ESC[0m
```

Rainbow-style text

Rainbow text
```ansi
ESC[0;31mRESC[0;33mAESC[0;32mIESC[0;36mNESC[0;34mBESC[0;35mOESC[0;31mW
```

Bold underlined heading

Bold underlined heading
```ansi
ESC[1;4;36mServer Rules
```

Other ways to color text in Discord

Before ANSI support, people used programming-language syntax highlighting to fake colors. A few of these tricks still work, but they're limited and less predictable.

MethodHow to use itColor you getReliability
ANSI```ansi + color codesAny of 8 text and 8 background colorsBest, works on desktop and web
Diff```diff and start a line with + or -Green (+) or red (-)Good, works on most devices
Fix```fixYellowInconsistent
CSS / YAML / INI tricksLanguage-specific symbolsVariesOften broken by Discord updates

The diff method is handy for quick green or red lines:

Diff (green and red)
```diff
+ Approved
- Denied
```

For anything more colorful, ANSI is the only method Discord officially supports.

Does colored text work on Discord mobile?

Mostly no. ANSI colors display on Discord desktop and in the browser, but the iPhone and Android apps usually show the text in a plain gray code block. Your message still sends, and anyone on desktop will see the colors.

You can still send colored text from your phone: open this page, copy a finished example, paste it into Discord, and send. Desktop users will see it in full color.

Why your colored text isn't showing

ProblemFix
You see [0;31m as plain textThe escape character is missing. Copy an example instead of typing [ESC].
The whole block is grayCheck you wrote ansi right after the opening backticks, with no space.
Colors run into the next lineAdd a reset code [ESC][0m where the color should stop.
Nothing is colored on your phoneMobile apps don't render ANSI yet. Check on desktop.
You want colored text in your nameNot possible. ANSI only works in messages. Use fancy fonts for names instead.

For names, bios and server names, see our guide on how to change your font on Discord.

FAQ

Can you change text color in Discord without code?

Not inside Discord itself. The easiest no-code option is to copy one of the ready-made examples in this guide, swap in your own words, and paste it into Discord.

How do I make red text in Discord?

Use an ANSI code block with color code 31, like [ESC][0;31mYour text, or start a line with a minus sign (-) inside a diff code block.

Can I use custom hex colors like #FF5733?

No. Discord's ANSI support is limited to the 8 text colors and 8 background colors in the chart above.

Does colored text work in usernames or channel names?

No. ANSI colors only work inside code blocks in messages. Usernames, display names and channel names don't support color, but you can still style them with Unicode fonts.

Can I get banned for using colored text?

No. ANSI code blocks are a built-in Discord feature. Just follow each server's rules about spam and formatting.

Conclusion

Colored text is one of the easiest ways to make your Discord messages stand out. Remember the formula: an ansi code block, the escape character, a format and color number, then your text. Bookmark the color chart above, or just come back and copy one of the examples whenever you need a colorful message in seconds.