Guides
Markdown to plain text: the complete guide
Every Markdown element and what it should become in plain text — headings, links, code fences, tables, nested lists, and the cases where conversion should refuse to guess.
Converting Markdown to plain text means removing the syntax and keeping the content: hashes, asterisks, backticks, and bracket-paren link wrappers go, while the words, the link labels, the list order, and the code inside fences stay. The reliable way to do it is to parse the Markdown into a document structure and then render that structure as text — not to delete punctuation characters with find-and-replace, which damages code, identifiers, and URLs.
This guide is a reference for what should happen to every common element, including the ones where the honest answer is “leave it readable rather than guess”.
What “plain text” actually means
Plain text is a sequence of characters with no convention attached. Markdown is also plain text in the file-format sense, but it carries a convention: a renderer is expected to interpret **bold** as emphasis and # Heading as a heading.
That distinction matters because “remove Markdown” can mean two different things:
- Render it. Turn the Markdown into HTML or rich text so a destination application shows formatted output.
- Strip it. Remove the syntax and keep the characters, producing text that reads correctly with no formatting at all.
A good tool does both from the same parse. JustCleanText produces one plain-text string and one HTML fragment, so the two copy buttons are two views of one result rather than two different algorithms.
The element-by-element reference
The table below is the contract. Everything else in this guide explains the hard rows.
| Markdown | Plain text result | Notes |
|---|---|---|
# Heading |
Heading |
Level is lost in plain text; kept as h1–h6 in HTML |
**bold** |
bold |
Kept as strong in HTML |
*italic* |
italic |
Kept as em in HTML |
~~struck~~ |
struck |
Kept as del in HTML |
`code` |
code |
Kept as code in HTML |
| Fenced block | Content verbatim | Fence markers removed, body untouched |
[label](url) |
label |
URL becomes a real link in HTML |
 |
alt |
Image URL dropped |
> quote |
quote |
Kept as blockquote in HTML |
--- |
Removed | Becomes <hr> in HTML |
- item |
- item or • item |
Bullet style is a user choice |
1. item |
1. item |
Numbering preserved, including non-1 starts |
<https://x> |
https://x |
Autolink wrapper removed |
| a | b | |
Readable row text | Not converted to a real table |
[^1] |
Left as written | Footnotes are not interpreted |
\* |
* |
Backslash escapes are resolved |
The two rows that matter most in practice are the fenced block and the link. Get those wrong and you have corrupted the text rather than cleaned it.
Code fences: the part most tools break
Inside a fence, Markdown syntax has no meaning. This is a Python function:
def normalise(text, **kwargs):
return text.replace("**", "").strip()
A find-and-replace pass that removes ** turns **kwargs into kwargs and the string literal into something else entirely. A pass that removes # breaks colour codes and issue references. A pass that removes underscores breaks snake_case identifiers.
A parser-based converter does not have this problem, because it reads the fence as a single block and emits the body unchanged. That is why Preserve code blocks is on by default in JustCleanText, and why turning it off is a deliberate choice rather than an accident.
The same logic applies to inline code. `*.ts` should stay *.ts, not become .ts.
Links: keep the label, keep the URL where it can be used
[the brief](https://example.com/brief) contains two pieces of information: a label and a destination. Plain text can only carry one comfortably.
- Plain text: keep the label — “the brief”. The URL is dropped, because a bare URL glued to a sentence is usually worse than no URL.
- Rich text: keep the label and attach the URL as a real hyperlink, so the destination survives without cluttering the sentence.
- Reference-style links (
[label][ref]plus a[ref]: urldefinition) are left readable rather than resolved. Resolving them means moving URL definitions around, which changes the document’s shape. - Autolinks (
<https://example.com>) become the URL itself, which is correct: the label and the destination are the same string.
Images are the inverse case.  becomes the alt text, because the image cannot travel through a text channel. If the alt text is empty, the image disappears entirely — which is one reason good alt text matters even outside accessibility.
Lists, nesting, and the bullet question
Markdown bullets are -, *, or + at the start of a line. In plain text, there are three reasonable outcomes:
- Keep the hyphen.
- itemis valid Markdown and readable text. Good for technical documents, changelogs, and anything that might be pasted back into a Markdown editor. - Use a typographic bullet.
• itemreads as a list rather than as a hyphen, and it will not be re-interpreted as Markdown by Notion, Slack, or a Markdown editor. - Drop the marker.
itemon its own line. Rarely correct, because the list structure disappears.
This is genuinely a preference, which is why JustCleanText makes it a toggle rather than a default. The rule that must not be bent: only convert markers at the start of a line, never hyphens inside words, never date ranges, never code.
Nested lists are the honest casualty. Markdown expresses hierarchy with indentation, and plain text can too, but only if the indentation is preserved. A converter that flattens nested items into one level keeps every word and loses the structure. That is an acceptable trade for a paste into a text field and a bad one for a document outline, where you should keep the rich-text route instead.
Ordered lists are simpler. The numbers carry order, so they are kept. A list that starts at 4. should still start at 4 — a detail that a naive “renumber from 1” pass gets wrong.
Tables: readable, not converted
A Markdown table is pipes and dashes:
| Plan | Price | Seats |
| --- | --- | --- |
| Team | £20 | 10 |
In plain text, this is already readable. What it is not is a table. Converting it to aligned columns requires measuring the longest cell in each column and padding every row, which is a layout decision, and it breaks the moment the text is pasted into a proportional font.
Most converters therefore leave the row text intact and let the destination decide. If you need a real table, use the rich-text copy and paste into a destination that supports tables — Docs and Word both convert HTML tables correctly. If you need aligned plain text, align it in a monospace context, not in prose.
HTML inside Markdown
Markdown allows raw HTML, and AI output sometimes contains it: <br>, <sup>, <kbd>, or a stray <div>. There are two defensible behaviours:
- Pass it through in rich-text output, so
<kbd>Ctrl</kbd>renders as a key cap. - Strip the tags in plain-text output, so the word remains and the markup does not.
What must never happen is escaping HTML in rich-text output, which shows <kbd> to the reader as literal text. A converter that builds HTML should escape text nodes and emit recognised tags as tags — not escape everything and hope.
A worked example
Markdown
# Release notes
**Version 2.4** ships three changes:
1. Faster *cold start*
2. New `--dry-run` flag
3. Fix for [issue #412](https://example.com/issues/412)
> Upgrade before Friday.
```bash
npm i JustCleanText@2.4
```
Plain text
Release notes
Version 2.4 ships three changes:
1. Faster cold start
2. New --dry-run flag
3. Fix for issue #412
Upgrade before Friday.
npm i JustCleanText@2.4
Every word survived. The heading marker, emphasis markers, backticks, link wrapper, quote marker, and fence markers are gone. The code block is intact.
How to verify a conversion
Three checks catch almost every failure:
- Count the words. A converter should not change the word count outside fenced code. A drop of more than a few words means content was eaten.
- Search for syntax. Look for
**,##, and a backtick. If any remain outside a code block, the parse missed something. - Read the code. If the document had a fenced block, confirm the body is byte-identical. This is the check that find-and-replace always fails.
JustCleanText’s cleaning report is a fourth check: it counts the Markdown symbols removed, so a non-zero count is confirmation that the parser actually ran.
Related reading
- How to remove Markdown from ChatGPT text
- How to clean AI text for Microsoft Word
- The Markdown remover
Open the cleaner and convert a document you already have.
Put this into practice
Clean the text before you paste it
Paste the text into JustCleanText, keep the toggles that match your problem, and copy either rich text or plain text. Everything runs in this browser tab.
Open the cleaner