Markdown to HTML Converter
Paste Markdown and get clean HTML with GitHub tables, strikethrough and optional single-newline line breaks, plus a sandboxed preview and one-click copy.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Markdown to HTML Converter?
Type or paste Markdown on the left and the HTML appears on the right, with a rendered preview underneath so you can see what a browser will do with it. The converter understands CommonMark plus the GitHub extensions: tables, strikethrough and task lists all come through.
A toggle controls line breaks. In standard Markdown a single newline inside a paragraph is ignored; with the GitHub-style switch on, every newline becomes a <br>, which matches how comments and chat messages behave. Turn it off when you are producing HTML for a page where paragraphs should reflow.
Conversion runs with the marked library in your browser and nothing is sent anywhere. The preview sits in a sandboxed frame where scripts cannot run, and Copy HTML puts the raw markup on your clipboard, ready for a CMS field, an email template or a static page.
- CommonMark plus GFM tables, strikethrough and task lists
- Optional GitHub-style single-newline <br> breaks
- Rendered preview in a sandboxed, script-free frame
- Copy the generated HTML with one click
- Converts locally in the browser as you type
Updated
How to use the Markdown to HTML Converter
- Paste Markdown into the left box, or edit the sample to experiment.
- Choose how newlines behave with the GitHub-style line break toggle.
- Read the generated HTML in the output box and check the rendered preview below it.
- Click Copy HTML and paste the markup where it is needed.
Worked examples
Emphasis
Input
We ship **Friday**, not ~~Thursday~~.
Output
<p>We ship <strong>Friday</strong>, not <del>Thursday</del>.</p>
Double asterisks become <strong> and the GFM tilde syntax becomes <del>. Single asterisks or underscores would produce <em> instead.
A GFM table
Input
| Plan | Price | | --- | ----: | | Pro | $12 |
Output
A <table> with a header row and a right-aligned price column
The divider row makes it a table, and the colon on its right edge sets the alignment, emitted as a style attribute on the cells.
The line break toggle
Input
first line second line
Output
<p>first line<br>second line</p>
That is with the GitHub-style toggle on. With it off, the two lines join into one paragraph with a space, which is the CommonMark default.
Background and insight
Markdown started in 2004 as a Perl script and a syntax note by John Gruber, with feedback from Aaron Swartz. The goal was text that reads naturally in plain form and converts mechanically to HTML: asterisks for emphasis, hash marks for headings, indentation for code. The original spec left real questions open, such as how list items interact with blank lines, and for a decade every implementation answered them differently.
CommonMark, published in 2014 with John MacFarlane as lead author, closed those gaps with a precise specification and hundreds of conformance examples. GitHub then formalized its own long-standing extensions as GitHub Flavored Markdown, a strict superset of CommonMark that adds tables, strikethrough with tildes, task list items and automatic linking of bare URLs. That pair of documents is what most modern tooling, this converter included, actually implements.
One design decision surprises people: Markdown is not a sealed format. Raw HTML is legal inside it and passes through to the output untouched, which is how authors get features the syntax lacks, and also why Markdown from strangers should be sanitized before it is injected into a live page. The preview here is sandboxed for exactly that reason.
Common use cases
CMS and newsletter fields
Draft in Markdown, then paste finished HTML into an editor that accepts only markup.
README content on a website
Reuse docs written for a repository as HTML for a project page without rewriting them.
Checking how syntax renders
See exactly which tags a nested list or a blockquote produces before styling them with CSS.
Email templates
Produce simple, portable markup for transactional emails where hand-writing tags is error-prone.
Tips and limitations
- The output is a fragment: no <html>, <head> or <body>. The preview wraps it for display, but you add your own page shell when publishing.
- Asterisks need correct spacing to register: **bold** works, ** bold ** does not, because emphasis cannot start before a space.
- A heading needs a space after the hashes. #Title stays literal text; # Title becomes <h1>.
- Task list items ( - [x] done ) render as checkboxes that are disabled, since a static page has nothing to save the state to.
- Raw HTML in the input passes through unchanged. Sanitize converted Markdown from untrusted authors before putting it on a real page.
Sources and further reading
- CommonMark Spec, CommonMark. The precise Markdown specification this converter follows
- GitHub Flavored Markdown Spec, GitHub. Tables, strikethrough, task lists and autolinks as formal extensions
- Markdown, Daring Fireball. John Gruber's original project page from 2004
Frequently asked questions
Does this converter support GitHub tables, strikethrough and task lists?
Yes. It runs marked with GFM enabled, so pipe tables with a divider row, ~~strikethrough~~ and - [ ] task items all convert, alongside everything in CommonMark: headings, emphasis, lists, blockquotes, code blocks, links and images.
Why does a single newline in my Markdown not create a line break?
CommonMark treats a single newline inside a paragraph as a space, so lines reflow like prose. GitHub comments behave differently, which is what the line break toggle reproduces: with it on, every newline becomes a <br>. Two spaces at the end of a line also force a break in either mode.
Why does the preview refuse to run scripts?
The preview is an iframe with an empty sandbox attribute, which blocks scripts, forms and popups. Markdown may contain raw HTML, including <script>, so rendering it unsandboxed would execute whatever was pasted. You see the layout and styling of the output without executing anything.
Is the generated HTML a complete page?
No, it is a body fragment, which is what you want for pasting into a CMS, a template or an existing page. If you need a standalone file, wrap it in a doctype, <html>, <head> with a charset meta tag, and <body> yourself.
Can I mix raw HTML into the Markdown?
Yes. Markdown was designed to let HTML through, so a <kbd> tag or a <details> block in the input lands in the output as-is. The flip side is that converted text from untrusted sources needs sanitizing before you inject it into a page, because anything they wrote passes through too.
Why did my heading or bold text come out as literal characters?
Usually spacing. Hashes need a following space to make a heading, emphasis markers cannot be separated from the text they wrap, and four leading spaces turn a line into a code block. Paste the problem line alone into the input and the HTML box shows exactly how it is being read.
Is there an in-depth guide to the Markdown to HTML Converter?
Yes. “Unit Conversion Factors: Exact Definitions, Gallons and Temperature Offsets” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.