Discord Colored Text Generator

Type your message, select some words, pick a color, then copy. You get an ansi code block that Discord shows in color. Nothing is sent anywhere.

Text
Background

The box above shows roughly how Discord's dark theme colors look. Select text first, then click a swatch.

12 / 2000 characters

The escape character (shown here as ␛) is invisible. Use the Copy button, because copying from the box may lose it.

How colored text works in Discord

Discord has no color option for normal messages. The trick is a code block with the language set to ansi. Inside it, Discord reads ANSI escape codes, the same codes terminals use for color, and paints the text. A colored word looks like this before Discord renders it:

```ansi
␛[0;31mThis is red␛[0m and this is normal
```

␛ stands for the escape character (Unicode U+001B). You cannot type it on a normal keyboard, which is why people use a generator like this one.

Color codes

Each code starts with ␛[, lists numbers separated by semicolons and ends with m. 0 resets, 1 is bold, 4 is underline.

Text colorCodeBackgroundCode
Gray30Dark blue40
Red31Orange41
Green32Marble blue42
Yellow33Grey turquoise43
Blue34Gray44
Pink35Indigo45
Cyan36Light gray46
White37Cream47

Discord picks the exact shades, which follow the Solarized palette. The swatches here are close approximations. This tool sticks to these 16 basic codes, the set people use in Discord.

Limits and gotchas

  • Not documented by Discord. Discord's Markdown help article and developer docs do not mention ansi blocks. It is widely used on Discord's desktop app, but because it is undocumented, support can differ between apps and could change. Send a test message first, especially if your readers are on mobile.
  • It is a code block. The text uses a monospace font and sits in a grey box. Bold, links, mentions, emoji shortcodes and spoilers do not work inside it.
  • 2,000 characters. Escape codes count toward Discord's message length limit, so heavily colored text runs out faster than you expect.
  • Background colors fill only the characters, not the whole line.

Other ways to get color in Discord

Before ansi blocks worked, people used syntax highlighting languages to get color by accident, for example ```diff with lines starting + (green) or - (red). That still works and is simpler when you only need red and green:

```diff
+ this line is green
- this line is red
```

More Discord tools