How to Do Colored Text in Discord (ANSI Code Blocks)
Colored text in Discord is made with an ANSI code block. You type a short code block, add a special color code in front of your words, and Discord shows the text in red, green, blue and more. This guide shows how to do colored text in Discord step by step, which codes to use, what works on desktop and mobile, and the older tricks that still work.
Want to skip the typing? Use our Discord colored text generator. It builds the code block for you, and you only need to copy and paste it.
How Colored Text Works in Discord
Discord does not have a color picker for chat messages. Instead, it supports ANSI escape codes inside a code block that starts with the word ansi. An ANSI code is a hidden control character followed by a number. The number decides the color, and a reset code ends it.
Because the control character is invisible and hard to type, most people copy a finished block from a generator instead of typing it by hand.
How to Do Colored Text in Discord (Step by Step)
- Open the Discord colored text generator and type your message.
- Pick the text color, and a background color or bold if you want.
- Press the copy button. The output is a code block that starts with
ansi. - Paste it into any Discord channel or DM and press Enter.
The message appears as a code block with colored text inside it.
Discord ANSI Color Codes
Text colors
- 30 gray, 31 red, 32 green, 33 yellow
- 34 blue, 35 pink, 36 cyan, 37 white
Background colors
- 40 dark blue, 41 orange, 42 blue-gray, 43 turquoise
- 44 gray, 45 indigo, 46 light gray, 47 white
Styles
- 0 reset, 1 bold, 4 underline
Codes can be combined with a semicolon, for example 1;31 means bold red. Always end with a reset (0) so the rest of your text stays normal. For the full cheat sheet, see the table on our generator page.
Does Colored Text Work on Mobile?
ANSI colors are displayed reliably on Discord for desktop and in the browser. On mobile apps the text may appear white or without color, depending on the app version. If your friends use phones, send them a short test message first.
Other Ways to Format Text in Discord
If you do not need color, Discord’s built-in markdown covers most formatting:
**bold**for bold text*italic*for italic text__underline__for underlined text~~strikethrough~~to cross out text||spoiler||to hide text until clicked- Single backticks for inline code, and triple backticks for a code block
Some older tricks use code block languages to get one color. A diff block shows lines that start with + in green and lines that start with – in red. These work without ANSI, but you cannot choose the exact color.
Why Is My Discord Colored Text Not Working?
- The word ansi is missing after the three backticks. Without it, the code block shows plain text.
- The invisible control character was lost when you copied the text from another app. Copy again from the generator.
- You are on mobile, where the colors may not show.
- There is no reset code, so the color runs into the following text.
Frequently Asked Questions
How do I do colored text in Discord?
Send a code block that starts with ansi and put an ANSI color code before your text. The easiest way is to copy a ready-made block from a generator.
Do I need Discord Nitro for colored text?
No. ANSI code blocks work for free accounts.
Can I change the color of my whole message?
Discord has no setting for that. Colored text lives inside a code block.
Why does the color look white on my phone?
Some mobile versions do not display ANSI colors. Check on desktop or in the browser.
Can I use colored text in my username?
No. ANSI colors only work inside messages, not in usernames or nicknames.
For bold, italic, strikethrough, spoilers and code blocks, see our Discord markdown cheat sheet.
Ready to try? Open the free Discord colored text generator and copy your block.