Skip to content

Colored Text Generator for Discord

Select words, pick text and background colors, and copy an ansi code block for Discord. Live preview, no sign-up.

  • Free
  • No sign-up
  • Runs locally

Runs in your browser; what you enter is not uploaded to our servers.

Updated

What this Discord colored text generator does

Discord has no color picker for chat messages, but its code blocks can draw ANSI escape sequences, the same codes a terminal uses. This Discord colored text generator lets you type a message, select any words, choose a text color, a background color, bold or underline, and then copies the result as an ansi code block with the invisible escape characters already in place. Paste it into a channel and the colors show for readers whose client supports them.

The page handles the fiddly parts. You never type the escape character, because a chat box gives you no way to enter it. Every colored section is closed with a reset, sections never run across a line break, and the final message is counted against Discord's length limit. A dark and light preview helps you spot hard-to-read combinations before anyone else sees them.

This is an independent tool, not affiliated with, endorsed by or sponsored by Discord Inc. The platform behavior described below was last checked against published guides on September 30, 2026.

How to use the generator

  1. Write your text in box 1, or press an example button (server rules, announcement, status board). If you paste a message that already contains escape characters, the tool turns those codes back into editable styles.
  2. Select the words to style by dragging, by holding Shift with the arrow keys, or with Select all. The line under the toolbar shows how many characters are selected.
  3. Click a text color, a background color, Bold or Underline. The small number under each swatch is its ANSI code. X removes a color, Clear style removes everything from the selection, and Reset all styles keeps the words but drops all formatting. Bold and Underline switch off when the whole selection already has them.
  4. Check the preview. Flip between the dark and light preview and pick a palette. If a colored section would be hard to read, a warning names an example.
  5. Choose an output format and copy. Paste into Discord is the real message. Readable codes swaps the invisible escape character for a visible ␛ symbol so you can read the codes. Code string gives a quoted string for a bot. Press Copy message or Download .txt. If the browser blocks the clipboard, click the output box and press Ctrl+C (Cmd+C on a Mac).
  6. Paste into Discord and send. Leave the first line, ```ansi, exactly as it is.

Styles follow your edits. Text typed inside or right after a colored word takes its style, as in a word processor; use Clear style to undo that.

How ANSI color codes work in Discord

An escape sequence is a short run of characters that a renderer reads as an instruction instead of text. It starts with the escape character (ESC, Unicode U+001B, decimal 27), then an opening bracket, then numbers separated by semicolons, then the letter m, which means "set graphic rendition": change how the following text looks. Code 0 resets everything, so ESC[0m ends a colored section. Code 1 is bold and 4 is underline.

The message is an ordinary code block labeled ansi. This is what the tool writes for Server status: ONLINE with ONLINE set to bold green (␛ stands for the invisible escape character):

```ansi
Server status: ␛[1;32mONLINE␛[0m
```

Here 1 is bold, 32 is green text, m closes the opening sequence, and ESC[0m resets afterward. The tool always writes bold first, then underline, then the text color, then the background, so bold underlined red text on a dark background reads ESC[1;4;31;40m.

Worked example: counting the characters

The message above has 44 characters: 8 for the opening fence and its line break, 21 for the text, 7 for ESC[1;32m, 4 for ESC[0m, and 4 for the final line break and closing fence. A single-code color such as ESC[31m costs 5 characters, so each colored section costs at least 9 once its reset is counted. The built-in server rules example is 150 characters of text and 271 as a message, with five colored sections.

Why sections stop at line breaks

Rather than rely on a client carrying a style across a line break, the tool gives each line its own opening code and its own reset, at a cost of a few characters. Spaces at the edge of a section that only has a text color or bold stay outside it, since they would show nothing.

Color code reference

We found no official specification for this feature, so these names come from community guides and the widely documented palette (checked September 30, 2026). Several guides report that the background codes changed in August 2026 and now reuse the eight text hues, with shades that depend on the reader's theme. That could not be confirmed against Discord's own documentation, so the palette menu offers both views.

Text codeText colorBackground codeClassic backgroundReported newer background
30Gray40Firefly dark blueSame hue as 30
31Red41OrangeSame hue as 31
32Green42Marble blueSame hue as 32
33Yellow43Greyish turquoiseSame hue as 33
34Blue44GraySame hue as 34
35Pink45IndigoSame hue as 35
36Cyan46Light graySame hue as 36
37White47White (cream)Same hue as 37

The numbers never change, so the same message is valid either way. Only how it looks can differ. The preview colors are stand-ins: use them to judge contrast and layout, not exact shades.

Combinations worth copying

Codes can be joined with semicolons inside one sequence, and every colored section should end with ESC[0m. These patterns use the classic palette names from the table above.

SequenceWhat it asks forGood for
ESC[1;31mBold red textWarnings and penalties
ESC[1;4;33mBold, underlined yellow textPost titles
ESC[36mCyan textNumbering and labels
ESC[37;41mWhite text on an orange backgroundStatus badges such as OFFLINE
ESC[4;34mUnderlined blue textLink-like words (they are not clickable)
ESC[0mReset to the default lookEnding every section

Colors inside a code block are decoration only: nothing in an ansi block is clickable, and mentions or emoji shortcodes typed inside a code block are not converted.

Where colored text shows up

  • Desktop app and web browser: guides report that ansi blocks render in color, and that this has been so since 2022.
  • iOS and Android: reports conflict. Older guides say colors do not show; some 2026 guides say recent app versions render them. We have not tested a phone.

Both points were checked on September 30, 2026. Because some readers may see plain monospace text, write messages that still make sense without color: use words like ONLINE and OFFLINE instead of green and red alone. That also helps readers who cannot tell those hues apart.

Why the older diff, css and yaml tricks are unreliable

Before ansi blocks, people got color by choosing a code-block language whose syntax highlighter happened to paint something. A diff block typically colors lines that start with a plus or minus sign, yaml colors the word before a colon, and css colors some bracketed or quoted words. Those results are side effects of how the client highlights code.

There are three problems. You get two or three colors at most, never a background. The shades come from the client's highlighting theme, so they change when that theme does. And you must bend your wording to trigger the highlighter, for example by starting every line with a minus sign. An ansi block states the color directly, which is why this tool uses it.

Practical uses

Server admins and moderators. Mark a rules post title in bold yellow, number the rules in cyan and put the penalty line in red.

Community managers. An event post with yellow labels (When, Where, Prize) and a green call to action is easier to skim than a wall of plain text. Add the event time as a Discord timestamp next to the block, so every reader sees it in their own time zone.

Guild and clan officers. A monospace block keeps columns aligned, so a roster or loot table can color the status column: green for confirmed, yellow for maybe, red for out.

Bot developers. The Code string view gives a quoted string that works as a literal in JavaScript, JSON and Python, with \u001b for the escape character. Send it as message content for the same colors.

Tips and common mistakes

  • Copy, do not retype. If you rebuild a message by hand and miss the invisible escape character, Discord shows [31m as plain text.
  • Keep the first line exact. The fence must read ```ansi followed by a line break, or the block stays uncolored.
  • Mind contrast. White text can vanish on a light theme and gray text on a dark one. Add a background color when a pale or dark text color matters, and compare both preview backgrounds. The color contrast checker gives exact ratios for any pair of hex colors.
  • Watch the length. Discord's limit was 2,000 characters, or 4,000 with Nitro, when we checked. The length tile shows the exact total, and the character counter is handy for the plain text.
  • Avoid triple backticks in your text. Three in a row would close the block early, so the tool inserts an invisible zero-width space. The invisible character tool explains such hidden characters.
  • Test before you announce. Post in a private channel or direct message first, on desktop and on a phone.

Privacy and limitations

Your text, colors and preview are handled by JavaScript in the open tab. The page sends no request containing your message, and there is no account. Your draft is held in session storage for the current tab, which lets a page reload bring it back. Your preview theme, palette and output format go into local storage on this device. Closing the tab ends the draft, and clearing site data removes the rest. The clipboard is used only when you press Copy, and the .txt file is created on your device.

The limits are real. The tool cannot see how any Discord client draws your message, so the preview is approximate and the palette may differ from what you see in the app. It writes only the codes the guides document: reset, bold, underline, eight text colors and eight backgrounds. It does not write italics, strikethrough or 256-color codes. Color works only inside an ansi code block, never in normal chat text. The editor stops at 20,000 characters. When you paste text containing escape sequences, the tool understands the documented codes, drops the rest and tells you how many it removed. Discord can change this behavior at any time, so if a message stops coloring, check the newest guides and test in a private channel.

Frequently asked questions

How do I change text color in Discord?

Discord has no color button. Colors come from code blocks: start a block with three backticks and the word ansi, then put escape codes before the words you want colored. Typing the invisible escape character by hand is impractical, so this tool writes the codes for you. Select words, pick colors, press Copy message, and paste it into Discord on desktop or the web. Phones may not show colors.

Why does my colored text show up as plain text or strange symbols?

Usually one of four things: you are reading on a phone or an older app that does not render ansi blocks, the first line is not exactly ```ansi, the invisible escape character was lost when pasting, or the message was edited afterward. Paste again from the Copy button, check the first line, and view the message in the desktop app or a browser before changing anything else.

Does Discord colored text work on mobile?

Sources disagree. Older guides say the mobile apps do not show ANSI colors, while some 2026 guides say recent iOS and Android versions do. We checked guides on September 30, 2026 and could not test a phone ourselves. Update the app, post a test in a private channel first, and assume some readers may still see plain monospace text.

What are the Discord ANSI color codes?

Text colors are 30 to 37: gray, red, green, yellow, blue, pink, cyan and white in the widely documented palette. Backgrounds are 40 to 47. Code 1 is bold, 4 is underline and 0 resets everything. A code sits between ESC[ and m, for example ESC[31m for red text, and several codes can be joined with semicolons, such as ESC[1;4;31m for bold, underlined red.

Did Discord change its ANSI colors in 2026?

Several guides report that Discord changed the palette in August 2026: the background codes 40 to 47 now use the same eight hues as the text codes, and the exact shades follow the reader's theme. We could not confirm this against Discord's own documentation on September 30, 2026, so the preview here is approximate. The code numbers are the same, so a message still works; only its look can differ.

Do the diff, css and yaml code-block tricks still work?

Sometimes, but they are accidents of syntax highlighting, not a color feature. A diff block colors lines that start with + or -, and css or yaml blocks color certain tokens. You get two or three colors, no backgrounds, and the result depends on the client's highlighter, which can change without notice. ansi blocks give eight text colors and eight backgrounds, which is why this tool uses them.

Is there a character limit for colored messages?

Yes. A Discord message is limited to 2,000 characters, or 4,000 with Nitro, as of September 30, 2026. The fence around the block adds 12 characters, and every color change costs at least nine more: an opening code such as ESC[31m takes 5 characters and the reset ESC[0m takes 4. The tool shows the exact message length as you edit.

Is my text sent anywhere?

No. The text, colors and preview are handled by JavaScript in your browser tab. Nothing is uploaded and there is no account. Your draft lives in session storage for the current tab, so a reload brings it back, and your preview theme and palette choices are stored on this device. Closing the tab removes the draft, and clearing site data removes the rest.

All creators tools

Published · Updated

Found a bug or have an idea? Tell us