Discord Markdown Guide - Headers, Spoilers, Code Blocks and Colored Text

Every Discord text format as of 2025: bold, underline, spoilers, headers, subtext, masked links, code blocks with syntax colours, and ANSI coloured text.

Updated September 29, 2026 5 min read

Use the free Discord Text FormatterDiscord markdown with headers, spoilers, code blocks and ANSI colours

Discord looks like a chat app, but its message box understands a fairly rich formatting language based on Markdown. You can write headings, lists and quotes, hide spoilers, share code with syntax colouring, and, with a trick involving terminal escape codes, even colour your text. Server rules posts, event announcements and bot help messages that look polished are usually built from these pieces.

This guide covers each Discord format as of 2025, explains how the coloured-text trick works and where it shows, and gives tips for readable server announcements. Discord adds formats occasionally and platform support can differ between desktop and mobile, so check Discord's support articles for the latest.

Basic text formats

Format Type this
Bold **text**
Italic *text* or _text_
Underline __text__
Strikethrough ~~text~~
Spoiler ||text||
Inline code `text`
Bold italic underline ***__text__***

Formats can be combined by nesting. Spoilers hide text behind a dark bar until someone clicks it, which is useful for plot twists, answers to puzzles and anything sensitive.

To show a symbol literally, put a backslash in front: \*not italic\*.

Structure: headers, subtext, lists and quotes

These work at the start of a line:

Format Type this
Big header # Title
Medium header ## Section
Small header ### Sub-section
Subtext (small grey line) -# note
Bulleted list - item or * item
Numbered list 1. item
Quote (one line) > text
Quote (rest of message) >>> text

Masked links let you show friendly text instead of a URL: [rules page](https://example.com/rules). Discord shows a warning before opening external masked links, and some servers restrict them.

Code blocks and syntax highlighting

Wrap multi-line code in triple backticks. Add a language name after the opening backticks to get syntax colouring:

```js
const greeting = "hello";
```

Common language names include js, py, json, css, html, sql and diff. Code blocks also preserve spacing, which makes them useful for tables of plain text and ASCII art.

How coloured text works

Discord does not have a colour option for normal text. However, code blocks tagged ansi interpret ANSI escape codes, the same codes terminals use to colour output. A sequence like ESC[31m switches to red, ESC[1m turns on bold, ESC[4m underline and ESC[0m resets.

The catch is the ESC character itself: it is an invisible control character (U+001B) that you cannot type on a normal keyboard. That is why people use a builder to create coloured blocks.

As of 2025 ANSI colours display on Discord desktop and in the browser. The mobile apps show the plain text without colours, so do not rely on colour alone to convey meaning.

The available palette is limited to eight text colours (grey, red, green, yellow, blue, pink, cyan, white) and eight background colours, rendered in Discord's own tones.

Format a message with our tool

The Discord Text Formatter adds the markup for you and previews the result in a Discord-style layout.

  1. Open the Discord Text Formatter and type into Message.
  2. Select text and use the toolbar: Bold, Italic, Underline, Strikethrough, Spoiler, Inline code or Masked link.
  3. Select lines and choose Big header, Medium header, Small header, Subtext, Quote or List.
  4. For code, pick a language from the dropdown and click Code block.
  5. Watch the character counter against 2,000 (4,000 with Nitro) and check the Discord preview. Click spoilers in the preview to reveal them.
  6. Click Copy message and paste it into Discord.

To build coloured text:

  1. In Coloured text builder (ANSI), type a Text piece.
  2. Choose a Text colour, a Background, and optionally Bold or Underline, then click Add.
  3. Repeat for more pieces, using New line where needed. Undo last removes the latest piece.
  4. Check the Block preview, then click Insert into message or Copy block.

Other ways to format Discord messages

Type the markup yourself. For everyday messages, typing **bold** is quickest. A formatter helps with long announcements, spoilers and anything involving ANSI colour.

Bots and embeds. Bots can send rich embeds with coloured side bars, fields and images. That requires a bot and is the better route for recurring, structured posts.

Markdown elsewhere. Discord's formatting is close to standard Markdown, but not identical. If you write Markdown for other platforms, the Markdown cheat sheet and Markdown Preview tool help. WhatsApp uses different symbols; see the WhatsApp Text Formatter.

Tips for readable server posts

One big header per message

Use # for the title and ## for sections. Several big headers in a row are hard to scan.

Keep coloured text to labels

Colour words like "Online", "Closed" or "Required", not whole paragraphs, and remember mobile users see no colour.

Watch the length

Messages over 2,000 characters are rejected for users without Nitro. Split long rules posts into several messages.

Avoid heavy decoration

Glitchy or invisible characters in names and posts can annoy members and break mentions. If you want a spooky title, the Zalgo Text Generator has intensity settings; if you need blank spacing, see the Invisible Character page.

Frequently asked questions

How do I make coloured text in Discord?

Use a code block tagged ansi containing ANSI escape codes. Because the escape character cannot be typed normally, a builder is the easiest way. Colours show on desktop and web, not on mobile.

How do I make a spoiler in Discord?

Put two vertical bars on each side of the text: ||text||. Readers click it to reveal.

How do I make headers in Discord?

Start a line with #, ## or ### followed by a space. -# creates small grey subtext.

What is the Discord message character limit?

2,000 characters as of 2025, or 4,000 with Nitro.

How do I add syntax highlighting to a Discord code block?

Put the language name right after the opening triple backticks, for example ```py.

Try it now: Discord Text Formatter

Loading tool…