How to use this Markdown to HTML Converter
Paste your Markdown into the input box and click Convert to HTML. The tool
renders the output on the right so you can preview how the HTML will look, then shows the
generated markup below for copying or downloading.
- Paste Markdown into the input area.
- Click Convert to HTML.
- Review the rendered preview.
- Copy or download the generated HTML.
Example Markdown
# Hello World
This is **bold** text.
- Item one
- Item two
[Visit ToolzYard](https://toolzyard.com)
Common uses
- Blog post drafting
- Documentation writing
- CMS content preparation
- Landing page sections
- Developer notes and publishing workflows
There is no single Markdown — CommonMark vs GFM
Markdown began in 2004 as John Gruber's format with a deliberately loose description and a
permissive reference implementation, which left many cases ambiguous. Different tools filled
those gaps differently, so the same Markdown can produce different HTML depending
on the converter. CommonMark is the strict specification that pinned the
ambiguities down; GitHub Flavored Markdown (GFM) is CommonMark plus a set
of extensions.
The practical result is that several features you may think of as "Markdown" are actually
GFM extensions and will not render in a plain CommonMark converter: tables, task-list
checkboxes (- [ ]), strikethrough with ~~, and automatic linking
of bare URLs. If your output looks right on GitHub but not here — or vice versa — the flavour
difference is usually why.
Raw HTML passes straight through — an XSS risk
This is the one that matters for security. By design, Markdown lets you drop raw HTML into a
document, and converters faithfully pass it through to the output. That is convenient when
you write the Markdown yourself, and dangerous when someone else does: a comment, a wiki
page, or a profile bio containing
<img src=x onerror="..."> or a <script> tag becomes
live HTML in your page. Rendering untrusted Markdown without cleaning the result is a classic
stored cross-site-scripting hole.
Conversion and sanitisation are separate jobs. A Markdown-to-HTML converter is not a
security filter — GFM offers an optional tag filter for a few dangerous elements, but its
own documentation states it is not a substitute for proper sanitisation. If the Markdown
comes from users, run the generated HTML through a dedicated sanitiser such as DOMPurify
before it reaches the DOM.
The line-break and emphasis rules that surprise people
The most common "it didn't work" is line breaks. A single newline in Markdown is a
soft break and renders as an ordinary space, not a <br>. To
force a line break you end the line with two trailing spaces or a backslash, or you leave a
blank line to start a new paragraph. This trips up anyone expecting the source layout to be
preserved verbatim.
A few more catch people out. In CommonMark, underscores in the middle of a word do
not create emphasis, so my_variable_name stays literal — but some
older parsers italicise it. Indenting a line by four spaces silently turns it into a code
block. And a line of text immediately followed by a line of --- becomes a
level-two heading (a "setext" heading), which surprises people who meant to draw a
horizontal rule.
What conversion handles, and what it leaves to you
The converter escapes the HTML-significant characters in your text — &
becomes &, < becomes < — so plain
prose renders correctly rather than being mistaken for markup. It maps headings, lists,
links, emphasis, and code blocks to their HTML equivalents. What it does not do is impose a
document structure or styling: the output is a fragment of body HTML, not a complete page
with <html>, <head>, or CSS, so you supply those when
you embed it. And, as above, it does not sanitise — treat conversion and safety as two
distinct steps.
Frequently Asked Questions
Why is the HTML different from what GitHub produces?
GitHub uses GitHub Flavored Markdown, which adds tables, task lists, strikethrough, and
bare-URL autolinking on top of CommonMark. A plain CommonMark converter does not render
those extensions, so the same source can produce different HTML.
Why didn't my single line break create a new line?
A single newline is a soft break and renders as a space, by design. End the line with
two trailing spaces or a backslash to force a <br>, or use a blank
line to begin a new paragraph.
Is it safe to convert Markdown submitted by users?
Not without sanitising the result. Markdown allows raw HTML to pass through, so
user-supplied content can inject <script> or event-handler attributes
— stored XSS. Run the generated HTML through a sanitiser like DOMPurify before inserting
it into the page.
Why don't my tables or task lists render?
They are GFM extensions, not part of CommonMark. A converter that follows CommonMark
without GFM leaves table pipes and - [ ] checkboxes as literal text. You
need a GFM-capable parser for those.
Why did my text unexpectedly become a heading or code block?
A line of --- directly under a line of text creates a setext heading rather
than a horizontal rule, and indenting any line by four spaces turns it into a code
block. Both are standard Markdown rules that catch people off guard.
Does the output include a full HTML page?
No. Conversion produces a fragment of body markup — headings, paragraphs, lists — not a
complete document with <html>, <head>, or styling.
Wrap it in your own page structure and CSS when you publish it.