Discord Colored Text

Text color

Preview

Copy this into a Discord message

Discord code blocks support a trick most people never find: tagging the block as ansi lets you color the text inside it, both the letters and the background, using the same escape codes terminals have used for decades. It only works inside a code block in a message, and the color only shows up on desktop and web, but it’s a real, widely used way to make a message stand out in a channel.

A backlit keyboard glowing in the dark.
Photo: The indian dev, CC BY-SA 4.0, via Wikimedia Commons

The Exact Syntax

Start a code block with three backticks followed by the word ansi on its own line, write your text with escape codes mixed in, then close with three backticks on their own line. Each escape code takes the form ESC[STYLE;COLORm, where ESC is the escape character (not a visible symbol, usually typed as \u001b in a script or tool that builds the message for you), STYLE is optional (1 for bold, 4 for underline), and COLOR is a foreground code from 30 to 37 or a background code from 40 to 47. Reset back to plain formatting with ESC[0m so the rest of your message isn’t affected by a color you set earlier in the same block.

Foreground Codes

CodeColor
30Dark Gray
31Red
32Yellowish Green
33Gold
34Light Blue
35Pink
36Teal
37White

Background Codes

CodeColor
40Blueish Black
41Rust Brown
42Gray (40%)
43Gray (45%)
44Light Gray (55%)
45Blurple
46Light Gray (60%)
47Cream White

Worked Example

Inside a code block tagged ansi, a line built as ESC[1;31mWarning ESC[0m: ESC[2;36mread this first ESC[0m renders as a bold red “Warning” followed by plain text, then a teal note, all inside one gray-bordered code block. The ESC[0m after each colored word is what keeps the color from bleeding into whatever comes next.

How to Actually Send It

Build your message with the escape codes above, using a generator tool or by typing them directly if your editor supports the escape character.

Wrap the whole thing in a code block that starts with three backticks and ansi, not a plain three-backtick block.

Send it from the Discord desktop app or the discord.com web client.

Anyone viewing it on desktop or web sees the colors. Anyone on the official mobile app sees the same code block in a single flat color.

Why Mobile Doesn’t Show Color

This is a known, long-standing limitation, not a mistake on your end. Discord’s official mobile apps don’t render the ANSI color codes. Reports of this go back to 2022, and some early reports also described the text itself as hard to read on mobile at the time, which later comments suggest has since improved. The colors themselves, though, still don’t appear on mobile, and Discord’s own support-community threads show no official fix or rework announced as of the most recent known activity.

Limitations to Know Before You Use It

Unofficial trick: this relies on Discord’s code-syntax-highlighting side effect, not a feature Discord built or documents as “colored text.” It could change without notice.

Fixed palette only: 8 foreground and 8 background colors, no custom or full RGB colors. A broader color request has been open on Discord’s own feedback boards without an official update.

Desktop and web only: the mobile app shows no color at all.

Code blocks only: this can’t be used for a username, display name, nickname, or regular message text outside a code block. For a styled name or message anywhere else on Discord, use Discord Font Generator instead.

Resets matter: forgetting ESC[0m can carry a color into the rest of the block.

Discord Colored Text vs. Discord Font Generator

This page adds real color inside a message code block using ANSI escape codes, visible only on desktop and web. Discord Font Generator does something different: it swaps letters for styled Unicode characters that work in your display name, nickname, status, or any plain message, on both desktop and mobile. Use this page when you want colored message text in a code block on desktop. Use that one when you want a styled name or message that works everywhere.

Frequently Asked Questions

Not for color. The message still sends and can still be read, but the mobile app shows the whole code block in one flat color instead of the colors you set.

No. ANSI colors only work inside a message code block. For a styled name, use Discord Font Generator instead.

No. It’s plain text pasted into a normal message. Discord’s own code-block renderer does the rest on supported clients.

Usually one of two things: the message was opened on mobile, or the code block was opened with a plain three backticks instead of three backticks followed by ansi. A plain code block never applies any color.

Final Thoughts

Colored Discord text is a real trick, not a myth, but it comes with real limits: desktop and web only, a fixed set of colors, and code blocks only. Used with that in mind, it’s an easy way to make a pinned message, a bot response, or an announcement pop in a channel full of plain text.