MDUtil

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.

Markdown
\*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.

Markdown
\\ \` \* \_ \{ \} \[ \] \< \> \( \) \# \+ \- \. \! \| \~

\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.

Markdown
2024\. A good year

\+ Not a list item

\> Not a quote

Result

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.

Markdown
`**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.

Markdown
&lt;div&gt; is shown as a tag name.

&copy; 2026 &middot; 5 &times; 3 &middot; &#42;

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.

Markdown
| Operator | Meaning |
| --- | --- |
| `a \| b` | a or b |

Result

OperatorMeaning
a | ba or b

Dollar signs

Where math is turned on, $ can start a formula. Escape it to show a price.

Markdown
Apples cost \$5 and pears \$8.

Result

Apples cost $5 and pears $8.

Questions and answers

Which characters can be escaped in Markdown?

Any ASCII punctuation character, including \ ` * _ { } [ ] < > ( ) # + - . ! | ~ as well as $, %, & and @. A backslash before a letter, digit or space is shown as is.

How do I show a backslash?

Type two: \\ shows one backslash. Inside backticks, one is enough.

Why is my backslash showing?

A backslash before a letter, digit or space is not an escape, so it stays visible. Inside code it is always visible.

How do I write an HTML tag as text?

Use &lt; and &gt;, as in &lt;div&gt;, or put the tag in backticks: `<div>`.

Do I need to escape underscores in words?

Usually not. Underscores inside a word, as in snake_case_name, never start italics in CommonMark.

How do I stop a number from starting a list?

Escape the period: 2024\. A good year. For bullets, escape the marker: \- Not a list item.

How do I show an asterisk without italics?

Put a backslash before it: \*. See italic text for the rules that decide when asterisks format text.

How do I show a dollar sign next to math?

Write \$ wherever $ starts formulas, such as on GitHub, in Obsidian and in Markdown Live Preview.