How to Format Text as Code in Discord


This wikiHow teaches you how to create a code line or code box in Discord chat. You can do this on both desktop and mobile versions of Discord.

Part 1
On Desktop

On Desktop on How to Format Text as Code in Discord

1
Click or double-click the Discord app icon, which resembles the white Discord logo on a purple background. This will open the Discord chat window if you're logged in. If you aren't logged in, enter your email address and password and click Login.

On Desktop on How to Format Text as Code in Discord

2
Click the channel to which you want to send your text in the upper-left side of the page.

On Desktop on How to Format Text as Code in Discord

3
This is at the bottom of the Discord window.

On Desktop on How to Format Text as Code in Discord

4
It's the ` key typically found in the upper-left side of the keyboard on the same key as the tilde (~). Doing so will type one back-tick into the Discord text box. If you want to format a block of code, skip this step and the next three steps.

On Desktop on How to Format Text as Code in Discord

5
Type in the word or phrase you want to format as a line of code.

On Desktop on How to Format Text as Code in Discord

6
You should now have one back-tick on each side of the text you're sending as a code. For example, if you're trying to format the line "I like trains", you would have `I like trains` typed into the text box.

On Desktop on How to Format Text as Code in Discord

7
Doing so will format and send your message.

On Desktop on How to Format Text as Code in Discord

8
If you want to send a sample of code (e.g., an HTML page) to someone through Discord, you can type three back-ticks (```) before and after the text and then press ↵ Enter.[1] For example, to format the code "<!DOCTYPE html>" as a block, you would type ```<!DOCTYPE html>``` into Discord and press ↵ Enter. If you want to set a specific language for your code block, type the three apostrophes, type in the language (e.g., css) on the first line, create a new line, and add the rest of your code before typing the closing three apostrophes.

Part 2
On Mobile

On Mobile on How to Format Text as Code in Discord

1
Tap the Discord app icon, which resembles a white Discord logo on a purple background. Doing so will open the Discord chat page if you're logged into your account.

On Mobile on How to Format Text as Code in Discord

2
Tap the channel to which you want to send your text.

On Mobile on How to Format Text as Code in Discord

3
It's at the bottom of the screen.

On Mobile on How to Format Text as Code in Discord

4
A back-tick can be typed in a couple of different ways depending on your phone: iPhone — Tap 123 in the bottom-left corner of the keyboard, tap and hold the apostrophe icon above the return button, drag your finger left to select the far-left back-tick icon (`), and release your finger. Android — Tap !#1 in the lower-left side of the keyboard, then tap the ` back-tick icon. If you want to format a block of code instead, skip this step and the next three steps.

On Mobile on How to Format Text as Code in Discord

5
Type in the text you want to format.

On Mobile on How to Format Text as Code in Discord

6
You should now have one back-tick on either side of your text. For example, if you want to format the phrase "Hello there!", you would have `Hello there!` typed into the chat box.

On Mobile on How to Format Text as Code in Discord

7
It's to the right of the text box.

On Mobile on How to Format Text as Code in Discord

8
If you want to send a sample of code (e.g., an HTML page) to someone through Discord, you can type three back-ticks (```) before and after the text and then tap the "Send" icon. For example, to format the code "<!DOCTYPE html>" as a block, you would type ```<!DOCTYPE html>``` into Discord. If you want to set a specific language for your code block, type the three apostrophes, type in the code language (e.g., css) on the first line, create a new line, and add the rest of your code before typing the closing three apostrophes.