Skip to Content

How to Use Discord Code Blocks — #1 Comprehensive Guide

How to Use Discord Code Blocks — #1 Comprehensive Guide

Sending messages on Discord is simple. You type the characters in the message field and click or press “Send.” No need to be knowledgeable about coding for this purpose.

But if you want your messages to stand out, you need to use Discord code blocks, which you’ll learn how to add below.

 

How to Use Discord Code Blocks

To use Discord code blocks, follow these steps:

  1. Open Discord and click on a server
  2. Click on a text channel where you have message permissions
  3. Type a single backtick (`) for a single line of code or 3 backticks (“`) for multiple lines of code into the message field
  4. Type your message after the backtick
  5. Close the message block with another backtick (or 3 backticks)
  6. Press “Enter” on the keyboard

 

 

Step 1: Open Discord and click on a server

How to Use Discord Code Blocks (Desktop) Step 1

You’ll find the server icons (both those you have joined without an invite or with one) on the left-side panel of the Discord app or page.

All the channels of the server, both text and voice, are then seen on the object panel.

 

Step 2: Click the text channel you have message permissions

How to Use Discord Code Blocks (Desktop) Step 2

Having message permissions is important as you won’t be able to send or even type a message if you’re not allowed to do so.

In effect, you can’t use code blocks if you can’t type a message.

 

Step 3: Type a backtick or 3 backticks in the message field

How to Use Discord Code Blocks (Desktop) Step 3

To do this, click inside the message field and tap the backtick key, which is found below “Escape” and “1” on the keyboard.

For adding a single line code block, then add 1 backtick. 

How to Use Discord Code Blocks (Desktop) Step 3

If, however, you want to enter multiple line code blocks, then type 3 backlinks.

 

Step 4: Type the message after the backtick or backticks you added

How to Use Discord Code Blocks (Desktop) Step 4

Whether you add a single-line or multiple-line code block, you don’t need to add a space between the backticks and the text.

For multiple-line code blocks, add a new line by pressing “Shift” and “Enter” on the keyboard.

How to Use Discord Code Blocks (Desktop) Step 4

 

Step 5: Close the message with a backtick or 3 backticks

How to Use Discord Code Blocks (Desktop) Step 5

Like the previous step, no need to add a space between the last letter of the text or message with the backticks.

For single-line code blocks, add a single backtick still. For multiple-line code blocks, add 3 backticks.

 

Step 6: Press the “Enter” key

How to Use Discord Code Blocks (Desktop) Step 6

This will make the text you added have a different background color than regular messages in the text channel. 

But this will only happen if you correctly format the code block.

 

How to Use Discord Code Blocks on Discord Mobile

To use Discord code blocks on mobile devices, follow these steps:

  1. Launch Discord and tap a server
  2. Tap on a text channel where you have message permissions
  3. Insert one backtick for a single line of code (`) or 3 backticks for multiple lines of code (“`)
  4. Type your message after the backtick/s you entered
  5. Close the message with 1 or 3 backticks depending on the length of your code
  6. Tap the “Enter” key to send the message

The process for using Discord code blocks on the mobile app is similar when done on a computer.

You only have to find the right buttons to push depending on the phone model you’re using.

 

Step 1: Open Discord and tap a server

How to Use Discord Code Blocks (Mobile) Step 1

You can find all the servers you have access to on the left-side panel.

An object panel with all the text and voice channels of that server will then appear.

 

Step 2: Press the text channel you have message permissions

How to Use Discord Code Blocks (Mobile) Step 2

If you don’t have message permissions on a particular text channel, you can’t send or reply to messages.

The text channel’s chat room then opens.

 

Step 3: Type the backtick or backticks in the message field

To do this, press on the message field to make the blinking cursor appear. Then find the backtick button on the onscreen keyboard.

On iPhones, you have to press the “123” key first then long-press on the apostrophe (‘) key. A floating menu will then appear. 

How to Use Discord Code Blocks (Mobile) Step 3

Tap the backtick key once for single-line code blocks. If you’re adding multiple-line code blocks, repeat long-pressing the apostrophe (‘) key and the backtick key 3 times. 

How to Use Discord Code Blocks (Mobile) Step 3

On Android phones, tap the “?123” and “=\<” keys to find the backtick key.

How to Use Discord Code Blocks (Mobile) Step 3

Then press once on the backtick key for single-line code blocks and three times for multiple-line code blocks.

How to Use Discord Code Blocks (Mobile) Step 3

 

Step 4: Type the message after the backticks added

How to Use Discord Code Blocks (Mobile) Step 4

Don’t add a space between the backtick and the message for the code block to be formatted correctly.

For multiple-line code blocks, press the “Return” (iPhone) or “Enter” (Android) keys to add another line.

 

Step 5: Close the message with backticks

How to Use Discord Code Blocks (Mobile) Step 5

Add a single backtick for single-line code blocks and three backticks for multiple-line code blocks.

Don’t add a space between the last letter of the text and the backtick.

 

Step 6: Tap the “Enter” key

How to Use Discord Code Blocks (Mobile) Step 6

This will send the new message to the text channel with a differently-colored background.

But if you don’t want to format your message as a code block, you can always make the text bigger in Discord.

 

How to Change the Color of Discord Code Blocks

By default, Discord’s code blocks are black. Now, if you want to change this to a more vibrant color, you only need to add text or symbols on top of the backticks. 

But for this to happen, you have to use a multi-line code block format even if you only have a single line of text added.

Refer to the formulae featured below to change the color of Discord code blocks.

Note: We can’t display the backticks as regular text due to a formatting issue, so we had to use screenshots instead to show you how it is done (see below). 

Here’s an explanation for you, though:

For instance, to change the color to red, you would simply input 3 backticks, then write diff and then a dash, followed by the rest of your text and 3 backticks at the very end, just as explained in the screenshot below.

 

Red

How to Change the Color of Discord Code Blocks (Red Formula)

On Discord, it looks like this:

How to Change the Color of Discord Code Blocks (Red)

 

Orange

How to Change the Color of Discord Code Blocks (Orange Formula)

On Discord, it looks like this:

How to Change the Color of Discord Code Blocks (Orange)

 

Green

How to Change the Color of Discord Code Blocks (Green Formula)

On Discord, it looks like this:

How to Change the Color of Discord Code Blocks (Green)

 

Blue

How to Change the Color of Discord Code Blocks (Blue Formula)

On Discord, it looks like this:

How to Change the Color of Discord Code Blocks (Blue)

 

Cyan

How to Change the Color of Discord Code Blocks (Cyan Formula)

On Discord, it looks like this:

How to Change the Color of Discord Code Blocks (Cyan)

 

Frequently Asked Questions about How to Use Discord Code Blocks

 

How is a code block different from a markdown in Discord?

Code blocks in Discord change the text’s background of the messages you’re sending. Markdown, on the other hand, uses code to change the formatting of the text itself. You can make the text have a bold, italic, or underlined format with markdown.

 

Can you make the text inside the code blocks in Discord colored?

If you’re using Discord on a computer, you can make the text inside multi-line code blocks colored. You can do this by adding symbols within the code block’s text. If you want orange-colored text, add “arm” and underscores to the text or enclose the text within brackets for blue-colored text.