Discord Coloured Text Generator
Coloured text in Discord works through ANSI escape codes inside an ansi code block, and it renders on desktop and web but not in every mobile client. This generator writes the escape sequences for you, so you can colour foreground and background text without memorising the code numbers.
How to use the Coloured Text Generator
- Type your text and select foreground and background colours.
- Check the preview, and expect plain text on unsupported clients.
- Copy the ansi code block and paste it into a channel.
How Discord ANSI Color Formatting Works
Discord supports ANSI escape codes when text is enclosed inside an ```ansi code block.
ANSI colour codes in Discord code blocks
Coloured text in Discord is not a formatting feature. It works by opening a code block with the language tag ansi and embedding terminal escape sequences inside it. Discord's syntax highlighter interprets those sequences and paints the text, which is why coloured messages always appear inside the grey code block frame rather than as ordinary chat text.
The palette is small by design. ANSI offers eight foreground colours and eight background colours plus a bold and an underline modifier, so you are choosing from a fixed set rather than picking arbitrary hex values. Combining a foreground and background gives enough range for highlighting log output, marking status lines, or drawing attention to one line in a longer block.
Support is not universal. Rendering works on the desktop app and in the browser client, but mobile builds have historically ignored the escape sequences and shown the raw text. Because of that, colour should be decorative rather than load-bearing: never let the meaning of a message depend on a colour that a share of your members will not see.
Common problems and fixes
- The message shows escape codes as literal text
The client is not rendering ANSI, which is typical on mobile. The content is still readable, just uncoloured. - Colour stops partway through a line
A reset sequence appeared early or a sequence was malformed. Regenerate the block rather than editing the codes by hand. - Colour does not apply at all
The code block must be opened with the ansi language tag immediately after the opening backticks, with no space.
Frequently asked questions
How does colored text work in Discord?
Discord renders ANSI color codes when enclosed in an ```ansi code block with escape characters (\u001b[31m for Red).
Does colored text work on Discord mobile?
Yes! Modern Discord iOS and Android apps render ANSI code block colors properly.
Can I combine bold text with ANSI colors?
Yes. Use \u001b[1;31m to create bold colored text inside an ANSI code block.
Why does my ANSI text show weird symbols in other apps?
ANSI escape codes are designed for terminal emulators and Discord code blocks; they appear as raw escape codes in plain text editors.
Can I use custom hex colours in Discord chat?
No. ANSI provides a fixed set of eight foreground and eight background colours. Hex values apply to role colours and embeds, not chat text.
Does coloured text work in embeds?
An embed has a single colour strip down its left edge set by a hex or decimal value. ANSI colouring inside the description follows the same code block rules.
Does this need Nitro?
No. ANSI code blocks are available to every account.