How to use the markdown to html converter
- Paste or type your Markdown text into the input area.
- Check Wrap in full HTML document if you need a complete page with
<!DOCTYPE html>. - Toggle Add id attributes to headings to generate anchor-friendly IDs on each heading.
- Copy the resulting HTML from the output area.
Supported Markdown Subset
This markdown to html converter handles the most commonly used formatting constructs. The supported subset includes:
- Headings: ATX style from
# H1through###### H6. - Emphasis:
*italic*,**bold**and***bold italic***. - Inline code: wrapped in backticks like
`code`. - Fenced code blocks: three or more backticks, with optional language tag.
- Links and images:
[text](url)and. - Unordered lists: lines starting with
-,*or+. - Ordered lists: lines starting with digits followed by a period.
- Blockquotes: lines starting with
>. - Horizontal rules: three or more hyphens, asterisks or underscores on their own line.
- Tables: pipe-delimited rows with a separator row using hyphens.
- Strikethrough and task lists:
~~text~~and- [x] done(the latter becomes a disabled checkbox). - Strikethrough and task lists:
~~text~~and- [x] done(the latter becomes a disabled checkbox).
Nested lists, reference-style links, setext headings, indented code, autolinks, strikethrough and task lists are supported too. Footnotes, definition lists and raw HTML pass-through are not.
How the Conversion Works
The conversion happens in two main phases. First, every character that could be interpreted as HTML markup is escaped. Angle brackets become < and >, ampersands become &, and quotes become ". This guarantees that any HTML tags typed in the source Markdown appear as harmless text in the output.
Second, the text is parsed into blocks (headings, paragraphs, quotes, lists, code, tables) and then the inline markup inside each block is resolved with the CommonMark emphasis rules, so snake_case_name stays plain text and **bold** and [links](url) become their HTML tags. Everything written into the output is escaped as it is generated. For example, the Markdown **important** becomes <strong>important</strong>.
Why Escape Raw HTML
Many Markdown parsers allow raw HTML to pass through directly into the output. While convenient for trusted authors, this creates a cross-site scripting risk when rendering user-supplied content. This tool takes the opposite approach: all input is treated as plain text first, and only the Markdown syntax itself generates HTML tags.
If you write <div class="x"> in the input, the output will contain <div class="x">, which browsers display as literal text rather than interpreting as an element. Link and image targets are checked as well: only http, https, mailto, tel, ftp and relative URLs are kept (plus data:image/png, jpeg, gif, webp or avif for images). A link such as [x](javascript:alert(1)) or one that hides the scheme with entities or whitespace loses its target and is output as plain text. Review the result before using it in a high-risk setting, but the output does not contain raw input HTML or script URLs.
Heading IDs and Full Documents
When the Add id attributes to headings option is enabled, each heading receives an id attribute derived from its text. Spaces become hyphens, and characters outside letters, numbers and hyphens are removed. A heading like ## Getting Started! produces <h2 id="getting-started">Getting Started!</h2>. These IDs are useful for linking directly to sections within a page.
The Wrap in full HTML document option surrounds the generated body content with a standard HTML5 boilerplate. This is helpful when you want to save the output directly as an .html file and open it in a browser without manually adding the <!DOCTYPE html>, <html>, <head> and <body> tags.
Common Markdown Syntax Reference
Here is a quick reference showing how common Markdown constructs map to HTML in this converter:
| Markdown Input | HTML Output |
|---|---|
# Heading 1 | <h1>Heading 1</h1> |
**bold** | <strong>bold</strong> |
*italic* | <em>italic</em> |
`code` | <code>code</code> |
[text](url) | <a href="url">text</a> |
 | <img src="url" alt="alt"> |
--- | <hr> |
> quote | <blockquote><p>quote</p></blockquote> |
Worked examples
| Example | Input | Result |
|---|---|---|
| Basic formatting | Markdown: # Title / This is **bold** and *italic*. / - Item one / - Item two | <h1 id="title">Title</h1> / <p>This is <strong>bold</strong> and <em>italic</em>.</p> / <ul> / <li>Item one</li> / <li>Item two</li> / </ul> |
| Table and code | Markdown: | Name | Score | / | --- | --- | / | Alice | 95 | / ```js / console.log('hi'); / ``` | <table> / <thead> / <tr><th>Name</th><th>Score</th></tr> / </thead> / <tbody> / <tr><td>Alice</td><td>95</td></tr> / </tbody> / </table> / <pre><code class="language-js">console.log('hi'); / </code></pre> |
| Full document | Markdown: # My Page / Hello world.; Wrap in full HTML document: yes; Add id attributes to headings: yes | <!DOCTYPE html> / <html lang="en"> / <head> / <meta charset="UTF-8"> / <meta name="viewport" content="width=device-width, initial-scale=1.0"> / <title>My Page</title> / </head> / <body> / <h1 id="my-page">My Page</h1> / <p>Hello world.</p> / </body> / </html> |
FAQ
Does this markdown to html converter support all Markdown features?
It follows CommonMark for headings, emphasis, nested lists, code blocks, blockquotes, links, images and horizontal rules, plus GitHub-style tables, strikethrough and task lists. Footnotes, definition lists and raw HTML are not supported.
Is my Markdown text sent to a server?
No. The conversion runs entirely in your browser using JavaScript. Your text is never uploaded or stored anywhere.
Can I use raw HTML tags inside my Markdown?
Raw HTML tags in the input are escaped and rendered as plain text. This is intentional to prevent cross-site scripting vulnerabilities. Only Markdown syntax produces HTML elements in the output.
What does the heading ID option do?
It adds an id attribute to each heading element based on the heading text. Spaces are replaced with hyphens and special characters are removed, making it easy to create anchor links to specific sections.
How do I convert HTML back to Markdown?
You can use the html to markdown tool to reverse the process and turn HTML markup back into Markdown syntax.
Can I minify the generated HTML?
Yes. After converting your Markdown, copy the output and paste it into the html minify tool to remove unnecessary whitespace and reduce file size.