Skip to content
Back to blog
Thursday, November 26, 2026

Markdown Escape Characters: Asterisks, Backticks and Table Pipes

Show Markdown symbols literally without breaking real formatting. Copy tested examples for asterisks, code spans, line starts and table pipes.

Markdown Escape Characters: Asterisks, Backticks and Table Pipes

To display a Markdown formatting character as ordinary text, put a backslash before it where it would otherwise act as syntax. For example, \*draft\* displays the surrounding asterisks instead of italicizing the word. When the whole fragment is code, an inline code span is often easier to read and maintain.

The right choice depends on where the text sits. Prose, code spans and table cells are different contexts. Adding more backslashes everywhere can leave unwanted characters in a command or fail to fix a table. Start with the intended output, identify the context, then change the smallest fragment that is wrong.

Copy a working example of literal symbols

The following document deliberately mixes literal punctuation with real formatting. Only “Approved” should be bold. The escaped hash and dash should remain text, the path should keep its backslashes, and the table should have two columns.

## Literal symbols

\# Not a heading

\*draft\* and **Approved**

\- Not a list item

Path: `C:\notes\release.md`

Code label: `` `status` ``

| Token | Meaning |
| --- | --- |
| a\|b | Literal pipe |

After pasting, compare the source with the preview. You should see the asterisks around “draft”, a hash at the beginning of an ordinary paragraph. The dash must not create a list. The last row should contain a|b in one cell and “Literal pipe” in the other.

This is a useful review fixture because it contains both formatting you want to keep and syntax you want to suppress. If you escape the real bold markers too, the example has lost its intended contrast. Fix individual characters rather than treating the entire document as plain text. CommonMark backslash escape rules

Keep a copy of the source before making a broad replacement. Search-and-replace operations can affect headings, links and valid emphasis elsewhere in a longer document. A small test excerpt lets you see whether the change solved the specific problem before you apply it to the full draft.

Choose between prose escapes, code spans and table escapes

Use a prose escape when punctuation belongs in a sentence and you want it to keep the paragraph's normal styling. Use inline code for a filename, command fragment or syntax label. In an ordinary code span, backslash escapes are not processed as they are in prose. That is why the path in the main example keeps its backslashes without doubling them.

To include a single backtick inside inline code, the example uses a pair of backticks at each end. The spaces just inside those delimiters are padding in this example, and the displayed content is the single-backtick-wrapped word. Do not assume adding a backslash inside code will close or protect the delimiter. CommonMark code span rules

A table introduces a separate boundary: pipes divide cells. The example escapes the pipe in the data so it stays inside one cell. This is GitHub Flavored Markdown table behavior, not a claim that every Markdown processor supports tables. GFM also requires care with pipes inside code spans in table cells; backticks alone do not hide the pipe from the table structure. GFM table specification

For punctuation at the beginning of a line, copy this smaller example. It prevents an ordered list, a quote and a heading respectively.

1\. This is text, not an ordered list.

\> This is text, not a blockquote.

\# This is text, not a heading.

Notice that the period after the number is escaped, rather than the digit. The paragraph should read as text beginning with 1.. Likewise, the other two paragraphs should retain their initial symbols without gaining quote or heading styling. Verify those boundaries before adjusting fonts or margins.

Diagnose the visible symptom

What you seeWhat to check
A word becomes italic unexpectedlyEscape the paired emphasis markers you intend to show.
A line turns into a heading or listInspect punctuation at the start of the line and escape the relevant marker.
An extra backslash appears inside codeCheck whether you copied prose escaping into a code span that preserves it.
An inline code fragment ends too soonUse matching backtick delimiters with a different run length from the content.
A table row splits into extra cellsEscape the data pipe and check the target renderer's table support.
The whole sample appears unformattedCopy the contents of the outer Markdown fence, rather than its surrounding fence lines.

When moving text between a chat answer, a Markdown file and another application, inspect the actual characters in the final source. One layer may already have consumed an escape or displayed it literally. Compare one failing line with the working fixture before introducing a second layer of escaping.

For a whole program or multiple lines of syntax, use a fenced code block instead of escaping every punctuation mark. The Markdown code block guide covers that workflow. Keep prose readable and reserve code styling for content readers should recognize as source.

Export a checked syntax card

We entered the full fixture in the live Markdown2Image editor. Checks confirmed one bold label, literal punctuation, the preserved path, an inline backtick label and a two-cell data row with the pipe intact. The PNG below was downloaded using the editor's normal image download control.

Literal Markdown symbols beside intentional bold text, inline code and a two-column table

Open the original PNG

Use the image in a tutorial slide or documentation review to compare source and output. Check that small backslashes and backticks remain readable at the final display size. Keep the copyable Markdown beside the image so readers can reuse the exact source; a PNG does not provide editable or selectable code. Try the escape examples in Markdown2Image