Turn Markdown into HTML you can paste on the web, and see what will break before you paste it
A Markdown to HTML converter turns text written with symbols such as #, ** and - into the HTML tags a web page reads. The conversion follows the GitHub Flavored Markdown (GFM) specification, and the engine is marked 18, a widely used open-source library that is bundled inside this page. While you type, the web preview and the HTML code update on the right. You can copy or save the result as body HTML, HTML with inline styles, or a full .html document, whichever fits the place you are pasting into.
The tool does not stop at converting. It also gathers a checklist of things that could go wrong after you paste: emphasis marks that stay behind as plain symbols, lines that were joined because there was no blank line, relative addresses that will not open on another site, and code blocks that were never closed. Click a check card and the editor jumps to that line; the outline strip in the middle shows which blocks the document is made of and where the checks are. Your text is converted inside the browser and is never sent to a server.
When you need to convert Markdown to HTML
- Publishing to a blog or website HTML field: if you paste Markdown symbols straight into a field that takes HTML, such as the WordPress Custom HTML block,
##and**show up as literal characters. Convert to HTML first and headings, lists and tables arrive in the right shape. - Moving an AI chat answer or a note to the web: answers from AI chat tools and notes from developer note apps are often written in Markdown symbols. Pasting them as they are leaves the symbols behind, so copying HTML or copying with formatting is cleaner.
- Building an email newsletter: some email services restrict
<style>. According to caniemail.com, Gmail on the web does not support<style>inside the body and limits its size to 16 KB. In that case the inline-styles form, which puts the styling on every tag, is the safe choice. - Handing out a README or a manual as one web page: Save as .html produces one document with fonts, tables, code styling and dark-mode colors. The recipient can open it in a browser without any other program.
- Pasting into an editor with no HTML field: Copy with formatting puts both HTML and plain text on the clipboard. Where the target accepts formatted paste, such as an email composer or a document editor, headings, lists and tables come through as they are.
How to use it
- Add your Markdown: write or paste into the editor on the left. Choose an .md, .markdown or .txt file with Open file, or drop it onto the editor. An old file that is not UTF-8 is read again as EUC-KR.
- Use the syntax buttons: the buttons above the editor wrap the selected text in bold, italic or a link, or put heading, list and quote marks in front of the selected lines. Ctrl+B, Ctrl+I and Ctrl+K (⌘ on a Mac) do the same. The symbols are colored, so it is easy to see what is a heading and what is emphasis.
- Check the web preview: the Web preview on the right shows the result like a real web page. It follows the editor as you scroll, and when the cursor is in the editor, that block is marked with a bar on the left. Switch to HTML code to see the tags in color.
- Choose the conversion rules: pick how to handle line breaks, HTML mixed into the Markdown, the HTML form, Fix emphasis and Heading IDs. The result is rebuilt the moment you change one.
- Check, then copy: look over the check cards below, then press Copy HTML, Copy with formatting or Save as .html file. If you turn on Save in this browser, your text and rules stay only in this browser, so you can pick up where you left off next time.
Which HTML tag each Markdown symbol becomes
The HTML column in the table is what this tool actually outputs. Tables, task lists, strikethrough and autolinks are extensions that GFM adds on top of CommonMark.
| Markdown | HTML | Good to know |
|---|---|---|
## Subheading | <h2>Subheading</h2> | The number of # signs (1 to 6) is the heading level. A space must follow the #. |
**bold** *italic* | <strong>bold</strong> <em>italic</em> | Underscores (__, _) work the same way, but they do not make emphasis inside a word. |
~~struck~~ | <del>struck</del> | A GFM extension. Wrapping the text in a single tilde also gives strikethrough. |
`npm install` | <code>npm install</code> | Inside code, < and & are converted automatically so they appear as typed. |
[Guide](https://example.com) | <a href="https://example.com">Guide</a> | An address containing a space does not become a link. Wrapping the address in < and > turns the space into %20. |
 | <img src="…/map.png" alt="Map"> | The text inside the brackets becomes the image description (alt). |
- apple- pear | <ul><li>apple</li>…</ul> | * and + can also be used as bullet marks. |
3. Third4. Fourth | <ol start="3"> | Only the first number counts; the rest are numbered in order. Writing 1. 1. 1. still gives 1, 2, 3. |
- [x] Book tickets | <input checked="" disabled="" type="checkbox"> Book tickets | A GFM task list. The checkbox in the result is a display only and cannot be clicked. |
> A quote | <blockquote><p>A quote</p></blockquote> | Stacking >> makes a quote inside a quote. |
| Name | Qty || --- | ---: | | <table> … <td align="right">3</td> | The position of the : in the second row sets the alignment (:--- left, :---: center, ---: right). |
www.example.com | <a href="http://www.example.com"> | A GFM autolink. Text starting with www gets http:// added, so for an https site it is better to write the full address. |
```js … ``` | <pre><code class="language-js"> | The language name after the fence becomes a language- class. The code highlighter of the site you paste into reads this name to add color. |
--- | <hr> | Written on the line right under a piece of text, it does not make a rule; it turns that text into a level 2 heading. |
Why emphasis stays as symbols next to quotes and brackets, and what Fix emphasis does
The Markdown specification decides whether an asterisk can open or close emphasis by looking at the characters on either side of it. According to the CommonMark 0.31.2 definition, an opening mark (a left-flanking run) that is followed by punctuation must be preceded by whitespace or punctuation, and a closing mark (a right-flanking run) that is preceded by punctuation must be followed by whitespace or punctuation. So if you put the emphasis inside quotation marks, brackets or Japanese corner brackets and attach a letter right after it, as in **"foo"**s, the closing ** cannot close the emphasis and the asterisks stay as text. Example 380 of the specification (a**"foo"**) fails on the opening side instead: the first ** comes right after a letter and before a quotation mark, so it cannot open emphasis. It comes up most often in Korean and Japanese, where particles attach directly to the word before them.
With Fix emphasis on (the starting state), the tool reads only these cases as emphasis. It changes a spot only when the inner edge is punctuation and the outer side is a Japanese, Korean or Chinese character (kana, Hangul or kanji), which is where particles attach. When the outer side is a Latin letter or a digit, the standard rule is kept, so text such as a**"foo"** or 2*(3+4)*5 does not change; emphasis that contains code, a link or an HTML tag is not changed either. Sentences that already work under the standard rule are left alone. Each fixed spot is reported in the Emphasis fixed check card.
| Markdown | Standard rules (GitHub, marked) | Result with fixing on |
|---|---|---|
**「重要」**は (Japanese) | **「重要」**は (symbols show) | 「重要」は |
**(注)**を (Japanese) | **(注)**を (symbols show) | (注)を |
a**"foo"** | a**"foo"** (symbols show) | a**"foo"** (Latin letter outside: standard rule kept) |
**(optional)**fields | **(optional)**fields (symbols show) | **(optional)**fields (Latin letter outside: standard rule kept) |
**bold**, then | bold, then (works) | bold, then |
__bold__x | __bold__x (symbols show) | __bold__x (underscores are not fixed) |
Fixing applies only to the HTML this tool produces. If you post the same Markdown source where the standard rules apply, such as GitHub, those spots still show as symbols. The simplest way to make the source work everywhere is to put the emphasis outside the punctuation ("**foo**" followed by a letter), and if the quotation marks themselves must be bold, write an HTML tag instead, such as <strong>"foo"</strong>s. Underscores are defined not to make emphasis inside a word, which protects names like snake_case, but in running text with Korean or Japanese particles attached, asterisks are the safer choice.
Why lines you broke run together
In Markdown, a blank line is what separates paragraphs. The GFM specification calls a line break written without a blank line a soft line break and says that HTML may render it as a line break or as a space. Browsers show it as a single space, so two lines end up joined in the result. According to the GitHub documentation, GitHub keeps line breaks automatically in issues and comments, but shows the same text as one line in an .md file.
| What you write | Blank line = paragraph (standard) | <br> on every line |
|---|---|---|
| A plain line break | Joined into one line | Split with <br> |
| Two spaces at the end of the line | Split with <br> | Split with <br> |
A backslash (\) at the end of the line | Split with <br> | Split with <br> |
| One blank line | Two paragraphs | Two paragraphs |
For poems, addresses and song lyrics, which are read line by line, choose <br> on every line. If you want to keep the rest of the document standard and split only a few lines, add a backslash at the end of those lines. Two trailing spaces are invisible, and some editors strip them when saving. In the standard state, joined lines are reported with their line numbers by the Single line breaks joined check card.
HTML inside Markdown, and safety
A Markdown text can contain HTML tags, and by default a converter carries those tags into the result unchanged. The marked documentation also states that marked does not sanitize its output HTML and recommends a separate filter. When you convert text written by someone else, or text generated by AI, scripts or click handlers can slip in, so the Raw HTML rule has three settings.
- Make safe (the starting state): removes tags and attributes that are not on the allow list.
script,style,iframe,object,embed,form, input fields andsvgare removed along with their content, and on-event attributes such asonclick,javascript:andvbscript:addresses and non-imagedata:addresses are removed too. What was removed is listed by kind and count in the HTML removed card. - Keep as is: leaves the HTML you wrote untouched. Choose it when you need to keep a hand-written table or a video embed code; if scripts or on attributes remain, the Dangerous HTML left in card warns you.
- Show as text: shows the tags as literal characters instead of running them. Use it when showing the tags is the point, as in an article about how to use HTML. The GFM "disallowed raw HTML" extension works the same way for 9 tags, turning the
<oftitle,textarea,style,xmp,iframe,noembed,noframes,scriptandplaintextinto text.
Whichever rule you choose, the web preview never runs scripts. The preview is drawn inside a sandboxed iframe that is not given allow-scripts, and according to MDN, scripts inside it are then not allowed to run. Even so, Make safe does not replace the security filter of the site you paste into. Each site accepts different tags, so check the result once more in that site's own preview after pasting.
How to choose the HTML form
| Form | Where to paste | What it contains |
|---|---|---|
| Body only | The HTML field of a blog or CMS, or the body of a web page you build yourself | Only tags such as <h2>, <p> and <ul>. The styling follows the design of the site you paste into. |
| Inline styles | An email body, or an editor that strips <style> | Puts font size, spacing, table borders and the code background directly on each tag with style="…". The look is the same as the light preview. |
| Full document | An .html file you open directly in a browser | Includes <!doctype html>, <meta charset="utf-8">, a title and <style>, and shows dark colors when the computer is in dark mode. Save as .html always uses this form. |
| Copy with formatting | An email or document editor that has no HTML field | Puts HTML with inline styles and plain text on the clipboard together. The receiving editor uses the formatting if it supports it and the plain text if not. |
Heading IDs and links inside the document
A link that starts with #, such as [Install](#install), is a table-of-contents link that jumps to a heading in the same document. For it to work, the heading needs an id with the same name, and marked does not add ids to headings. Turn on Heading IDs and the tool adds ids by the rules the GitHub documentation describes: letters are lowercased, spaces become hyphens (-), other whitespace and punctuation are removed, and a heading that appears again gets -1, -2 and so on. If the document has # links while Heading IDs is off, the check card says so and you can turn it on with the button on the card.
| Heading | Resulting id |
|---|---|
## Getting started | getting-started |
## Q&A | qa |
## Café & Crème | café--crème |
## C++ basics | c-basics |
## Getting started (second time) | getting-started-1 |
What the checklist tells you
- Emphasis left as symbols / Emphasis fixed: spots where emphasis next to punctuation leaves asterisks behind under the standard rules. It shows as Emphasis fixed when fixing is on and as Emphasis left as symbols when it is off.
- Single line breaks joined: spots where lines broken without a blank line were merged with a space.
- Unclosed code block: a block opened with
```and never closed, so all the text below it became code. - Table cells overflow: rows with more cells than the header row. GFM discards the extra cells, so their content is lost.
- Relative addresses: images or links written without a site address, such as
/images/a.pngordocs/a.md. In the preview they open relative to this page's address, but they may break when pasted on another site. - Images without description: images with empty alt text, such as
. - Heading level skipped: headings that jump a level, such as
####straight after##. The structure looks broken to people who follow the outline with a screen reader. - Links that need heading IDs / # link with no target: links inside the document that have no heading to jump to, or that do not jump because Heading IDs is off.
- HTML removed / Dangerous HTML left in / HTML shown as text: tags removed, kept or shown as text according to the Raw HTML rule.
Common mistakes
- A numbered list right under a paragraph: if you write
2. itemunder a paragraph with no blank line, it does not become a list and is joined to the paragraph. The only number that can interrupt a paragraph and start a list is 1. A bulleted list (- item) becomes a list even directly under a paragraph. - A line indented by 4 spaces: four spaces or a tab at the start of a line make a code block. Spaces meant to indent a paragraph do not appear in the result, so delete them.
---right under text: if you write---on the line right below a piece of text to get a rule, the text above becomes a level 2 heading. Leave a blank line before the rule.- Front matter at the top of the file: the
title: …lines wrapped in---at the top of an .md file for a static site are not Markdown syntax, so they turn into a rule and a heading. Delete them before converting. - A link address with a space:
[file](my document.pdf)does not become a link. Wrap it as[file](<my document.pdf>)or write the space as%20. - The blank line after a table: a table can start directly under a paragraph, but it needs a blank line where it ends, or the next text goes inside the table.
- Styling again on the site after copying: styles added by the inline-styles form take priority over the design of the site you paste into. To follow the site's design, choose Body only.
Limits
- Footnotes (
[^1]), math and diagram syntax are not part of marked's default syntax, so they stay as literal text. - Code blocks are not colored. The language name is kept as a
language-…class, so the code highlighter of the site you paste into decides the colors. - Fix emphasis applies only to
**,*and~~next to kana, Hangul or kanji; underscores and triple asterisks (***) follow the standard rule. - Make safe is based on this tool's own allow list. Which tags a site filters out by itself differs from site to site.
- Images in the preview are loaded directly from the address written. How the Copy with formatting result looks depends on the editor you paste into.
- Text over 2 MB is not converted, and above 30,000 characters the editor's syntax coloring is turned off.
Sources
Basis: the syntax comes from the CommonMark 0.31.2 and GFM 0.29-gfm specifications, the behavior from marked 18.0.9 output, browser features from MDN, and email support from caniemail.com, all checked on October 22, 2026. The HTML in the tables above is the real output of this tool.
- 01CommonMark Spec 0.31.2Left- and right-flanking definitions, example 380, when a list can interrupt a paragraph, indented code blocks
- 02GitHub Flavored Markdown Spec 0.29-gfmTables, task lists, strikethrough, autolinks, the 9 disallowed HTML tags, soft and hard line breaks
- 03GitHub Docs — Basic writing and formatting syntaxLine break differences between issues or comments and .md files, the rules for heading links (ids)
- 04marked documentationThe note that output HTML is not sanitized, and the gfm (on by default) and breaks (off by default) options
- 05MDN — the iframe sandbox attributeWithout allow-scripts, scripts are not run
- 06MDN — ClipboardItemHow to put text/html and text/plain on the clipboard together
- 07Can I email — <style> elementGmail on the web does not support style inside body, 16 KB limit
- 08RFC 7763 — The text/markdown Media TypeThe media type name text/markdown for .md files (March 2016)
- 09John Gruber — MarkdownThe original Markdown released in 2004 and its goal of text that is easy to read
Frequently asked questions
Which rules does the Markdown to HTML conversion follow?
It follows the GitHub Flavored Markdown (GFM) 0.29-gfm specification, and the engine is marked 18.0.9. Tables, task lists, strikethrough and autolinks are included. Only when Fix emphasis is on does it read emphasis next to punctuation in Japanese, Korean or Chinese text as emphasis, which differs from the standard.
Why do the asterisks still show in text like **"Important"**is?
In CommonMark, a closing emphasis mark that comes right after punctuation must be followed by whitespace or punctuation, so when a letter follows the closing quote directly, the emphasis does not close. Fix emphasis converts such spots only when the character outside is kana, Hangul or kanji, as in Japanese or Korean text. In English text, put the emphasis outside the quotes, as in "**Important**", which works everywhere.
Why are the lines I broke joined into one line in the result?
Markdown separates paragraphs with a blank line, and a line break written without one is joined with a single space. To keep the lines, put two spaces or a backslash at the end of a line, or set the line break rule in the conversion rules to '<br> on every line'.
What should I copy when pasting into a blog or an email?
If the editor has an HTML field, press Copy HTML with the Body only form. For an editor with no HTML field, use Copy with formatting. For email that strips <style>, use the Inline styles form so the look survives.
Do scripts written inside the Markdown run?
The web preview is drawn in a sandboxed iframe that does not run scripts. In the output HTML, the starting setting, Make safe, removes script, on-event attributes and javascript: addresses. Keep as is leaves them in, and the checklist warns you.
Is my text saved on a server?
No. Conversion happens only in your browser. With Save in this browser on, your text and rules are kept only in this browser's storage (localStorage), and turning it off deletes the saved text. Example texts are never saved.
Clicking a table-of-contents link does not jump to the heading.
A link such as [Install](#install) only works if the heading has an id with the same name. Turn on Heading IDs in the conversion rules and ids are added by the GitHub rules: lowercase, spaces become hyphens, punctuation is removed, and a repeated heading gets -1.
Does the tool color code blocks?
No. It keeps the language name written like ```js as a language-js class. If the site you paste into has a code highlighter, that highlighter reads the name and adds the colors.