About the Markdown to HTML
Convert Markdown to HTML when a README, a blog draft or notes written in Markdown have to go into a web page, an email template or a CMS that only accepts HTML. Write or paste the Markdown on the left and the formatted result appears beside it, so you can check headings, lists, links and code blocks, then switch to the HTML code tab to see the markup you will copy.
Markdown is a plain-text way of writing formatting: # for a heading, ** for bold, - for a list item. Each mark stands for an HTML element, so md to HTML conversion is mechanical and gives the same result every time. The reference table below lists the element each piece of syntax becomes. Check it when the HTML doesn't look the way you expected.
How it works
A Markdown converter reads the text in two passes. The first finds the blocks: headings, paragraphs separated by blank lines, list items, block quotes starting with >, and fenced code between lines of three backticks. The second pass works inside each block and turns inline marks into elements: asterisks into <strong> or <em>, backticks into <code>, and [text](url) into links.
Blank lines matter because of that block structure. Two lines of text with no blank line between them are one paragraph, joined by a space, and in some Markdown flavours a list that starts directly under a paragraph needs a blank line before it. Code inside backticks or a fenced block is never formatted, so characters such as < and & in it are escaped to < and & and display literally.
Assumptions and limits
- Markdown has several dialects. Core syntax follows CommonMark; tables, ~~strikethrough~~ and task lists come from GitHub Flavored Markdown and may not work in every other Markdown tool.
- A single line break inside a paragraph is not a line break in HTML. End the line with two spaces, or leave a blank line to start a new paragraph.
- Converting Markdown sets the structure only. Fonts, colours and spacing come from the CSS of the page where you paste the HTML.
- Raw HTML typed into the Markdown is passed through to the HTML code unchanged. The preview on this page removes scripts and event handlers, but the copied HTML keeps them, so only use HTML from text you trust on a public page.
- Copy HTML gives just the converted elements, for pasting into a page or CMS. Download .html saves a complete page with a UTF-8 charset, titled with the first heading.
Worked examples
A short README section
A heading, a sentence with bold and inline code, and a two-item list. Each line of Markdown maps to one HTML element.
## Install Run **npm install** then `npm start`. - Node 18 or later - 200 MB free space <h2>Install</h2> <p>Run <strong>npm install</strong> then <code>npm start</code>.</p> <ul> <li>Node 18 or later</li> <li>200 MB free space</li> </ul>
A link and a numbered list
Numbered items become an ordered list whatever numbers you type, so 1. 1. 1. still renders as 1, 2, 3. The link text goes between the tags and the address into href.
See the [style guide](https://example.com/guide). 1. Draft 1. Review <p>See the <a href="https://example.com/guide">style guide</a>.</p> <ol> <li>Draft</li> <li>Review</li> </ol>
Markdown syntax and the HTML it becomes
| Markdown | HTML element | Notes |
|---|---|---|
| # Title | <h1> | ## to ###### give <h2> to <h6> |
| **bold** or __bold__ | <strong> | |
| *italic* or _italic_ | <em> | |
| ~~struck~~ | <del> | GitHub Flavored Markdown |
| `code` | <code> | contents are not formatted |
| ``` fenced block ``` | <pre><code> | a language name after the fence is kept as a class |
| - item or * item | <ul><li> | |
| 1. item | <ol><li> | |
| > quote | <blockquote> | |
| [text](url) | <a href> | |
|  | <img alt src> | alt text becomes the alt attribute |
| --- on its own line | <hr> | under a line of text it makes a heading instead |
| | a | b | table | <table> | GitHub Flavored Markdown |
| blank line | new <p> | single line breaks are joined |
How to use the Markdown to HTML
- Write or paste Markdown. Replace the sample document in the editor with your own text.
- Check the formatting. Use Split View to see the editor and the result side by side, or Preview Only for a full-width look. The HTML code tab shows the markup itself.
- Copy or download the HTML. Press Copy HTML for the code, Download .html for a complete page, or Export .md to keep the Markdown source.
Frequently asked questions
How do I convert Markdown to HTML?
Paste the Markdown into the editor; the formatted result appears in the preview and the markup in the HTML code tab, ready for Copy HTML or Download .html. The rules are fixed: # lines become headings, blank lines separate paragraphs, - lines become list items, and asterisks around words mark bold or italic text.
Why do my line breaks disappear in the HTML?
Because Markdown treats a single line break inside a paragraph as a space, so the lines run together. Leave a blank line between them to make two paragraphs, or end a line with two spaces or a backslash to force a <br> line break.
Does Markdown support tables?
Yes, through GitHub Flavored Markdown; the original syntax has none. A table is written as a header row with cells separated by pipes, a line of dashes under it, then the data rows. Each becomes <table>, <thead>, <tr>, <th> and <td> in HTML.
Can I put HTML inside Markdown?
Yes. HTML tags are passed through unchanged, so you can add a <details> block or a <span> with a class where Markdown has no syntax. Markdown formatting inside a block of HTML isn't processed unless a blank line separates it from the tags.
What's the difference between .md and .html files?
A .md file is plain text with formatting marks that a person can read as is. An .html file holds the tags a browser uses to display the page. Keep the .md file as the editable source and generate HTML whenever it changes.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.