Skip to main content

Colored text on Discord

· 4 min read
Iraas
Monni Developer

Discord has the capabilities to display colored text through code blocks and syntax highlighting. The library discord uses for highlighting is highlight.js. Code blocks also supports ANSI which offers a more controllable coloring experience.

warning

Features discussed in this page aren’t currently supported on mobile!

Ansi


Discord offers support for ANSI colored text through code blocks. To get started you need to copy the escape unicode character used (\u001b). To copy the raw character use the copy button below.



Now that you know how to copy the escape character, Let’s go over how the ANSI is structured. To be able to send colored messages you need to use the ANSI language on a code block. After that, you need to make sure to use the correct format as a prefix before your text. \u001b[{format code};{ansi code};{ansi code}m. We will go over the codes later on. To reset to default use the \u001b[0m prefix.

Example message with the \u001b character unescaped.

```ansi
Red text with blue background.
```

ansi-example