\*Not italic\*
\[Not a link\]
\# Not a headingMarkdown uses standard ASCII punctuation characters—such as asterisks (*), hash marks (#), brackets ([), and hyphens (-)—to define formatting rules.
However, in technical writing, mathematical descriptions, financial logs, and everyday prose, you often need to type these characters as literal text without triggering unintended formatting.
CommonMark provides backslash escaping to tell the parser: “Render this symbol literally; do not interpret it as Markdown syntax.”
The backslash escape character (\)
To prevent a character from being interpreted as Markdown syntax, precede it with a backslash (\):
\*This text will not be italicized; it displays with literal asterisks.\*
\# This is not a heading; it displays with a literal hash mark.
\[This is not a hyperlink\](https://example.com)
In the rendered output, the backslash is removed, and the literal punctuation character is displayed cleanly.
Complete list of escapable characters in CommonMark
CommonMark strictly defines that any ASCII punctuation character can be escaped by preceding it with \:
| Character | Escaped Syntax | Use Case / Common Collision |
|---|---|---|
\ | \\ | File paths (e.g., C:\\Users\\Note.md) |
* | \* | Multiplication symbols or literal asterisks |
_ | \_ | Underscores in variable names (snake\_case) |
# | \# | Social media hashtags or issue trackers (\#142) |
[ ] | \[ \] | Literal bracketed annotations or citations |
( ) | \( \) | Mathematical coordinates or parenthetical lists |
{ } | \{ \} | Programming object literals or template tags |
+ | \+ | Mathematical addition signs at line beginnings |
- | \- | Negative numbers or bullets at line beginnings |
. | \. | Numbers at line beginnings (1984\. A great novel) |
! | \! | Exclamation marks before brackets (\![]) |
| ` | ` | | |
< > | \< \> | Angle brackets and comparison operators |
~ | \~ | Tildes for approximations (\~20 minutes) |
$ | \$ | Currency prices (\$500) without triggering KaTeX math |
Common escaping scenarios in practice
1. Escaping dates and numbers at line beginnings
If a paragraph begins with a number followed by a period, Markdown automatically treats it as an ordered list item:
<!-- INCORRECT: Automatically renumbered to 1. -->
1984. A famous dystopian novel by George Orwell.
<!-- CORRECT: Escaped period preserves original year -->
1984\. A famous dystopian novel by George Orwell.
2. Escaping dollar signs to prevent math parsing
In Oyma and Obsidian, dollar signs trigger KaTeX math mode. To display currency values, always escape the dollar sign:
The enterprise license costs \$20 per seat per month.
3. Escaping pipes inside table cells
Pipes inside table cells normally split columns. Escape them to preserve code expressions:
| Operator | Function |
| :--- | :--- |
| `\|\|` | Logical OR in JavaScript |
| `grep \| wc` | Unix pipeline command |
4. Escaping hashtags
Prevent text from converting to H1 headings:
\#Productivity is a popular topic in personal knowledge management.
When not to escape: Code blocks
Inside inline code (`code`) or fenced code blocks (```), Markdown parsing is already disabled. You do not need to escape characters inside code:
`*ptr = &value;` <!-- Correct: no escaping needed inside backticks -->
`\*ptr = &value;` <!-- Incorrect: renders literal backslash in code -->
Escaping in Oyma on macOS
In Oyma:
- Backslash-escaped characters render as clean literal text in live-preview mode.
- When your cursor enters the escaped symbol, the backslash reveals itself for instant editing.
- Raw files on disk remain 100% compliant with standard CommonMark specifications.
Frequently asked questions
- What character is used to escape formatting in Markdown?
- The backslash character (`\`) is used to escape Markdown formatting. Placing a backslash immediately before any reserved punctuation character instructs the Markdown parser to treat it as literal plain text rather than markup.
- Which characters can be escaped with a backslash in CommonMark?
- CommonMark permits backslash escaping for all ASCII punctuation characters: `\`, `` ` ``, `*`, `_`, `{`, `}`, `[`, `]`, `(`, `)`, `#`, `+`, `-`, `.`, `!`, `|`, `<`, `>`, and `~`.
- How do I type a literal backslash in a Markdown document?
- To output a literal backslash character, type two consecutive backslashes: `\\`. The first backslash escapes the second, rendering a single `\` in the final document.
- Does backslash escaping work inside inline code or code blocks?
- No. Content inside backticks (`` `code` ``) or fenced code blocks is already preserved verbatim. Placing a backslash inside a code block will render the literal backslash as part of the code.
Experience Escaping Characters with zero lock-in.
Write CommonMark notes directly on your Mac with native live preview and sovereign local storage.