Skip to main content

Guides

How to remove Markdown formatting from text

· 5 min read

To remove Markdown formatting, strip the syntax characters, asterisks, underscores, hashes, backticks, brackets and pipes, while keeping the words they wrap. That works cleanly for emphasis and headings, because the plain words are still there once the marks come off. It is not fully reversible for anything where the syntax itself carried information: a link's destination, a table's grid, or a code block's exact spacing.

TL;DR: stripping Markdown is safe for bold, italics, headings and blockquotes, since only the marker disappears and the words stay. It is a real decision for links (keep the text or the destination, not both), tables (the grid does not survive as plain text), and code blocks (touch the fences, never what is inside them).

What comes off cleanly

What is a real decision

A Markdown link has two parts, the visible text and the destination, and plain text can hold only one of them. Keeping the text reads naturally and drops where it pointed. Keeping both looks like an inline citation and is uglier but nothing is lost. Neither choice is wrong, but making it without noticing is how a document arrives at its reader with every reference silently removed.

Tables do not survive stripping in any form that still looks like a table, because a Markdown table is a grid drawn with pipe characters and plain text has no grid. What comes out is either the pipes left in place, which reads as noise, or the cells run together, which loses the column alignment that made it a table in the first place. Convert or rebuild a table on purpose rather than discovering the result afterwards.

Code blocks are the case to be careful with, because the fences are syntax and the content between them is not. Stripping the triple backticks is correct. Touching what is inside them is not, since indentation, punctuation and exact spacing inside code are load-bearing. If the goal is the code rather than the surrounding prose, a dedicated code-block extractor keeps the blocks and drops the prose instead of the reverse.

What survives, at a glance

Markdown elementAfter strippingWhat you might lose
Bold / italics (**, *)Plain words, no formattingEmphasis only, still readable
Headings (#, ##)A plain line of textThe document's structure and hierarchy
Links ([text](url))Text only, by defaultThe destination, unless kept as a citation
Blockquotes (>)An ordinary paragraphWhich lines were a quotation
Tables (| a | b |)Pipes left in, or cells run togetherColumn alignment; rebuild by hand
Code blocks (```)Fences removed, content untouchedNothing, if the tool leaves the content alone

Why this matters for AI output specifically

Chat interfaces render Markdown, so a model writes it by default: headings for structure, bold for emphasis, bullet lists, sometimes a table. Paste that response into a plain-text email, a CMS field that does not render Markdown, or an SMS, and the asterisks and hashes show up literally instead of disappearing. Stripping the syntax before it leaves the chat window fixes it, and it is the same operation whether the source is a person's Markdown file or a model's reply.

Doing it without uploading a draft

A response you are about to paste somewhere is usually not published yet, so it is worth using a tool that runs in the browser tab rather than one that sends the text to a server first. Load the page, disconnect from the internet, and the stripping still works if it is genuinely running client-side.

Try it: strip Markdown formatting from text

Related: How to clean AI-generated text before you publish it

Related: How to remove citations like [1] from copied text

Related: How to remove HTML tags from text without mangling it

Frequently asked questions

Does stripping Markdown change the words?

No, for bold, italics, headings and blockquotes: only the marker is removed, the words stay exactly as written. Links and tables are the exceptions, where the syntax itself carried information plain text cannot hold.

What happens to Markdown links when I strip formatting?

By default only the visible text remains and the destination is dropped. Keeping the URL as well, in parentheses after the text, preserves the reference at the cost of a less natural sentence.

Can I recover a Markdown table after stripping it?

Not from the stripped text. A Markdown table is a grid made of pipe characters, and once the pipes are gone or run together, only the original Markdown or a fresh conversion recovers the columns.

Is it safe to strip Markdown from a code block?

The fences are safe to remove. The content inside is not: indentation and exact spacing inside code are meaningful, so a general Markdown stripper should leave it untouched, or you should extract code separately first.