Tools

Discord text formatting

What to type for every style Discord has, what it looks like, and the catches. Each one copies.

The same codes work in messages, in bot replies and in embed descriptions and field values. They do not work in usernames, channel names or the server name.

Text

TypeYou getNotes
*italic* or _italic_italic
**bold**bold
***bold italic***bold italic
__underline__underlineTwo underscores. One underscore on each side is italic.
__*underline italic*__underline italicStyles stack: put one inside another.
~~strikethrough~~strikethrough
||spoiler||spoilerHidden until someone clicks it.

Code

TypeYou getNotes
`inline code`inline codeNothing inside is formatted, so it also shows markdown as typed.
```py print("hello") ```print("hello")A code block. The word after the first three backticks (py, js, json, diff, ...) turns on colouring.

Lines and blocks

TypeYou getNotes
# Big headingBig headingAt the start of a line, with a space after the #.
## Medium headingMedium heading
### Small headingSmall heading
-# small grey textsmall grey textSubtext, for footnotes and fine print.
> one quoted lineone quoted line
>>> everything after this is quotedeverything after this
is quoted
Quotes the rest of the message, every line.
- an item - another - indented
  • an item
  • another
    • indented
- or * for bullets; two spaces in front to indent.
1. first 2. second
  1. first
  2. second

Links, mentions and the rest

TypeYou getNotes
[link text](https://example.com)link textA masked link. Discord asks before opening a site the reader has not trusted.
<https://example.com>https://example.comAngle brackets: the link without a preview card.
<@USER_ID>@someoneA user. Turn on Developer Mode, right-click, Copy ID.
<@&ROLE_ID>@RoleA role.
<#CHANNEL_ID>#channelA channel.
</ping:COMMAND_ID>/pingA slash command people can click to start typing.
<t:1800000000:R>in 3 monthsA timestamp, shown in each reader's own time zone. Make one.
\*not italic\**not italic*A backslash shows the next character as typed.

From a bot

A bot sends the same text: **bold** in a reply is bold. Both libraries can escape text you did not write, so a username with asterisks or a || in a form answer does not turn into formatting:

# discord.py
discord.utils.escape_markdown("**not bold**")   # \*\*not bold\*\*
discord.utils.escape_mentions("@everyone")      # cannot ping anyone
// discord.js
const { escapeMarkdown, bold, heading, subtext, hyperlink } = require("discord.js");

escapeMarkdown("**not bold**");              // \*\*not bold\*\*
heading("Patch notes", 2);                   // ## Patch notes
hyperlink("the docs", "https://example.com"); // [the docs](https://example.com)

To stop a message pinging people at all, whatever it says, send it with no allowed mentions: allowed_mentions=discord.AllowedMentions.none() in discord.py, allowedMentions: { parse: [] } in discord.js.

Press / or Ctrl K on any page to search.