← Guides
🌈

How to Write Colored Text in Discord

Discord can show red, green, blue and other colored text using ANSI code blocks. Here is how it works, which colors are available, and its limits.
Updated October 17, 2026 Β· Boxtype
Open the Colored Text tool β†’

How Colored Text Works

Discord has no color button, but it does support ANSI code blocks. ANSI escape codes are an old terminal standard: hidden characters that tell a terminal to switch colors. When you start a code block with ```ansi, Discord reads those codes and colors the text inside. The catch is that the escape character can't be typed on a normal keyboard. That is why most people use a generator: you pick colors, the tool writes the codes, and you paste the whole block into Discord.

The Basic Format

A colored message looks like this when written out: ```ansi [ESC][0;31mThis line is red [ESC][0;32mThis line is green ``` Each [ESC] stands for the invisible escape character. The numbers between [ and m are the style codes: 0 resets the style, and 31 or 32 picks a text color. You can combine several codes with semicolons, such as 1;34 for bold blue text.

Available Colors

Text colors: 30 gray, 31 red, 32 green, 33 yellow, 34 blue, 35 pink, 36 cyan and 37 white. Background colors: 40 dark blue, 41 orange, 42 marble blue, 43 grayish turquoise, 44 gray, 45 indigo, 46 light gray and 47 white. Styles: 1 bold and 4 underline. Discord maps these to its own palette, so the exact shades are fixed. You can mix a text color and a background on the same line, but some pairs, like gray on dark blue, are hard to read.

Where Colors Show Up

Colors appear in the Discord desktop app and in the browser. The Discord mobile apps show the same message as a plain code block in gray, so colored text should never be the only way you convey something important. For a rules channel, for example, use color to decorate headings rather than to mark which rules matter. Colored text works anywhere you can post a code block: messages, threads, forum posts and bot or webhook messages. It does not work in names, such as usernames, nicknames and channel names.

Good Uses for Colored Text

Status boards: green for online services, red for outages. Game stats: color player names by team. Changelogs: green for added, red for removed, yellow for changed. Role lists: match each line to a role color. Announcements: a bold colored heading on top of normal text. Keep it to two or three colors per message. A rainbow of lines is fun once but quickly becomes hard to read.

Troubleshooting

If you see the raw codes instead of colors, the block probably doesn't start with ```ansi on its own line, or the escape characters were lost when copying. Copy the whole block again from the generator rather than retyping it. If the colors look right on desktop but not on your phone, that is expected: mobile shows colored blocks without colors.

Step by Step: Your First Colored Message

1. Open Boxtype's Colored Text tool and type your message, one line per color. 2. Tap a line and pick a text color, then optionally a background color, bold or underline. 3. Copy the result. It starts with ```ansi and ends with ```. 4. Paste it into Discord as one message and send it. On desktop you'll see the colors immediately. If you only see codes, the block is missing the word ansi on the first line, or the invisible escape characters were lost while copying.

Design Tips

Treat color like highlighter pen: one or two colors per message are enough. Red for warnings, green for success and yellow for notes is a pattern most people already understand. Bold makes a colored word stand out further, and a background color works well for short labels like NEW or DONE. Avoid gray text on the dark background for anything important; it is hard to read. And because colored text lives in a code block, it uses a monospace font, which also makes it good for small tables and aligned lists.

Colored Text Versus Other Options

ANSI color is the only way to change text color inside a normal Discord message, but it isn't always the best choice. For a heading, Discord's # header is bigger and works on every device. For emphasis, **bold** is clearer for screen readers. For a big visual banner, emoji letters or a GIF stand out more. Colored text shines for status lists, small changelogs, game stats and rule highlights where a splash of color helps scanning, mostly for desktop users.

Copying From Other Places

If you copy a colored message from Discord or another website and paste it somewhere else, the invisible escape characters are often lost, and the colors turn into raw codes like [31m. That's why editing an old colored message by hand is tricky. Keep your original text, rebuild it in the Colored Text tool when you need changes, and copy the fresh result.
Open the Colored Text tool β†’