Markdown Escape
Escape Markdown special characters so text shows literally instead of turning into headings, lists, links or emphasis. Paste your text, press Escape, and the server adds a backslash before 16 characters such as asterisks, underscores, brackets and hashes. Copy the result or download it as escaped-markdown.txt.
Use Markdown Escape
Read Content
Make Markdown symbols show up as plain text
Markdown turns ordinary keyboard characters into formatting. An asterisk starts italics, a hash at the start of a line makes a heading, square brackets followed by parentheses become a link, and a number followed by a period starts a numbered list. That is great when you want formatting and annoying when you do not. A product name like *NIX, a file called my_file_name.txt, or a line that begins #1 priority can render in ways nobody intended.
The Markdown Escape tool fixes this by putting a backslash in front of each special character. In Markdown, a backslash tells the renderer "show the next character as it is", so the escaped text displays literally wherever it is pasted.
Exactly which characters are escaped
The tool escapes this set of 16 characters, every time they appear:
| Character | Why it matters in Markdown | Escaped form |
|---|---|---|
\ | The escape character itself | \\ |
` | Inline code | \` |
* and _ | Emphasis and bold | \* and \_ |
{ } | Attribute syntax in some Markdown flavours | \{ \} |
[ ] ( ) | Links and images | \[ \] \( \) |
# | Headings | \# |
+ and - | Bullet lists and horizontal rules | \+ and \- |
. | Numbered lists such as "1." | \. |
! | Image syntax | \! |
| | Table cells | \| |
Everything else passes through unchanged. In particular, the greater-than sign > used for blockquotes, the less-than sign <, the tilde ~ used for strikethrough in GitHub Flavored Markdown, and the equals sign are not escaped. If your text starts a line with > or contains ~~, add a backslash to those by hand.
The live counter under the input, "possible special chars", includes > in its count, so it can be slightly higher than the number of backslashes the tool actually adds. The output footer shows the true figure as "chars added".
A quick before and after
Input:
1. Use *nix_tools* [beta] - see #42!
Output:
1\. Use \*nix\_tools\* \[beta\] \- see \#42\!
Pasted into any Markdown editor, the output shows the original sentence character for character, with no list, no italics and no link.
How to use it
- Paste your text into Input Text, or press Paste to read it from the clipboard.
- Press Escape. The button shows "Working" while the request runs.
- The result appears in Escaped Output, labelled "Markdown-safe literal text".
- Use the copy icon on the output card to copy it, or the download icon to save it as
escaped-markdown.txt. - The trash icon on the input card clears both editors.
Character counts under each editor show the input length, output length and how many characters were added.
Where your text goes
Unlike most Markdown utilities on this site, the escaping is done on the server. When you press Escape, your text is sent to this site's server, a single regular-expression replacement adds the backslashes, and the escaped text is returned to your browser. The server accepts up to 200,000 characters per request; longer input is rejected with an error message, so split very large files into parts. Avoid pasting passwords, keys or private data you would not want to send over the internet.
When escaping is the right move
- Writing about Markdown itself. Tutorials and cheat sheets need to show syntax like
**bold**without it turning bold. - User-generated text in Markdown fields. Names, product titles and comments copied into a README, a GitHub issue, or a CMS field that renders Markdown.
- Chat and support replies. Platforms that render Markdown can mangle file paths, wildcard patterns and math such as
a*b*c. - Generated content. Scripts that insert arbitrary strings into Markdown templates can escape those strings first so they never break the layout.
- Tables. A pipe character inside a cell splits the cell in two; escaping it keeps the table intact.
When not to escape
- Do not escape a whole document that is supposed to stay formatted. Every heading, list and link will turn into literal symbols. Escape only the fragment that should be literal.
- Do not escape text that goes inside a code block or inline code. Backslashes are shown literally inside code, so the reader would see them. Wrapping text in backticks is often a simpler alternative to escaping.
- Do not escape URLs you want to stay clickable. Periods, hyphens and parentheses in the address get backslashes, which breaks the link if you later use it as a link target.
- Do not run the tool twice on the same text. The backslash is itself escaped, so a second pass doubles the backslashes and they become visible.
- Do not expect HTML safety. Escaping Markdown does not neutralise HTML tags; angle brackets are left alone.
Escaping versus code formatting
There are two common ways to stop Markdown from formatting a piece of text, and they suit different situations. Escaping keeps the text in the normal font and flow of the paragraph, so it reads like ordinary prose. That is the better choice for names, titles, prices, ratings like 5* and sentences that happen to contain symbols. Wrapping text in backticks shows it in a monospace code style, which is the better choice for commands, file paths, variable names and snippets of syntax that readers might copy.
A good rule of thumb: if a reader would type it into a terminal or editor, use code formatting. If a reader would simply read it, escape it. Mixing both in the same fragment is unnecessary, because backslashes inside code spans are displayed as literal backslashes.
Tips
- Escape short fragments, then place them into your document, rather than escaping the full file.
- After pasting the output, preview it once. Different Markdown renderers treat some escapes slightly differently, and a quick look confirms the result.
- If you only need to stop one list or heading from forming, a single manual backslash may be quicker. The tool shines when the text is long or full of symbols.
- Keep the original text. Escaping cannot be undone automatically by this tool.
Limitations
- A fixed set of 16 characters is escaped;
>,<,~and=are not. - Escaping is applied everywhere, including inside existing code spans, URLs and words, because the tool does not parse the Markdown structure.
- There are no options to choose which characters to escape or to reverse the process.
- Input is limited to 200,000 characters per request and requires an internet connection, since it is processed on the server.
Related tools
To check how the escaped text renders before you publish it, paste it into the Markdown Previewer. If you want to drop formatting entirely instead of displaying the symbols, Markdown to Text converts Markdown to plain text.
Frequently Asked Questions
FAQ
Comments (0)
Describe the issue you encountered so we can investigate and improve the tool.