Skip to content
FeaturesPricingBlogDownload
Home / Markdown syntax / Markdown escape characters

Markdown escape characters

To show a Markdown symbol as plain text, put a backslash \ in front of it: \* shows an asterisk instead of starting italics. In CommonMark, any ASCII punctuation character can be escaped this way. A backslash before a letter, digit or space is just a backslash.

\*Not italic\* and 2 \* 3 = 6

That renders as *Not italic* and 2 * 3 = 6.

Which characters can be escaped in Markdown?

All 32 ASCII punctuation characters (CommonMark spec 0.31.2, section 2.4, checked November 2026):

\ ` * _ { } [ ] ( ) < > # + - . ! | " $ % & ' , / : ; = ? @ ^ ~

The ones you will actually need, and what they would do unescaped:

  • \* and \_: emphasis, as in *italic* and __bold__
  • \`: inline code
  • \#: a heading at the start of a line
  • \-, \+: a bullet list item at the start of a line
  • \. after a number: a numbered list, as in 1986\. A great year
  • \>: a blockquote at the start of a line
  • \[ and \]: links and images
  • \!: an image when followed by [
  • \<: raw HTML or an autolink
  • \|: a column separator inside a table
  • \~: strikethrough in GitHub Flavored Markdown (GFM)
  • \\: a literal backslash

GitHub Flavored Markdown uses the same rule, since GFM is built on CommonMark.

When do you not need to escape?

Most characters only have meaning in a certain position, so escaping them elsewhere is harmless but unnecessary.

  • # only starts a heading at the beginning of a line and when followed by a space. #tag and C# are already plain text.
  • - and + only start a list at the beginning of a line and when followed by a space.
  • _ inside a word, as in snake_case_name, is not emphasis in CommonMark.
  • * surrounded by spaces, as in 2 * 3, is not emphasis.

Where do backslash escapes not work?

The spec lists a few places where a backslash is just a backslash:

  • Inside inline code and code blocks. Everything there is literal, which is often the easier way to show symbols: `*args` needs no escaping.
  • Inside autolinks such as <https://example.com/a\b>.
  • Inside raw HTML.

Escapes do work inside link text, link URLs, link titles and the language name after a code fence.

In a GFM table, \| keeps a pipe from splitting the cell, even inside inline code in that cell. The tables page has an example.

What about HTML entities?

CommonMark also accepts HTML entity references, which is useful for characters that a backslash cannot handle:

Entity Shows
&amp; &
&lt; <
&gt; >
&nbsp; a non-breaking space
&copy; ©

Writing &lt;div&gt; shows the text <div> instead of an HTML tag. To show an entity's code literally, escape the ampersand: \&copy;.

What does a backslash at the end of a line do?

It creates a hard line break, not a literal backslash. To end a line with a visible backslash, use \\. The line breaks page covers this in detail.

Escape characters in Noteline

Noteline saves your text exactly as typed, backslashes included, so escapes behave in other Markdown apps the way the spec describes. Source mode, Cmd+Shift+M on a Mac or Ctrl+Shift+M on Windows and Linux, shows every backslash in the raw Markdown, which helps when text copied from elsewhere renders differently than expected.

Common questions

Why does my backslash not show up?

A backslash before a punctuation mark is consumed as an escape. Type \\ to show one backslash.

How do I show an asterisk at the start of a line?

Write \*. An asterisk followed by a space at the start of a line would otherwise start a bullet list.

Do I need to escape underscores in file names?

Usually not. CommonMark ignores underscores inside words, so my_file_name.md stays plain text. Wrapping file names in inline code is clearer anyway.

Noteline

Download Noteline↓See pricing→

Related

  • Markdown code blocks
  • Bold, italic and strikethrough
  • Markdown tables
  • Markdown headings
  • How to clean up AI Markdown from ChatGPT and Claude
  • Markdown syntax

A Markdown note editor with everything you need

We’re listening

Tell us what you need or what gets in your way. If something isn’t working, write to us any time.

contact@noteline.io→

Product

  • Download
  • Pricing
  • Features
  • Changelog

Learn

  • Markdown syntax
  • Use cases
  • Blog

Compare

  • vs Obsidian
  • vs Notion

Support

  • Help
  • Support
  • Privacy
  • Terms

© 2026 Notelinecontact@noteline.io