Skip to content
All referenceStructure

Markdown Escape Character

How to escape special markdown characters with a backslash to display them literally. Syntax, examples, and which characters need escaping.

What is markdown escape character?

The backslash (\) is markdown's escape character. Placing a backslash before a markdown special character causes it to be displayed literally instead of being interpreted as formatting syntax. This is essential when you need to show asterisks, hashes, underscores, or other special characters as plain text.

Syntax

Escape asterisk

Show asterisks literally without triggering bold or italic formatting.

Result
*literal asterisk*

Escape hash

Prevent a hash at the start of a line from becoming a heading.

Result
# Not a heading

Escape backtick

Display backticks without triggering code formatting.

Result
`not code`

Platform support

PlatformSupportedNotes
GitHubYes
GitLabYes
DiscordYes
SlackYes
NotionYes
ObsidianYes

Common mistakes

Wrong
*literal*
Right
\*literal\*

Without escaping, asterisks will be interpreted as italic markers. Escape both the opening and closing asterisk.

Wrong
\\
Right
\\\\

To display a literal backslash, escape the backslash itself: \\ renders as \.

Tips for escape character

1Characters that need escaping

These characters have special meaning and may need escaping: \ ` * _ { } [ ] ( ) # + - . ! |

2Context matters

A # only needs escaping at the start of a line (where it would become a heading). Mid-sentence, # renders literally without escaping.

Frequently asked questions

Everything you need to know.

1

How do I display a literal asterisk in markdown?

Precede the asterisk with a backslash: \* renders as a literal *. You need to escape both opening and closing asterisks if they would otherwise form bold or italic.

Related elements

Try it in the editor

Paste your markdown and see escape character rendered instantly with professional themes.