Skip to content
FLAVIO COPES
flaviocopes.com
2026

Pasting code snippets in Discord

By Flavio Copes

Learn how to paste clean code snippets in Discord by wrapping them in triple backticks, then adding a language tag like js for syntax highlighting.

~~~

If you want to paste a code snippet in Discord, or in any other application that supports markdown, use code snippets.

Say you want to paste some lines of JS code.

Pasting directly will look like this:

JavaScript code pasted directly in Discord without formatting, showing plain text with no syntax highlighting

You can wrap the code in triple backticks, start and end ```

Discord message input field showing code wrapped in triple backticks before sending

and it will look better:

JavaScript code in Discord displayed in a gray code block with monospace font but no syntax highlighting

even better is use triple backticks followed by language tag, like ```js because now code will be color highlighted, and it will look much better and it’s easier to “visually parse”

Discord message input field showing code wrapped in triple backticks with js language tag

JavaScript code in Discord with full syntax highlighting showing colored keywords, variables, and functions

Final result showing properly formatted JavaScript code with syntax highlighting in Discord

Tagged: Tools · All topics
~~~

Related posts about tools: