Backslash escapes
A backslash tells the parser to treat the next character as plain text. Use it whenever a character would otherwise trigger formatting: an asterisk around a word, a hash at the start of a line, or a number followed by a period that would start a list.
\*not italic\*
\# Not a heading
2026\. A line that starts with a year
\[not a link\](https://example.com)
\_\_init\_\_.pyCharacters you can escape
CommonMark allows a backslash before any ASCII punctuation character: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~. A backslash before anything else, such as a letter, is shown literally. These are the ones you will actually need:
| Character | Write | Escape it when |
|---|---|---|
| * asterisk | \* | Text would turn italic or bold, or a line starts a list |
| _ underscore | \_ | Underscores surround a word (_name_) |
| # hash | \# | A line starts with # and should not be a heading |
| - + list markers | \- \+ | A line starts with them followed by a space |
| . after a number | 1\. | A line starts with a number and period |
| [ ] brackets | \[ \] | Bracketed text is followed by (…) or matches a reference |
| < > angle brackets | \< or < | Text looks like an HTML tag |
| ` backtick | \` | A literal backtick appears in normal text |
| | pipe | \| | Inside a table cell |
| \ backslash | \\ | You want the backslash itself to show |
| ~ tilde | \~ | Paired tildes would strike text through |
Angle brackets: showing <> in Markdown
Markdown passes HTML through, so a < followed by letters looks like a tag. GitHub removes tags it does not recognize, which means List<String> can render as just "List". Escape the opening bracket, use the HTML entity <, or put the text in inline code.
List\<String\>
List<String>
`List<String>`
\<br> shows the tag instead of breaking the lineSquare brackets that are not links
Brackets only become a link when followed by a URL in parentheses or when the text matches a reference definition, so [draft] on its own usually displays fine. Escape them when parentheses follow, or at the start of a list item where "[ ]" would turn into a checkbox.
\[1\](see appendix) stays as text
- \[ \] literal brackets, not a task list checkboxBackticks inside code
Backslash escapes do not work inside code spans. The backslash is shown as-is. To show a backtick inside inline code, wrap the code in two backticks with spaces inside. To show a fenced block inside a code block, use a longer fence on the outside.
`` `backtick` ``
````markdown
```js
console.log("fenced");
```
````Pipes in tables
A pipe inside a table cell ends the cell, even inside inline code. Escape it with a backslash; GitHub Flavored Markdown removes the backslash in the output, including within code spans.
| Operator | Meaning |
|----------|---------|
| `a \| b` | Bitwise OR |
| \|\| | Logical OR |Where backslash escapes work
Escaping is part of core Markdown, so support is nearly universal. The exceptions are places that are not rendered as Markdown at all.
| Platform | Backslash escapes | Note |
|---|---|---|
| GitHub | Yes | Not applied in issue and pull request titles |
| GitLab | Yes | - |
| Obsidian | Yes | Also needed for # tags you do not want tagged |
| VS Code preview | Yes | - |
| Yes | - | |
| Discord | Yes | e.g. \*\*not bold\*\* |
Frequently Asked Questions
How do I escape an asterisk in Markdown?
Put a backslash before it: \*. For a whole word, escape both sides: \*important\* displays *important* with the asterisks visible.
How do I show angle brackets (<>) in Markdown?
Escape the opening bracket (\<tag>), use the HTML entities < and >, or wrap the text in backticks so it renders as code. Otherwise renderers like GitHub may treat it as an HTML tag and hide it.
How do I write a literal backslash?
Escape it with another backslash: \\ displays a single \. Inside inline code or a code block, a single backslash is shown as-is.
Why does my backslash show up inside code?
Backslash escapes do not work in code spans or code blocks. Everything inside is literal, including the backslash. Remove it; inside code you never need to escape Markdown characters.
Try it live
Paste this syntax into the free markdown to html converter and see the rendered output instantly. No signup, and everything runs in your browser.
Open Markdown to HTML Converter →