PDF download Download Article
A user-friendly guide to create a line or block of text in Discord on desktop or mobile
PDF download Download Article

Do you want to share a code snippet in a Discord chat? There's an easy way to format any type of text to make it look like code rather than plain text. You'll just need to encase your text with back-ticks (`) to use Discord's chat formatting. This wikiHow will show you how to use special characters in Discord to create a code line or code box on your computer, Android, iPhone, or iPad.

Things You Should Know

  • Use a back-tick (`) on either side of the text to format a line of code.
  • For example, your text should look like: `your text here`
  • To create a block of code, use three back-ticks (```). It should look like: ```your text here```
Method 1
Method 1 of 2:

Using Mobile

PDF download Download Article
  1. If you aren't already logged in, enter your email and password to do so now.[1]
  2. Tap a server from the left panel, or tap a recent Direct Message to open it.
    Advertisement
  3. You'll need to access your punctuation menu to find it. For example, your text should look like `your text here`.
    • On iPhone or iPad, tap and hold the apostrophe key (') to access special characters. The back-tick is the first option on the left.
    • On Android, open the special punctuation menu on the lower-left side of the keyboard to find the backtick key.
  4. When your message sends, the text will be in a code block.
    • You can also censor text by placing two vertical bars (|) on each end of your text.
  5. If you want to create a code block that has more than one line of text, you'll just need to alter the punctuation slightly. Do the following:
    • Encase your text in (```) on both sides.
      • Your text should look like:
        ```line one
        line two```
        .
    • Tap the airplane icon to send it.
  6. Advertisement
Method 2
Method 2 of 2:

Using Desktop

PDF download Download Article
  1. Discord is available for Windows, Mac, and Linux.[2]
  2. Click a server from the left panel, or click a recent Direct Message to open it.
  3. You'll need to access your punctuation menu to find it. You can find the back-tick key in the top-left corner of your keyboard. If needed, you can enable the on-screen keyboard to use it.
    • For example, your text should look like `your text here`.
    • To create a multi-line code block, encase your text in (```) on both sides.
      • Your text should look like:
        ```line one
        line two```
        .
  4. When your message sends, the text will be in a code block.
  5. This will only work on the desktop application. Colored text will not appear on the mobile app. Use the following format:
    • Orange:
      ```arm
      your_text_with_underscores
      ```
      .
    • Red:
      ```diff
      -your text after a hyphen
      ```
      .
    • Blue:
      ```css
      [your text in brackets]
      ```
      .
    • Cyan:
      ```yaml
      your text here
      ```
      .
    • Green:
      ```diff
      +your text after a plus sign
      ```
      .
  6. Advertisement

Community Q&A

Search
Add New Question
  • Question
    My message shows as a code block in Discord, but how do I add a straight colored line beside the block?
    Community Answer
    Community Answer
    Unfortunately you can't color single-line code blocks in Discord. Using a block code should work, however.
  • Question
    When I use text highlighting, can I add code using the things?
    Community Answer
    Community Answer
    That isn't possible unless you use two code boxes with two color codes.
  • Question
    How do I color text on discord?
    Community Answer
    Community Answer
    You can format Discord code blocks to show colored text, you can do ```diff -(text here) ``` to make text red.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Discord Bios80+ Bio Ideas to Spice Up Your Discord Profile
Discord Status IdeasThe Best Discord Status Ideas & How to Set Them
Spoiler an Image on Discord Mobile2 Methods to Spoiler Tag an Image on the Discord App on iOS and Android
Get Music Bot on DiscordGet Music Bot on Discord
Discord Small TextDiscord: How to Use Small Text Formatting in Messages
Hide What Game You're Playing on Discord2 Easy Ways to Hide What Game You're Playing on Discord
Discord User SearchDiscord User Search: 4 Ways to Find Discord Users
Discord Update Failed LoopDiscord Update Failed? Here's How to Fix It for Good
Stream Hulu on Discord Stream Hulu on Discord using Windows and Mac
Send Large Files on Discord Without Nitro5 Simple Ways to Bypass Discord's File Size Sending Limit
Do Strikethrough on Discord2 Ways to Strikethrough Text on Discord: Mobile App & Desktop
Join a Discord Server Join a Public or Private Discord Server
Stop Discord from Opening on Startup5 Easy Ways to Stop Discord from Opening on Startup
Discord No Route Solve the Discord "No Route” Error
Advertisement

About This Article

Rain Kengly
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Rain Kengly. Rain Kengly is a wikiHow Technology Writer. As a storytelling enthusiast with a penchant for technology, they hope to create long-lasting connections with readers from all around the globe. Rain graduated from San Francisco State University with a BA in Cinema. This article has been viewed 1,054,985 times.
How helpful is this?
Co-authors: 18
Updated: October 9, 2024
Views: 1,054,985
Categories: Programming | Discord
Article SummaryX

1. Open the chat box in Discord.
2. Type a back-tick (`) on either side of text to create a one-line code box.
3. Type three back-ticks (```) on either side of the text to create a multiple-line code box.

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,054,985 times.

Is this article up to date?

Advertisement