DWEEB
Tool + reference · Text formatting

Discord Colored Text: Generator and ANSI Color Codes

Discord has no color syntax for ordinary text, but it colors the inside of a code block tagged ansi. Color your text in the generator and copy it with the invisible escape codes already in place, then use the reference below for every code Discord accepts — including the bright, RGB and italic codes it began rolling out in October 2026, and what readers on older clients see instead.

Discord colored text generator

Type your message, select part of it and pick a color or a style. Then press Copy for Discord and paste: the copy is wrapped in the ansi code block Discord colors, with the invisible escape codes already in place. Pasting colored text you copied out of a Discord message brings its colors back in.

Your text — select some, then pick a style
Server status
● Website ONLINE
● Voice DEGRADED
● Database OFFLINE

NEW Colored text works in webhook posts too.
How it looks in Discord
Server status
● Website    ONLINE
● Voice      DEGRADED
● Database   OFFLINE

 NEW  Colored text works in webhook posts too.
Open in DWEEB

202 characters with the code block and escape codes · a message allows 2,000 (4,000 with Nitro or in a webhook's Components V2 text).

The same text as a string for a bot or webhook JSON
"\u001b[1;4mServer status\u001b[0m\n● Website    \u001b[1;32mONLINE\u001b[0m\n● Voice      \u001b[1;33mDEGRADED\u001b[0m\n● Database   \u001b[1;31mOFFLINE\u001b[0m\n\n\u001b[1;37;44m NEW \u001b[0m Colored text works in \u001b[36mwebhook posts\u001b[0m too."

Bright and custom colors, italic and strikethrough are drawn by Discord's newer code renderer, which Discord has been rolling out since October 2026; a reader still on the older one sees those parts as plain text. Discord's phone apps have long shown colored code blocks without the colors, so never let color carry the meaning on its own.

How colored text works in Discord

Discord's markdown has no color syntax: bold, italics and headers are as far as ordinary text goes. Inside a code block, though, Discord highlights code by its language, and the ansi language reads the color codes terminals use. Each code is the escape character (ESC), a left bracket, numbers separated by semicolons and the letter m. ESC[31m turns the text after it red; ESC[0m puts everything back to normal.

The escape character is invisible and cannot be typed on a keyboard, which is why colored text is copied from a generator rather than written by hand. In the example below it is written \u001b so you can see where it goes; in Discord it has to be the real character, and in a bot or a webhook's JSON you write it exactly as \u001b.

```ansi
\u001b[1;31mBold red\u001b[0m and normal text, then \u001b[32mgreen\u001b[0m.
```

Text and background color codes

Each color has a text code and a background code ten higher. The bright set (✦) is drawn only by Discord's newer renderer; the next section shows what every reader gets.

Text and background color codes
ColorTextBackgroundBright text ✦Bright background ✦
Black304090100
Red314191101
Green324292102
Yellow334393103
Blue344494104
Magenta (pink)354595105
Cyan364696106
White (light gray)374797107

What each color looks like in each theme

The named colors are theme colors: Discord picks a shade for each of its four appearance themes so the text stays readable. These are the values it uses, measured from Discord's own stylesheet in October 2026. Black is pure black in every theme, so it disappears on Onyx; white is the same light gray everywhere, and bright white is pure white.

What each color looks like in each theme
CodeLightAshDarkOnyx
31 red#e75858#ec6361#de464a#ca2b37
32 green#399b5d#45a366#1b8d4d#017b40
33 yellow#c07600#ce8100#b36c00#9d5a00
34 blue#3789ea#4591ec#1a7ce6#0268ca
35 magenta#e444bb#f549c9#d53fae#b73495
36 cyan#0098a3#049faa#008995#00757f
37 white#b6b7bc#b6b7bc#b6b7bc#b6b7bc
90 bright black ✦#70717a#70717a#70717a#70717a
91 bright red ✦#ca2b37#ff938e#f47470#e55455
92 bright green ✦#108e4d#21bb63#21bb63#108e4d
93 bright yellow ✦#db6e00#e79418#e79418#db6e00
94 bright blue ✦#5865f2#a0a9fa#5865f2#5865f2
95 bright magenta ✦#b3269c#fd99e9#ff4cd2#ff4cd2
96 bright cyan ✦#007782#5fbfc8#2fa9b3#0096a1

Bold, underline, italic and strikethrough codes

Codes combine in one sequence: ESC[1;4;32m is bold, underlined green. Discord applies every reset in a sequence before any new style, so ESC[0;31m — reset, then red — is the safe way to switch from one style to the next, and it is what the generator writes. Dim (2), blink (5), reverse (7) and hidden (8) do nothing in Discord.

Bold, underline, italic and strikethrough codes
CodeEffectTurn just this offEvery reader sees it?
0Reset all colors and styles—Yes
1Bold22 ✦ (or reset with 0)Yes
4Underline24 ✦ (or reset with 0)Yes
3Italic23 ✦Newer renderer only
9Strikethrough29 ✦Newer renderer only
53Overline55 ✦Newer renderer only
39 / 49Default text / background color—Yes

Any color: RGB and 256-color codes

Discord's newer renderer also reads the two extended color forms terminals use. ESC[38;2;R;G;Bm sets the text to any RGB color — ESC[38;2;255;122;0m is orange — and 48;2 does the same for the background. ESC[38;5;Nm picks entry N of the standard 256-color table: 0–15 are the sixteen named colors above, 16–231 a six-step color cube and 232–255 grays from near black to near white.

There is a trade-off. The named colors follow each reader's theme, so Discord keeps them readable on Light and on Onyx alike; an RGB color is the same everywhere, so a dark blue that reads well on Light can all but vanish on Onyx. Use named colors for anything people must read and keep RGB for accents.

What every reader sees

Since October 2026 Discord has been moving accounts to a new code renderer (in the web client it is the experiment 2026-03-arborium-highlight). Until it reaches everyone, two renderers read the same message differently:

  • Text styled with a code the older renderer does not draw simply shows uncolored there, so a message never breaks — it just loses some color for those readers.
  • Discord's phone apps have long shown an ansi block as plain code without any color. Treat color as decoration and keep the meaning in the words: a status should still say ONLINE or OFFLINE.
What every reader sees
FeatureOlder rendererNewer renderer ✦
8 text and background colors (30–37, 40–47)YesYes
Bold (1) and underline (4)YesYes
Bright colors (90–97, 100–107)Not drawnYes
RGB and 256-color codes (38;…, 48;…)Not drawnYes
Italic, strikethrough, overline (3, 9, 53)Not drawnYes
Turning one style off (22–29, 55)IgnoredYes

Colored text from a bot or a webhook

In code, write the escape inside the string: \u001b in JSON, JavaScript, Java and C#, or \x1b in Python and most shells. A webhook carries it the same way in its JSON body, and the code block colors the same in plain content, an embed description or a Components V2 Text Display — so a webhook sent with cURL or from Python can post colored text without a bot.

Every escape sequence counts toward the message's character limit. ESC[0;1;31m is nine characters and an RGB sequence about eighteen, so per-letter rainbow effects run out of room long before a 2,000-character message does. The generator counts them for you.

{
  "content": "```ansi\n\u001b[1;32mDeploy finished\u001b[0m in 42s\n```"
}

// discord.js
await channel.send("```ansi\n\u001b[1;31mBuild failed\u001b[0m\n```");

# discord.py
await channel.send("```ansi\n\x1b[1;31mBuild failed\x1b[0m\n```")

Why older color lists look wrong

Guides written before August 2026 describe a fixed palette in which 30 was gray and the backgrounds had names like firefly dark blue, marble blue and greyish turquoise. In August 2026 Discord moved the ansi colors into its themes: 30 is now true black, each background uses the same shade as its text color, and every color is tuned per theme, as in the table above. The codes themselves did not change, so older colored messages still render, just in the new shades.

Other ways to color text

Before ansi blocks people colored text with other code-block languages, and one still works: in a diff block, lines starting with + are tinted green and lines starting with - are tinted red. Only ansi can color individual words in the middle of a line.

Outside code blocks Discord colors names and role mentions with the role's color, and an embed or Components V2 container carries an accent color on its edge — but none of these color the words you write. For everything else Discord formats, see the text formatting guide and live preview.

Frequently asked questions

How do you make colored text in Discord?

Type your text in the generator above, select words and pick a color or style, then copy it and paste it into Discord. The copy is a code block tagged ansi with invisible escape codes inside, and Discord's desktop and browser apps color the text in it.

Can you color text in a normal Discord message without a code block?

No. Discord only colors text inside an ansi code block. Outside one, the only colors are role colors on names and mentions and the accent stripe of an embed or a Components V2 container.

Why does my message show [31m instead of colors?

The invisible escape character in front of each code was lost, usually because the code was typed by hand or copied from a page that dropped it. Copy the text from the generator instead. In a bot or a webhook's JSON, write the escape inside the string as \u001b.

Does Discord colored text work on mobile?

Not reliably. Discord's phone apps have long shown ansi code blocks as plain code without colors, while the desktop and browser apps color them. Keep the meaning in the words rather than only in the color.

Can I use any color or hex code in Discord text?

Yes, with the RGB code ESC[38;2;R;G;Bm for text or 48;2 for a background, which the generator's Custom picker writes for you. Only readers on Discord's newer renderer, rolling out since October 2026, see it; others see that text uncolored.

Why do my colors look different to someone else?

The named colors follow each reader's theme, so red on Light is a different shade from red on Onyx by design. RGB colors look the same everywhere. A reader still on Discord's older renderer also sees only the eight basic colors, bold and underline.

Does colored text work in webhooks and embeds?

Yes. An ansi code block colors the same way in webhook content, embed descriptions and Components V2 Text Displays. In the JSON body, write the escape character as \u001b.

Put the guide into practice

Open the exact workflow in DWEEB. Nothing posts until you review and confirm it.

Open the message builder →

Primary sources

Keep learning