Markdown to HTML Converter
The Markdown to HTML Converter turns Markdown into clean HTML in your browser — headings, tables, task lists, footnotes, and code blocks, with a live preview and the raw HTML source side by side, sanitized by construction so nothing you paste can execute.
How to Use
- 1
Paste or type your Markdown on the left — or upload a .md file, or load the sample to see every supported feature at once. Conversion runs live as you type.
- 2
Switch between the Preview tab (how the HTML renders) and the HTML source tab (the exact markup produced) — both update with every keystroke.
- 3
Check the table, task list, code block, blockquote, and footnote in the sample: if your syntax looks like the cheat-sheet at the bottom of the page, it renders.
- 4
Copy the HTML for pasting into a CMS, a docs page, or an email template — or download it as a standalone .html file with basic styling included.
- 5
Your draft autosaves to localStorage on this device only, so you can close the tab and come back to it. Clear wipes the draft.
- 6
Test the sanitization yourself: paste a <script> tag or a javascript: link into the Markdown and watch it appear in the preview as harmless text, never executed.
Frequently Asked Questions
What is Markdown?
What is GitHub Flavored Markdown (GFM)?
Is my draft uploaded anywhere?
Can Markdown inject scripts into the preview?
Why does my table not render?
Markdown vs HTML — when should I use each?
How do I convert a README to HTML for a docs page?
What happens to raw HTML in my Markdown?
Does it support footnotes and task lists?
What is not supported?
Generative Answer & AI Documentation
What is the Markdown to HTML Converter?
Markdown is a plain-text writing format: # for headings, **bold** and *italic*, - for lists, [text](url) for links, and ``` for code blocks. It is readable as-is, and a converter turns it into HTML for publishing — the format of README files, documentation, blog drafts, and wikis. This tool converts with a hand-written parser (no dependency): it reads the document block by block — headings, paragraphs, fenced code blocks, lists, blockquotes, tables, horizontal rules — and renders inline markup inside them (bold, italic, strikethrough, links, images, inline code, autolinks, footnote references). The dialect is CommonMark plus GitHub Flavored Markdown: pipe tables with alignment, task lists, strikethrough, and footnotes. The output is an HTML fragment shown in two tabs — a rendered preview and the raw source — with copy and download as a standalone .html file.
Why use Markdown to HTML Converter offline?
Markdown is how most technical writing starts, and HTML is how it gets published — a README becomes a docs page, a blog draft becomes a CMS post, a note becomes an email. The conversion itself is trivial in principle and easy to get wrong in practice: most online converters are thin wrappers around a library that either drops your tables, mangles your code blocks, or — worse — passes raw HTML straight through into the preview, so a pasted document can run a script in your tab. A converter that is honest about its exact subset and safe by construction is worth more than one that claims full CommonMark and silently drops half your syntax. Doing it client-side matters too: people convert unpublished drafts, private notes, and internal docs, and that text should never pass through a server. The draft autosaves to localStorage on the device, so the text never leaves your machine at all.
When should you use this tool?
Use it whenever Markdown needs to become a web page: turning a README.md into HTML for a docs site, converting a blog draft for a CMS that takes HTML, preparing a Markdown note for an email template, or previewing a document before committing it to GitHub. Also use it to check a document renders the way you expect — the preview tab shows tables, task lists, and footnotes exactly as a reader will see them, which catches the missing separator row or the broken footnote before the document goes public. And use it as a safety check: paste a document you received from someone else and confirm nothing in it executes — the sanitization note on the page explains what to look for.
Key Benefits
- Full GFM where it counts: tables with alignment, task lists, strikethrough, footnotes, and autolinks — the features basic converters drop.
- Sanitized by construction: every character is HTML-escaped before any markup is generated, so a <script> tag or a javascript: link in your Markdown can never execute in the preview.
- Live split view: Markdown on the left, rendered preview and raw HTML source on the right, both updating as you type.
- Nothing ever uploads: a hand-written parser runs in your browser, and drafts autosave to localStorage on this device only.
- Honest subset: the page lists exactly what the parser supports and what it does not — no syntax is silently dropped without a note.
Common Use Cases
- Converting a README.md into HTML for a docs page, with its tables, code blocks, and task lists intact.
- Turning a blog draft written in Markdown into HTML for a CMS that accepts pasted markup.
- Previewing a GitHub issue or wiki page before posting it, to catch a table that would not render.
- Preparing a Markdown note as an HTML email, by copying the HTML source into the template.
- Checking a document received from someone else for executable content, by watching the preview render raw HTML as harmless text.
Developer Notes & Best Practices
The parser is hand-written in markdownParser.ts and deliberately small: a line-based block pass (headings, fenced code, blockquotes, tables, lists, paragraphs) plus an inline pass (code spans, images, links, autolinks, footnote refs, bold/italic, strikethrough). The sanitization model is worth understanding, because it is the differentiator: the inline pass HTML-escapes the entire source first, and only then applies replacements that emit allowlisted tags. There is no allowlist filter running after the fact, because there is nothing to filter — raw HTML never becomes an element, it becomes escaped text. Link and image URLs go through isSafeUrl, which allows http:, https:, mailto:, and relative URLs and rejects javascript:, data:, and vbscript: schemes by rendering the link as plain text. The parser is a pure function of the input string, so it is unit-tested in Node (37 assertions covering every construct and the XSS cases: <script>, onerror, javascript:, and data: URLs). The documented gaps are real and stated on the page: no raw-HTML passthrough (by design), no reference-style links, no Setext headings, lists nested more than one level are flattened, no definition lists, no LaTeX math, and fenced code blocks carry a language class but no syntax highlighting. The standalone .html download wraps the fragment in a minimal document with a small stylesheet for readable rendering. Verification tip: paste <script>alert(1)</script> into the editor — the preview shows the literal text, and the HTML source tab shows it escaped as <script>.
Markdown syntax — what this page understands
| Syntax | Produces | Notes |
|---|---|---|
| # … ###### | Headings h1–h6 | ATX style only; Setext (=== underlines) not supported |
| **bold**, *italic* | <strong>, <em> | __bold__ and _italic_ also work |
| ~~strikethrough~~ | <del> | GFM |
| [text](url) | Link <a href> | http/https/mailto/relative only; javascript: rendered as text |
|  | Image <img> | Same URL rules as links |
| `code` | Inline <code> | Content inside code spans is never parsed as markup |
| ```lang … ``` | Fenced code block | Language becomes a class; no syntax highlighting |
| - item / 1. item | Lists <ul> / <ol> | One nesting level; deeper nesting is flattened |
| - [ ] / - [x] | Task list checkboxes | GFM; rendered as disabled checkboxes |
| > quote | Blockquote | Consecutive > lines group into one quote |
| | a | b | + | --- | | Table | Separator row required; :--- / ---: / :---: set alignment |
| [^1] + [^1]: note | Footnotes | Definitions collected at the end; numbered by first reference |
| <https://…> | Autolink | Only http(s) URLs |
| Raw HTML | Escaped text | By design — never rendered, never executed |
- Write the table separator row first: a header row without | --- | underneath is just a paragraph with pipes in it, and the most common rendering failure is a missing or misplaced separator.
- Keep one blank line between blocks: a list directly under a paragraph without a blank line can merge into the paragraph in some parsers, and blank lines make the source readable anyway.
- Put footnote definitions at the end of the document as their own paragraph, one per line, in the form [^1]: text — definitions buried inside a paragraph are not recognised.
- Preview before publishing: check the preview tab for tables, task lists, and code blocks, and check the HTML source tab when pasting into a CMS, so you know exactly what markup you are shipping.
Common Mistakes
- Forgetting the table separator row — a header row alone is not a table, and the page will show it as a paragraph with pipe characters in it.
- Writing a link with a space in the URL — [text](my file.md) breaks at the space; use %20 or a hyphenated file name.
- Putting the footnote definition inside a paragraph instead of on its own line — definitions must be their own paragraph to be collected.
- Assuming raw HTML will render — it is escaped by design, so an embedded <div> shows as text; add the element to the converted HTML after copying it out.
Limitations
The parser implements CommonMark plus the GFM features listed on the page — it is not a full CommonMark engine, and the gaps are stated honestly: raw HTML in the source is escaped and shown as text, never rendered; reference-style links ([text][ref]) are not resolved; Setext headings (underlined with === or ---) are not recognised; lists nested more than one level are flattened into siblings; definition lists and LaTeX math ($...$) are not supported and render as plain text; fenced code blocks carry a language class (language-js) but no syntax highlighting. Very long documents (tens of thousands of lines) re-parse on every keystroke in the browser tab, so editing can lag on huge files — for those, paste in sections. The autosaved draft lives in localStorage on this device only: it does not sync between devices, and clearing site data deletes it.
Structured Input/Output Example
# Project README ## Install Run `npm install` and start the server. | Option | Default | | ------ | ------: | | Port | 3000 | - [x] Write the docs - [ ] Ship the release See the [guide](https://example.com/guide) for details.[^1] [^1]: The guide covers deployment.
<h1>Project README</h1> <h2>Install</h2> <p>Run <code>npm install</code> and start the server.</p> <table><thead><tr><th>Option</th><th style="text-align:right">Default</th></tr></thead><tbody><tr><td>Port</td><td style="text-align:right">3000</td></tr></tbody></table> <ul><li class="task-list-item"><input type="checkbox" disabled checked> Write the docs</li><li class="task-list-item"><input type="checkbox" disabled> Ship the release</li></ul> <p>See the <a href="https://example.com/guide">guide</a> for details.<sup id="fnref-1"><a href="#fn-1">1</a></sup></p> <section class="footnotes"><hr><ol><li id="fn-1">The guide covers deployment. <a href="#fnref-1">↩</a></li></ol></section>
Related Tools
HTML to JSX
Convert HTML snippets into React-ready JSX: class → className, inline styles → objects, void tags self-closed. Free, offline, private.
JSX to HTML
Convert JSX snippets to plain static HTML. Free offline tool for emails, CMS embeds & static pages. className → class handled automatically.
HTML Formatter
HTML formatter: turn minified or messy HTML into clean, indented markup. Nested tags aligned, attribute spacing normalized — view-source, readable.
JSON Formatter
JSON formatter: turn minified or messy JSON into readable, indented output. 2 spaces, 4 spaces, or tabs — paste, click Format, copy or download.