Free Markdown to HTML Converter
Convert Markdown syntax to clean HTML code with live preview.
Live Preview
Supported Markdown Syntax
Headers: # H1, ## H2, ### H3, etc.
Emphasis: *italic*, **bold**, ***bold italic***, ~~strikethrough~~
Links: [text](url)
Images: 
Code: `inline code` and fenced code blocks with ```
Lists: - unordered items, 1. ordered items
Blockquotes: > quoted text
Horizontal rules: --- or ***
How to Use This Converter
- Paste your Markdown. The tool accepts CommonMark plus the most common GFM extensions, tables, fenced code with language hints, strikethrough, autolinks and task list items.
- Watch the live conversion. The right pane shows the raw HTML output as you type; the preview pane below renders it visually.
- Copy the HTML. Use the Copy HTML button to grab the output ready to paste into your CMS, email client, static-site generator template or anywhere else that accepts HTML.
A Short History of Markdown
Markdown was created by John Gruber, the writer behind the Daring Fireball weblog, with substantial design feedback from Aaron Swartz. The first public release, version 1.0, was announced on Gruber's site on 9 March 2004; version 1.0.1, the canonical reference release, followed on 17 December 2004 and is still the version linked from daringfireball.net/projects/markdown. Markdown was two things at once from the start: a plain-text formatting syntax and the original Perl script that converted it to HTML. Gruber's stated goal was that the source text should be readable as-is, a Markdown document opened in a plain-text editor should look like a thoughtfully formatted email, not a tag soup. That readability constraint is the philosophical line that separates Markdown from XML-based formats and from heavier markup like LaTeX, and it is the reason every later extension has had to argue for itself in terms of how badly it disrupts the source. Aaron Swartz had earlier written a related lightweight markup called atx (2002), which contributed the now-familiar # and ## heading style, sometimes still called "atx-style headings" inside parser specs.
CommonMark, Fixing the Underspecification
Gruber's original 2004 syntax description was famously informal, a prose document with examples, not a grammar. It left dozens of edge cases unspecified, and Gruber never released a reference parser other than his Perl script, whose behaviour was idiosyncratic in ways other implementers had to either copy or override. The result by the early 2010s was that GitHub, Reddit, Stack Overflow, Pandoc and the Discount C parser all rendered the same Markdown source slightly differently. In 2012, Stack Overflow co-founder Jeff Atwood and Pandoc author John MacFarlane began an effort to write a real, testable specification. The project launched publicly in September 2014 as "Standard Markdown"; within days Gruber objected to the name in private email, Atwood wrote a public post explaining the change, and the project was rebranded "CommonMark." The first numbered release came on 25 October 2014. The current published version is CommonMark 0.31.2, released 28 January 2024. The CommonMark spec is unusual in that it is itself a CommonMark document, with 600+ executable test cases inline; a parser claims conformance by passing those tests. GitHub Flavored Markdown (GFM), the formal spec at version 0.29-gfm dated 6 April 2019, defines five extensions on top of CommonMark: tables, task list items, strikethrough, autolinks for bare URLs, and disallowed raw HTML (a security restriction that strips dangerous tags from author-supplied HTML).
The Major Parsers
marked.js was created by Christopher Jeffrey in 2011 and has been maintained by the markedjs GitHub organisation since 2018, a single-pass, lexer-then-parser design that prioritises raw speed; ~36k stars and the most-starred Markdown project on GitHub. It's the parser this tool uses for the conversion. markdown-it was launched in 2014 by Vitaly Puzrin and Alex Kocharin, advertising 100% CommonMark conformance with optional GFM toggles plus an aggressive plugin ecosystem (markdown-it-footnote, markdown-it-emoji, markdown-it-attrs, markdown-it-anchor and several hundred others). It's the parser used by VS Code's built-in Markdown preview, GitLab's web UI, and Eleventy. remark / unified.js is not a single parser but a tree-transformation framework, the unified collective defines an abstract syntax tree spec called mdast (Markdown AST); remark parses Markdown into mdast, plugins manipulate the tree, and remark-rehype converts mdast to hast (HTML AST) for emission. Slower than marked but vastly more composable; notable users include Prettier, Gatsby, MDN and the alex inclusive-language linter. Pandoc, released by John MacFarlane on 10 August 2006, is the universal document converter, written in Haskell, parses about 30 input formats, renders into about 40 output formats; ubiquitous in academic and technical publishing.
The MD-to-HTML Pipeline, Mechanically
A Markdown parser typically works in two passes. Block-level parsing splits the input into block structures, paragraphs, headings, lists, code fences, blockquotes, horizontal rules, tables. Block boundaries are determined by blank lines and indentation; getting them right is most of what makes a CommonMark parser correct. Inline parsing then walks the contents of each block and matches inline syntax: emphasis (*italic*, **bold**), links ([text](url)), inline code spans (`code`), images (), strikethrough (~~text~~ in GFM), and explicit autolinks (<https://example.com>). Inline emphasis parsing is the single most fiddly part of any Markdown spec, CommonMark dedicates several pages of the spec and dozens of test cases to specifying when *foo*bar* should produce <em>foo</em>bar* versus *foo<em>bar</em>. The parser then renders each token as the corresponding HTML element and concatenates the results. Pretty printing, indentation and code-block syntax highlighting are layered on top by the rendering options.
Why Convert MD to HTML in the First Place?
- CMS imports. Many headless CMSes (Contentful, Sanity, Wagtail, Ghost) accept HTML but not Markdown. Drafting in Markdown and converting once at publish time keeps the editing experience pleasant.
- Email composition. Email clients render HTML; most don't render Markdown. Newsletter platforms (Mailchimp, ConvertKit, Substack) typically accept HTML pasted into their editor. Convert your draft, paste, send.
- Blog post drafts. Some legacy WordPress installs without the Markdown plugin require HTML in the post body; some Shopify and Webflow shop pages take HTML in their rich-text fields.
- Static-site generator snippets. When you need an inline HTML chunk for a Hugo shortcode, an Eleventy template or a Next.js MDX file, converting Markdown to a single HTML fragment is faster than fighting the SSG's own conversion pipeline.
- Sharing rendered notes. Pasting "rendered" Markdown into Slack, Notion, Linear, ClickUp or other rich-text destinations sometimes wants HTML on the clipboard rather than raw Markdown.
- Archiving documentation. Storing the rendered HTML alongside the Markdown source means your archive is human-readable in a browser without a parser, useful for long-term preservation.
Output Options Worth Knowing About
Different downstream uses want different things from the converted HTML. Full document vs fragment. A full HTML document includes <!DOCTYPE html>, <html>, <head> with metadata, and a <body> wrapper (appropriate when you'll save the file as .html and open it in a browser. A fragment is just the body content, no wrapper) appropriate when you'll paste into a CMS field that already provides the document structure. This tool emits fragments by default; wrap with your own boilerplate if you need a complete document. Sanitisation. By default Markdown parsers pass raw HTML through unchanged, so if your source contains <script>alert(1)</script>, that script tag will appear in the output. For documents going into a multi-user system, run the output through DOMPurify (Cure53, started February 2014) before injecting into the DOM. For one-shot personal use, the raw output is fine. Header IDs. Generating id attributes on headings (slugified from the heading text) lets you build a table of contents with anchor links. The exact slug algorithm differs between platforms (GitHub uses one rule, MkDocs another, marked.js a third) so anchor links can break when content moves between systems. Hard line breaks. CommonMark requires either two trailing spaces at the end of a line or a backslash to force a <br>; some platforms (Discord, GitHub issues) treat single newlines as breaks. The choice depends on your source's expected style.
Common Pitfalls
- Smart-quote conversion. Some parsers (or post-processing layers like Gruber's own SmartyPants) replace straight quotes with curly typographic quotes by default. If you need straight quotes preserved (because your output is being parsed as code), check that this transformation is off.
- List-marker whitespace sensitivity. Mixing
-and*and+in the same list, indenting list-continuation paragraphs by less than the marker requires, or putting a blank line between list items can flip a tight list into a loose list (each item wrapped in<p>tags). The visual difference in output is dramatic. - Autolink overzealousness. GFM-style autolinking turns any bare URL into a link, which is usually what you want, but can mangle URLs containing parentheses (Wikipedia URLs especially) or trailing punctuation.
- Tables that need escaping. Pipe characters inside table cells must be escaped as
\|, otherwise they're read as column separators. Catches anyone trying to put a one-line code example inside a cell. - Mixed Markdown and HTML. Markdown was designed to pass arbitrary HTML through, so dropping a
<div class="callout">into a Markdown file works. But the moment you put Markdown syntax inside an HTML block, parsers diverge: CommonMark treats most HTML blocks as opaque; Markdown Extra introducedmarkdown="1"to opt in to nested parsing. - Heading IDs across platforms. Different slugify algorithms produce different anchor fragments for the same heading; intra-document links can break when content moves between systems.
This Tool vs the Markdown Previewer
Absolutool ships two related tools that overlap on the same parser. The Markdown Previewer is for live editing, write Markdown on the left, see the rendered visual output on the right, no concept of "the HTML output." This Markdown-to-HTML Converter is for one-shot conversion, paste Markdown, copy raw HTML, paste into your CMS or email client. Use the previewer when you're drafting and need visual feedback; use this converter when you have finished Markdown and need HTML you can transport elsewhere. Both tools use marked.js under the hood and accept the same CommonMark + GFM dialect, so the conversion behaviour is identical between them.
Privacy: Why Browser-Only Matters Here
Drafts of unpublished writing (blog posts in progress, internal documentation, client deliverables under NDA, manuscript chapters, academic papers) are exactly the kind of text you don't want to upload to a third-party service. Server-side Markdown converters require sending the entire document to a remote endpoint, which means it sits in the server's logs, possibly in a CDN cache, possibly in an analytics pipeline, possibly in a backup. For published text the issue is moot. For draft work, the architecture matters. This tool runs the entire pipeline in your browser via JavaScript and marked.js. The Markdown never crosses the network, verify in DevTools' Network tab while you type, or take the page offline (airplane mode) after it loads and confirm the converter still works. Safe for confidential drafts, client deliverables, manuscript chapters under NDA, internal memos or anything else you wouldn't want copied onto a stranger's hard drive.
Frequently Asked Questions
Which Markdown dialect does this converter support?
CommonMark with the most common GFM extensions enabled, tables (pipe-delimited with optional : alignment), fenced code blocks with language hints, strikethrough via ~~text~~, autolinks for bare URLs, and task list items via [ ] and [x]. Headings, bold, italic, links, images, lists, blockquotes, horizontal rules and inline code all work as you would expect on GitHub. The renderer is marked.js, the same parser the Markdown Previewer uses.
Does this support GitHub Flavored Markdown (GFM)?
Yes, tables with pipes, fenced code blocks with language hints, task lists, autolinks and strikethrough all work. If a GFM extension isn't rendering, double-check the input follows CommonMark/GFM syntax rules: blank lines around block elements, matching backtick counts on fenced code blocks, exactly two trailing spaces (or a backslash) for hard line breaks. The most common cause of "GFM not working" is an editor that strips trailing whitespace on save, which kills hard-break syntax.
Will the output look the same on GitHub?
The structural HTML (paragraphs, lists, tables, headings) will match for any input that is valid CommonMark + GFM. Two layers will differ. GitHub applies its own CSS theme and syntax-highlighting, so colours, fonts and spacing will look different. GitHub also layers post-processing on top of the spec (emoji shortcodes (:smile:), @user mentions, #issue auto-linking, repository-relative image paths) that no spec-compliant converter reproduces. The HTML this tool emits is portable structurally; the visual appearance depends on the CSS in the destination.
Should I sanitize the output before publishing?
If the source could include user-supplied content, yes. Markdown parsers pass raw HTML through unchanged, so a source containing <img src=x onerror="alert(1)"> will produce that tag in the output. For multi-user systems, run the output through DOMPurify (Cure53, February 2014, the de-facto JavaScript sanitizer) before injecting into the DOM. For one-shot personal use where the source is your own writing, this isn't an issue, the worst you can do to your own page is paste in your own HTML.
Can I get a full HTML document with head and body?
Currently this tool emits the body fragment only, the converted Markdown wrapped in semantic HTML tags but not in a full <html>/<head>/<body> document. To save as a standalone .html file, wrap the output yourself: <!DOCTYPE html><html><head><meta charset="utf-8"><title>...</title></head><body>[fragment]</body></html>. Or use Pandoc with the --standalone flag for fully standalone output with template-driven CSS.
Is my Markdown sent anywhere?
No. Conversion runs entirely in your browser via marked.js. The Markdown you paste never crosses the network, verify in DevTools' Network tab while you type, or take the page offline (airplane mode) after it loads and confirm the converter still works. Safe for confidential drafts, client deliverables under NDA, manuscript chapters or any text you wouldn't want copied onto a stranger's hard drive.
Related Tools
HTML to Markdown
Convert HTML code to clean Markdown syntax. Supports headings, links, lists, tables and more.
Markdown Previewer
Write Markdown and see a live rendered preview. Supports tables, code blocks, and more.
Markdown Table Generator
Build Markdown tables visually with a spreadsheet editor. Set alignment and copy the output.