Markdown Syntax · Escaping

How to Escape Characters in Markdown
Show a literal *, #, or _

You typed a * or a # and Markdown turned it into italics or a heading, when you just wanted the symbol itself. The fix is one character: a backslash in front of it. \* shows a literal asterisk.

Here is which characters do this, how to escape them, and the one place where you should not bother.

Escape with a backslash

Put a \ right before the character you want to keep literal. Markdown sees the backslash, drops it, and prints the next character as-is instead of treating it as formatting.

You type You get Why
\*text\* *text* Otherwise *text* becomes italic (two of them make bold)
\# heading # heading Otherwise a # at the line start becomes a heading
file\_name file_name Otherwise a pair of underscores turns into italic
1\. item 1. item Otherwise a number and dot at the line start begins a list
\[text\] [text] Otherwise the brackets may be read as part of a link

Which characters need escaping

Only Markdown’s punctuation characters do anything when escaped: the backslash, backtick, *, _, , [ ], ( ), #, +, -, ., !, and |. Put a backslash before a normal letter or number and nothing happens, the backslash just prints. So you only need to escape when a character would otherwise be read as formatting.

The one place you should not escape: inside code

Inside inline code or a fenced code block, every character is already literal. An * stays an *, a # stays a #, no backslash needed. In fact a backslash there will show up as a real backslash. So if you are showing a snippet, put it in code and skip the escaping entirely. See how to write code blocks for that.

The classic case: underscores in names

The one that catches everyone is snake_case file and variable names. A pair of underscores is italic in Markdown, so my_long_name can render with the middle italicized. Two fixes: escape each underscore (my\_long\_name), or wrap the name in inline code, which is usually cleaner for a filename or a variable anyway.

New to what these symbols do in the first place? See why AI uses Markdown and how to write Markdown.

Checking your escapes with NoteLoom

Escaping is one of those things you want to see rendered, because a missed backslash is invisible in raw text. NoteLoom is an editor that reads and writes local .md files in the browser: its live and reading views render your Markdown as you write, so you can see immediately whether a * came out as a literal star or turned into italics, and fix it in the source view.

To be clear about the boundaries: NoteLoom has no AI. It will not rewrite or fix your Markdown for you. It renders and saves your local file, and the editing stays with you.

How you use it: open app.noteloom.cc in Chrome / Edge / Arc, mount a local folder, and write in the source view while the live view shows the result. Saved straight to your disk, no cloud, no account.

FAQ

Why is my Markdown showing the * or # as formatting?
Because those are Markdown’s formatting characters. A single * makes italic, ** makes bold, a # at the start of a line makes a heading, and _ makes italic. To show the literal character instead, put a backslash before it: \* gives a literal asterisk.
How do I escape a character in Markdown?
Put a backslash (\) right before the character. \* , \# , \_ , and \[ all show the literal symbol instead of triggering formatting. It works for Markdown’s punctuation characters.
Which characters can I escape?
The Markdown punctuation set: backslash, backtick, asterisk, underscore, curly braces, square brackets, parentheses, hash, plus, minus, dot, exclamation mark, and pipe. Putting a backslash before a normal letter or number does nothing, the backslash just shows up.
When do I NOT need to escape?
Inside inline code or a code block. There, every character is already literal, so you would not escape, a backslash there would show up as a real backslash. Only escape in normal text.
Why do my file_names show up in italics?
A pair of underscores around text is Markdown italic, so file_name_here can render italicized. Escape the underscores (file\_name\_here), or wrap the whole thing in inline code so the underscores are left alone.
Can NoteLoom show me whether my escape worked?
Yes. NoteLoom renders your Markdown as you write, so the live and reading views show whether a character came out as a literal symbol or as formatting. It has no AI: it just renders and saves your local .md file.
Can I do this with NoteLoom on my phone or in Safari?
Not for now. NoteLoom relies on the browser’s File System Access API, which currently works in Chromium-based desktop browsers like Chrome, Edge, and Arc. Firefox, Safari, and mobile are not supported yet.

See your escapes render as you type

Open NoteLoom in Chrome / Edge / Arc, mount a local folder, and write in the source view while the live view shows whether your \* came out literal. Saved straight back to your disk, no software to install and no account to sign up for.

Open NoteLoom and try it