How to Convert Markdown to HTML (Free, with Live Preview)
Learn the key Markdown syntax, how to convert it to clean HTML with a live preview, the mistakes to avoid, and what a real test produced.
What Markdown is, and why you convert it to HTML
Markdown is a way of writing formatted text using ordinary characters. A hash at the start of a line makes a heading, asterisks around a word make it bold, and a dash starts a list item. It was created by John Gruber in 2004, with help from Aaron Swartz, and it became the standard for README files, developer documentation, static-site blogs and many note-taking apps because the source stays readable as plain text.
Browsers cannot display Markdown directly. They display HTML. Converting Markdown to HTML lets you write quickly in a simple format and still publish to web pages, email templates, content management systems and apps that expect HTML.
The Markdown syntax you will use most
These are the elements most documents rely on, and the HTML each one becomes.
- Heading: ## Title becomes <h2>Title</h2>. One # gives an h1, two gives an h2, and so on.
- Bold and italic: **bold** becomes <strong>, and *italic* becomes <em>.
- Strikethrough: ~~text~~ becomes <del>text</del>.
- Link: [text](https://example.com) becomes an <a href> element.
- Image:  becomes an <img> element, and the text in the brackets is the alternative text.
- Inline code: text between single backticks becomes <code>.
- Code block: text between triple backticks becomes <pre><code>, and a language name after the opening backticks adds a language class.
- Quote: a > at the start of a line becomes <blockquote>.
- Lists: a dash or number at the start of a line makes a bulleted or numbered list, and indented items become nested lists.
- Task list: - [x] done and - [ ] to do become list items with a checkbox.
- Table: rows separated by pipes, with a separator row of dashes, become a <table>.
Step by step: converting Markdown with the ProTools Hub converter
The free [Markdown to HTML converter](/tools/markdown-to-html) runs in your browser and shows a live preview as you type. You can follow along with your own text.
- Type or paste your Markdown into the input box, upload a .md file, or click Load Sample to start from an example.
- Open the Preview tab to see how the content will look.
- Choose your options: open links in a new tab, add IDs to headings, or wrap the output in a full HTML document.
- Switch to the HTML code tab to read the generated markup.
- Click Copy HTML to paste it straight into your page, or Download to save it as an .html file. Clear empties the input box.
What the options do
Open links in a new tab adds target and rel attributes to every link, which is useful for documentation where you want readers to keep your page open. Add heading IDs gives each heading a URL-friendly id, so you can link to a section directly with a fragment such as #installation. Full HTML document wraps the output in a complete page with a doctype, head and body, which you can save and open as an .html file. Leave it off when you only need the snippet to paste into an existing page.
What we tested: a README-style note
To check this guide we pasted a short note of 78 words and 415 characters into the converter. It contained a heading, a paragraph with bold, italic, strikethrough and inline code, a checklist, a numbered list with a nested bulleted list, a blockquote, a two-column table, a fenced code block and one link. We left Open links in new tab on and the other options off.
The Preview tab showed the heading, the formatted paragraph, a checklist with checkboxes, and the numbered steps with their nested items. The HTML code tab showed clean, readable markup: an h1 and h2 headings, a paragraph using strong, em, del and code, list items with disabled checkbox inputs for the task list, an ordered list with a nested unordered list, a blockquote and the start of a table with a thead.
The counters under the editor reported 3 headings, 1 link, 0 images, 1 code block and 1 table, with an HTML size of 1.0 KB. Those numbers match what we typed. We did not inspect every line of the output, and we did not test the unusual cases covered in the limits section below in this run. It was one short sample, so it shows the conversion works as described and does not prove how it handles every document.
Common Markdown mistakes that break the output
Most conversion problems come from a handful of habits.
- No blank line between blocks. Put an empty line between paragraphs, headings, lists, tables and code blocks so they are read as separate pieces.
- Inconsistent list indentation. Indent nested items consistently, usually with two or four spaces, or they may not nest.
- A table without a separator row. The second row of dashes, such as | --- | --- |, is what makes the first row a header.
- Unclosed code fences. Every opening set of triple backticks needs a matching closing set, or the rest of the document becomes code.
- Special characters. To show a literal asterisk or underscore instead of formatting, put a backslash in front of it.
- Line breaks. End a line with two spaces and press Enter to force a line break inside a paragraph. A blank line starts a new paragraph.
Is the generated HTML safe to publish?
The converter escapes any raw HTML you type, so a tag such as a script element is shown as text instead of running. It also allows only safe link and image addresses (http, https, mailto, relative paths and anchors), and the preview runs in a sandboxed frame. That reduces the risk of script injection through Markdown.
It is still good practice to keep your own site's security measures in place. If you accept Markdown from other people and publish it on your site, sanitize the final HTML on your server too, because you cannot rely on any single tool to protect your pages.
What the converter does not support
The converter follows common Markdown rules and the GitHub-style extensions for tables, task lists and strikethrough. Features that go beyond that are not supported, such as footnotes, math formulas, definition lists, indented code blocks and embedded raw HTML, which is escaped on purpose. Very unusual edge cases may also render slightly differently from other converters, so preview anything important before you publish it.
Try it free
Markdown to HTML
Write Markdown, see a live preview, and copy or download clean HTML in your browser.
Frequently asked questions
What is the difference between Markdown and HTML?
Markdown is a simple, readable shorthand for formatting. HTML is the markup language browsers actually display. A converter turns the first into the second.
Can I convert a Markdown file instead of typing?
Yes. Use Upload .md to load a Markdown file of up to 1 MB, check the preview, then copy or download the HTML.
How do I make a line break inside a paragraph?
End the line with two spaces and press Enter. A blank line starts a new paragraph.
Why does my table show as plain text?
A table needs a separator row of dashes under the header row, such as | --- | --- |, and a blank line before it.
Is my text uploaded to a server?
The conversion runs in your browser. The site itself uses analytics and advertising scripts, as explained in our Privacy Policy.
Keep reading
Do Browser-Based Tools Upload Your Files? How to Check for Yourself
Learn how in-browser processing works, what it protects and what it does not, and how to check for yourself that a tool is not uploading your files.
ToolsHow Extractive Text Summarization Works (and Where It Falls Short)
Learn how sentence scoring picks the key lines from long text, and when you should read the full source instead.
Written by the ProTools Hub Team. This article is for general information. Features and browser support change over time, so check current documentation for anything critical.