How do I show a literal asterisk in Markdown?
Escape it with a backslash (\*) or wrap the text in inline code (`*.md`). Inside code, every character is literal and no escaping is needed.
To display a Markdown special character literally, put a backslash directly before it: \*not italic\* renders the asterisks as plain text. Backslash escapes apply to ASCII punctuation only — and never inside code blocks, where every character is already literal.
*Not italic*
# Not a heading
Everything renders in your browser — nothing is uploaded. Need more room? Open the full editor or the Markdown viewer.
CommonMark lets you backslash-escape any ASCII punctuation character: \ ` * _ { } [ ] ( ) # + - . ! | < > and the rest. A backslash before anything else — a letter, a digit, a space — is just a literal backslash, so \n does not become a newline and \w stays exactly as typed. In practice only a handful of escapes matter day to day: asterisks and underscores that would start emphasis, a hash at the start of a line that would become a heading, square brackets that would open a link, and a number followed by a period at the start of a line — 1999\. prevents the year from kicking off an ordered list that renders as "1." Position matters for most of these: a hash in the middle of a sentence needs no escape at all, because it only means "heading" at the start of a line.
The escape you cannot avoid is the pipe in tables. Any literal | inside a cell splits that cell in two, so documenting a shell pipeline like grep foo | sort silently breaks the column layout. Write it as \| instead. GFM extends the escape into code spans within table cells — `a \| b` works there, even though backslashes are normally literal inside code — and the HTML entity | is the fallback for renderers that do not honor the backslash form.
Literal asterisks come up constantly in technical writing: glob patterns like *.md, wildcard arguments like *args, and bullet characters in quoted text all start emphasis spans that swallow the asterisk and italicize whatever follows until the parser finds a mate. Escaping fixes it (\*.md), but inline code is usually the better tool — `*.md` needs no escaping at all, signals "this is a literal token" to the reader, and protects every character inside, including underscores in names like _private or MAX_VALUE_ that would otherwise trigger emphasis at word boundaries.
Backticks have their own escape story. Outside code, \` produces a literal backtick like any other punctuation escape. But to show a backtick inside inline code, the backslash does nothing — use a longer delimiter instead: double backticks with a space, `` `code` ``, display the inner backticks literally. That points at the rule people break most: never escape inside code blocks or code spans. Within ``` fences and `spans`, backslashes are ordinary characters, so \* renders as a visible backslash followed by an asterisk. If your output shows stray backslashes, check whether the escaped text accidentally sits inside code formatting.
\*Not italic\*
\# Not a heading*Not italic*
# Not a heading
Escape special characters using backslash.
| Pattern | Meaning |
|---|---|
| a \| b | a or b || Pattern | Meaning |
|---|---|
| a | b | a or b |
A raw | inside a cell starts a new column — escape it with a backslash.
Delete the build artifacts: \*.log and \*.tmpDelete the build artifacts: *.log and *.tmp
Unescaped, the asterisks would open emphasis spans and vanish from the output.
1999\. What a year that was.1999. What a year that was.
A number-period at the start of a line begins an ordered list — escape the period to keep prose as prose.
A code block containing \*escaped\* asterisksCode blocks are already literal: *no escaping needed*Inside code spans and fenced blocks every character is literal — backslashes render as visible backslashes instead of escaping anything.
| matches a | b || matches a \| b |The unescaped pipe splits the cell into two columns. Backslash-escape literal pipes inside tables, or use the | entity.
\n to force a new lineEnd the line with two spaces or use <br>Backslash escapes only apply to punctuation. \n is not a newline in Markdown — it renders as a literal backslash and the letter n.
Full CommonMark escaping for all ASCII punctuation. In tables, \| works even inside code spans within cells — a GFM-specific extension of the rule.
Backslash escapes work for Discord's own markers: \*text\*, \_text\_, and \~\~text\~\~ all render the characters literally in messages.
No backslash escaping — the backslash itself shows up in the message. Wrap formatting characters in `inline code` to neutralize them instead.
Standard escapes work, and you can also escape wikilink brackets (\[\[not a link\]\]) to stop double brackets from creating internal links.
Escape it with a backslash (\*) or wrap the text in inline code (`*.md`). Inside code, every character is literal and no escaping is needed.
Any ASCII punctuation character, per CommonMark: \ ` * _ { } [ ] ( ) # + - . ! | < > and others. A backslash before a letter or digit is treated as a literal backslash.
Escape it as \|. In GFM this works even inside code spans within cells. If your renderer ignores the backslash, use the HTML entity | instead.
The escaped text is probably inside a code span or code block, where backslashes are literal — or the platform (like Slack) does not support backslash escaping at all.
No, never. Everything between backticks or inside a fenced block is already literal. Escaping there adds visible backslashes to your output.
Copy-paste bold examples with the rendered result beside each, why underscores fail mid-word, and a support table for GitHub, Discord, Slack and Obsidian.
Copy-paste table examples with rendered output, colon alignment for each column, escaping pipes inside cells, and workarounds for what tables cannot do.
Copy-paste code examples with rendered output: inline backticks, fenced blocks with syntax highlighting, and how to nest backticks inside a code block.
Complete Markdown syntax reference with interactive examples
Write Markdown with a formatting toolbar, local autosave, callouts, math, diagrams, file open, and live preview
Beautify Markdown drafts with table alignment, spacing cleanup, and list marker normalization