Escaping Characters in Markdown
Put a backslash before a symbol to show it as typed: \* shows an asterisk instead of starting italics. This guide lists the characters you can escape and the other ways to show symbols as text.
Quick answer
How do you escape characters in Markdown?
Put a backslash \ right before the character: \*not italic\* shows the asterisks, and \# at the start of a line stays text instead of making a heading. Any ASCII punctuation can be escaped this way. Inside backticks no escaping is needed.
\*Not italic\*
\# Not a heading
`*shown as typed*`Result
*Not italic*
# Not a heading
*shown as typed*
Escaping syntax and examples
Three tools cover every case: the backslash, code spans, and HTML entities.
Characters you can escape
Any ASCII punctuation can follow a backslash. Before letters and digits the backslash stays visible.
\\ \` \* \_ \{ \} \[ \] \< \> \( \) \# \+ \- \. \! \| \~
\n and \d keep their backslash.Result
\ ` * _ { } [ ] < > ( ) # + - . ! | ~
\n and \d keep their backslash.
Lines that look like lists or quotes
A backslash keeps a line that starts like a list, heading or quote as ordinary text.
2024\. A good year
\+ Not a list item
\> Not a quoteResult
2024. A good year
+ Not a list item
> Not a quote
Code needs no escaping
Inside backticks and code blocks every character is shown as typed, backslashes included.
`**bold**` and `C:\Users\name`Result
**bold** and C:\Users\name
HTML entities
Named or numbered entities show characters that would otherwise be read as HTML, and symbols that are hard to type.
<div> is shown as a tag name.
© 2026 · 5 × 3 · *Result
<div> is shown as a tag name.
© 2026 · 5 × 3 · *
Pipes in tables
In a table cell, a pipe must be escaped even inside code.
| Operator | Meaning |
| --- | --- |
| `a \| b` | a or b |Result
| Operator | Meaning |
|---|---|
a | b | a or b |
Dollar signs
Where math is turned on, $ can start a formula. Escape it to show a price.
Apples cost \$5 and pears \$8.Result
Apples cost $5 and pears $8.
Questions and answers
Which characters can be escaped in Markdown?
\ ` * _ { } [ ] < > ( ) # + - . ! | ~ as well as $, %, & and @. A backslash before a letter, digit or space is shown as is.How do I show a backslash?
\\ shows one backslash. Inside backticks, one is enough.Why is my backslash showing?
How do I write an HTML tag as text?
< and >, as in <div>, or put the tag in backticks: `<div>`.Do I need to escape underscores in words?
snake_case_name, never start italics in CommonMark.How do I stop a number from starting a list?
2024\. A good year. For bullets, escape the marker: \- Not a list item.How do I show an asterisk without italics?
\*. See italic text for the rules that decide when asterisks format text.