How to use it
- Type your text in Part 1 and pick a text color, an optional background, and bold or underline.
- Click "Add a colored part" for every extra piece of text that needs its own color.
- Check the preview, then click "Copy message".
- Paste into Discord on desktop or in the browser and press Enter. Do not edit the first or last line.
Discord does not give you a color picker for chat messages. What it does give you is syntax highlighting inside code blocks, and the ansi language in that highlighter understands terminal color codes. Wrap your text in the right codes and it shows up red, green or pink. That is all this tool does: it builds the block so you do not have to type invisible characters.
QuirkText is not affiliated with Discord. The tool produces plain text, and what you see depends on the Discord app you use.
How Discord colored text works
A message that starts with three backticks and the word ansi becomes a code block. Inside it, an escape character followed by [, one or more numbers and the letter m changes the style of everything after it. The code 0 resets the style.
The generated message for the default example looks like this, where ESC stands for the invisible escape character (Unicode U+001B):
```ansi
ESC[1;32mHello ESC[0mESC[4;35mDiscordESC[0m
``` In that line, 1 is bold, 32 is green, 4 is underline and 35 is pink. Codes are joined with semicolons. This generator writes them in the order bold, underline, text color, background.
Discord text color codes
Discord uses the standard ANSI numbers but its own color names. The names below are the ones used in community guides such as the Python Discord guide. The generator shows shorter labels.
| Code | Text color | Code | Background (Discord name) |
|---|---|---|---|
| 30 | Gray | 40 | Firefly dark blue |
| 31 | Red | 41 | Orange |
| 32 | Green | 42 | Marble blue |
| 33 | Yellow | 43 | Greyish turquoise |
| 34 | Blue | 44 | Gray |
| 35 | Pink | 45 | Indigo |
| 36 | Cyan | 46 | Light gray |
| 37 | White | 47 | White |
Two style codes work alongside the colors: 1 for bold and 4 for underline. Code 0 clears everything.
How to color part of a sentence
Take the sentence "Server rules: no spam". You want "Server rules:" in bold yellow and "no spam" in red.
- In Part 1, type
Server rules:(keep the space at the end) and choose Yellow with Bold ticked. - Click "Add a colored part". Type
no spamand choose Red. - The tool builds
ESC[1;33mServer rules: ESC[0mESC[31mno spamESC[0minside the block. - Copy and paste. Yellow bold text is followed by red text on the same line.
The reset after each part is what keeps colors from leaking into the next part. If you build the message by hand and forget a reset, every character after that point keeps the old style.
Colored text on mobile and other limits
Discord does not document this feature in its help center, so the best sources are community guides. They agree on one point: it works in the desktop app and in the browser, and the mobile app may not draw the colors. Anyone reading your message on a phone may see plain text. Do not put anything important only in a color.
- The whole message is one code block. You cannot mix it with normal bold, italics or mentions in the same message, because those do not render inside code.
- Escape codes count as characters. A message with many short colored parts uses up your message length limit faster than the visible text suggests.
- Exact shades follow your Discord theme. The preview in this tool uses a fixed palette, so a color may look a little different in your server.
- Text colors only work in message bodies. They do not change usernames, channel names or role colors.
Common mistakes
Typing the codes by hand
The escape character cannot be typed on a normal keyboard and does not show up when you paste it into most editors. Use the copy button instead of retyping the output.
Cutting off the first or last line
Both fence lines are needed. If the closing three backticks are missing, Discord shows the rest of your chat as code.
Low contrast
White text on a white background, or gray on dark blue, is hard to read in light and dark themes alike. Pick one strong text color and add a background only for a few words.
Expecting hex colors
Discord gives you eight text colors and eight backgrounds. A hex code such as #ff8800 has no equivalent here.
Where this fits with other Discord tools
For bold, italics, strikethrough and spoiler tags, use the Discord text formatter. For event times that show correctly in every time zone, use the Discord timestamp generator. For something louder, the glitch text generator makes distorted Unicode text that works in nicknames and bios, which code blocks cannot do.
Sources
- Python Discord: Discord messages with colors (code table, formats, mobile note)
- rebane2001: Discord Colored Text Generator (gist) (desktop ANSI colors)
- kkrypt0nn: Discord colored text (gist) (format codes, reset code, mobile note)
- Discord Support: Markdown Text 101 (code blocks)
Checked October 2026.
Frequently asked questions
How do I make colored text in Discord?
Discord has no color button. The usual method is an ansi code block with escape codes in front of your text. This generator writes the block for you: pick colors, copy the message, paste it and send.
Does Discord colored text work on mobile?
It may not. Guides written by Discord community members say ANSI colors are not supported in the mobile app, so people on phones may see plain text in a code box. Test with a friend on mobile before you rely on it.
Which colors can I use?
Eight text colors (gray, red, green, yellow, blue, pink, cyan, white) and eight backgrounds (dark blue, orange, blue gray, gray turquoise, gray, indigo, light gray, white). Discord has no hex or RGB option that this tool can rely on.
How do I add a background color to Discord text?
Choose a value in the Background list for that part. The tool adds a code from 40 to 47 next to the text color code. Use contrast: white on light gray is hard to read.
Why do I see strange characters instead of colors?
The block lost its opening line or its escape character. Paste the whole message exactly as copied, and make sure the first line is three backticks followed by the word ansi. Typing the codes by hand usually fails because the escape character is invisible.
Can I color just one word in a sentence?
Yes. Split the sentence into parts, give the word its own part and color, and leave the other parts on Default. The tool adds a reset code after each colored part, so the color does not spill over.
Is this the same as Discord markdown?
No. Markdown covers bold, italics, strikethrough and spoilers, and it has no colors. For those, use the Discord text formatter.