The Backslash Escape
The backslash character (\) acts as an escape signal — it tells the markdown parser to treat the next character as plain text rather than syntax:
\ → renders as (literal asterisk, not italic marker)
\# → renders as # (literal hash, not a heading)
\_ → renders as _ (literal underscore, not emphasis)
\[ → renders as [ (literal bracket, not start of a link)
\| → renders as | (literal pipe, not a table delimiter)
\\ → renders as \ (literal backslash)
The Full List of Escapable Characters
These characters have special meaning in markdown and can be escaped with \ (see the Markdown escape characters reference for full details):
\ * _ { } [ ] ( ) # + - . ! |`
Context Matters
Not every special character needs escaping everywhere. Context determines whether a character is interpreted as syntax:
#needs escaping only at the start of a line (where it would become a heading).#hashtagmid-sentence renders literally without any escaping.-needs escaping only at the start of a line followed by a space (where it would become a bullet list item)..after a number needs escaping only when you don't want an ordered list:2026\. A great year.
Escaping Backticks
Backticks are special: you can't simply backslash-escape a backtick inside a code span because the backtick is both the delimiter and the content.
Single Backtick in Inline Code
Use double backticks as the delimiter to include a single backtick inside the code span:
`` code with backtick` ``
Backtick in Prose (Not Code)
To display a single backtick outside of a code context, use the backslash escape:
\ → renders as `
Code Blocks: No Escaping Needed
Inside backtick code spans (`inline`) and fenced code blocks, everything is displayed verbatim. The parser does zero markdown processing inside code blocks:
``` ```text This is not bold * This is not a list item ``` ```
This is why code blocks are the best way to show literal markdown syntax in documentation — no escaping required.
Platform-by-Platform Breakdown
GitHub and GitLab
Full support for all backslash escapes. GitHub respects all 19 escapable characters defined in the CommonMark spec.
Obsidian
Full CommonMark escape support. In Obsidian's live preview, escaped characters render immediately so you can see the literal character in the editor.
Notion
Notion supports backslash escaping in its markdown import mode. In the Notion editor UI, special characters in text blocks are automatically handled.
Discord
Discord supports backslash escaping for its mrkdwn-style formatting characters (, _, ~~, etc.). Use \text\* to display literal asterisks in Discord.
Slack
Slack supports backslash escaping for its mrkdwn formatting characters.
Common Use Cases
Displaying Literal Asterisks
You're writing about math and want to show multiplication without triggering italic:
5 \ 3 = 15 renders as 5 3 = 15
Literal Hash at Start of Line
\# Not a heading renders as "# Not a heading" in plain text
Pipe Characters in Table Cells
If your table cell content contains a |, escape it:
| Item | A | B | — code span handles it
or
| Item | A \| B | — backslash escape
Ordered List That Starts With a Number
To prevent 2026. A great year. from becoming a numbered list item:
2026\. A great year. renders as plain text
Showing Raw Markdown Syntax in Documentation
When writing markdown documentation (like this guide), showing bold as literal text requires either escaping (\\bold\\) or wrapping in a code span (`bold`). Code spans are generally cleaner.
Common Mistakes
Over-Escaping
You don't need to escape characters that aren't actually triggering formatting. \.com is unnecessary — .com renders literally without escaping because a period mid-word isn't a markdown marker.
Escaping Inside Code Blocks
Never put escape backslashes inside code blocks — they display as literal backslashes since code blocks are escape-free zones.
Wrong: Backslash for Newline
first line\ → this creates a hard line break in GFM (GitHub Flavored Markdown), not an escaped character. Don't confuse the line-break backslash with the escape backslash.
Showing a Literal Backslash
To display a single backslash in the output, write two backslashes:
\\ → renders as \
The first backslash escapes the second, and the result is a single literal backslash character.
Full reference: Markdown Escape Characters.
Ready to put this into practice? Paste your markdown into the free MarkdownTools PDF exporter or HTML converter — no signup required.