How to use it
- Type or paste your message: Start from the sample text or replace it with the message you want to send in Discord.
- Select the words to color: Highlight a word, a phrase, or the whole message. Nothing selected? The tool asks you to select something first, so nothing changes by accident.
- Pick a color or style: Choose Foreground or Background and click a swatch. Bold, Italic, Line and Strike stack on the same selection, and the Effects row paints a gradient across it.
- Copy the block: Press Copy text as Discord formatted. You get a complete ansi code block with the invisible ESC characters already in place, ready to paste.
- Paste it into Discord: Paste into any Discord message box and send. The colors render for everyone on desktop, in the web app and on mobile.
Discord ANSI color codes
These are the codes this generator writes for you, so you never have to type them by hand. ESC stands for the invisible escape character (0x1B) - it tells Discord that what follows is formatting rather than text. Every color code needs the 2; prefix to render in Discord.
| Color | Text color | Background color | Hex | Copy |
|---|---|---|---|---|
| Black | ESC[2;30m | ESC[2;40m | #2a2d32 | |
| Red | ESC[2;31m | ESC[2;41m | #ed4245 | |
| Green | ESC[2;32m | ESC[2;42m | #57f287 | |
| Yellow | ESC[2;33m | ESC[2;43m | #fee75c | |
| Blue | ESC[2;34m | ESC[2;44m | #5865f2 | |
| Pink | ESC[2;35m | ESC[2;45m | #eb459e | |
| Teal | ESC[2;36m | ESC[2;46m | #1abc9c | |
| White | ESC[2;37m | ESC[2;47m | #dcddde |
Text style codes
| Style | Code | Copy |
|---|---|---|
| Reset all formatting | ESC[0m | |
| Bold | ESC[1m | |
| Italic | ESC[3m | |
| Underline | ESC[4m | |
| Strikethrough | ESC[9m |
Any color (24-bit truecolor)
Outside the eight palette colors, Discord also accepts 24-bit values: ESC[38;2;255;0;0m paints pure red text and ESC[48;2;255;0;0m paints a pure red background. The Custom row of the generator writes exactly these sequences.
Every sequence ends with ESC[0m so the formatting does not leak into the rest of your message. Because these codes are ordinary characters, they also count toward Discord's 2000-character limit.
See the full ANSI code reference with combination examples →
How to make rainbow text in Discord
Rainbow text is the most requested Discord color effect, and it is just a gradient of 24-bit truecolor codes - one per character. You never have to write them by hand: the Effects row paints them for you.
- Select the phrase: Highlight the words you want to paint. Gradients spend roughly 20 characters of your message budget per letter, so a short phrase renders better than a whole sentence.
- Click the rainbow swatch: It is the first swatch in the Effects row. Switch to Background first if you would rather paint the highlight behind the text than the letters themselves.
- Copy and send: The generator samples the gradient across the selection and writes ESC[38;2;r;g;bm before every character, so the hue shifts smoothly from red through violet.
Sunset and Candy stripes work the same way - Sunset blends warm peach into rose, while Candy alternates two pinks for a striped look. All three are plain ANSI sequences, so they render anywhere Discord renders colors.
How to copy and paste colored text into Discord
Colored text travels as ordinary characters, which means you can copy it out of Discord, keep it in a note, or paste the same block into several channels - the colors come along every time.
- Copy the whole block: Use the Copy text as Discord formatted button rather than selecting the text by hand. It includes the ```ansi opening fence, and without that fence Discord prints the raw escape characters.
- Paste into the message box: Click into any Discord channel or DM and press Ctrl+V (Cmd+V on macOS). The block keeps its monospaced look while you are still editing it.
- Send it: Press Enter. Discord swaps the raw block for rendered colors - you will see the styling applied the moment the message lands in the channel.
- Reuse it anywhere: Anyone who copies your message also copies the escape characters, so reposting a colored message from another server keeps the formatting intact.
On mobile, long-press the message box and choose Paste. Current Android and iOS clients render the same colors as desktop; if you only see odd characters, update the app first.
What are ANSI color codes?
Discord understands a small subset of ANSI escape sequences - the same control codes terminals have used for decades to colorize output. When you wrap text in a code block tagged with the language ansi, the Discord client interprets those sequences instead of printing them.
A color sequence looks like ESC[2;31m, where ESC is the escape character, 2 selects the color set Discord expects and 31 means red. Everything after it stays red until a reset sequence (ESC[0m) or a new color appears, which is why generated code always ends with a reset.
Because the colors are just characters, they travel with your text and anyone who copies the message gets the same colors. No Nitro subscription, no bot and no third-party app is involved.
Tips for better looking colored text
- Keep it short. Every escape sequence adds invisible characters, so a short punchy line renders more reliably than a long paragraph.
- The Classic row uses Discord's own eight-color palette and has the widest client support. Custom colors are written as 24-bit values, and recent clients render those too.
- Use background colors sparingly. One highlighted word stands out far more than a full block of colored text.
- Gradients are painted one character at a time, so they look best on short phrases rather than whole paragraphs.