What is Markdown to HTML conversion?
Markdown is a lightweight plain-text format that uses minimal punctuation (# for headings, * for emphasis, - for list items) to encode structured prose. GitHub Flavored Markdown (GFM) extends the original CommonMark spec with tables, strikethrough, task lists, and autolinks. HTML is the rendered form the browser displays. Converting Markdown to HTML lets you author in the lightweight syntax and ship to a rendered surface (a README, a static-site page, an email body) without hand-writing the tags.
Which GitHub Flavored Markdown features are supported?
The bundled marked@12.0.2 parser supports the full GFM superset: ATX-style headings # through ######, ordered and unordered lists with nesting, bold **text** and italic *text*, strikethrough ~~text~~, inline links [text](url) and inline images , fenced code blocks with optional language tags (```js), inline code spans `code`, pipe tables with header rows, GFM task lists - [ ] / - [x], blockquotes >, horizontal rules ---, and autolinks. Each one renders in the preview pane the same way GitHub renders it.
How does Markdown to HTML conversion work?
Every conversion runs locally in your browser using two bundled libraries — no CDN, no fetch, no telemetry. The high-level steps are:
- Parse:
marked.parse(source)reads your Markdown and produces an HTML string. The parser runs in GFM mode, so tables, task lists, strikethrough, and autolinks are all recognised. - Sanitize: the HTML output is run through
DOMPurify.sanitize(html, { USE_PROFILES: { html: true } })before being assigned toinnerHTML. DOMPurify is the same XSS sanitizer used by Mozilla MDN, Atlassian, and Microsoft 365 — it parses the HTML, walks the DOM, and removes<script>elements, everyon*event handler attribute, andjavascript:URI schemes. - Render: the sanitized HTML is written to the preview pane via
innerHTML, and the raw HTML is surfaced in the second pane via a read-only<textarea>so you can copy the markup. Live mode debounces input by 150 ms so the preview updates as you type without thrashing the parser.
Why convert Markdown to HTML with this tool?
- Privacy: every parse, sanitize, and render pass happens in your browser. Your Markdown (unreleased blog posts, internal documentation drafts, confidential README content) never reaches our servers.
- XSS-safe by default: the rendered preview pane runs every HTML string through DOMPurify before
innerHTML, so a stray<script>tag oronerror=handler inside raw HTML in your Markdown produces an inert preview. The raw pane shows the unsanitized output for inspection, sitting inside a<textarea>viavalue— never executed. - GFM-complete: tables, strikethrough, task lists, and autolinks all render the way GitHub renders them. A Markdown pipe-table becomes an HTML
<table>with<thead>and<tbody>— no dropped rows, no flattened structure.
What are common applications of Markdown to HTML conversion?
Turning Markdown into HTML shows up across documentation, static-site work, and email authoring:
- GitHub README authoring: drafting a project README locally as Markdown and previewing the rendered HTML before pushing. The preview matches GitHub's GFM renderer for tables, task lists, and fenced code.
- Static-site content: pasting a Markdown post and grabbing the HTML for a CMS field or a templating engine that expects markup rather than Markdown source.
- Email templates: writing a transactional-email body as Markdown and converting to HTML for the email service provider's templating engine. The output is plain semantic HTML — no inline styles, no email-client quirks layered in.
What does a Markdown to HTML example look like?
Pasting # Title\n\n- item 1\n- item 2\n\n[link](https://example.com) produces a preview pane containing <h1>Title</h1>, a two-item unordered list, and an <a href="https://example.com">link</a>. The raw pane shows the exact HTML string so you can copy it straight into a template. A pipe table with a |---|---| alignment row becomes a full <table> with <thead> and <tbody> — confirming GFM tables render the way GitHub renders them.
Does this Markdown to HTML converter run entirely in my browser?
Yes. Every parse, sanitize, and render pass runs locally as JavaScript inside your browser tab. The bundled libraries — marked@12.0.2 and DOMPurify@3.1.7 — ship from the same origin as the page, so there is no CDN dependency, no fetch, no XMLHttpRequest, no navigator.sendBeacon on the input. The tool also works offline once the page has loaded, because it is a static HTML/CSS/JS bundle with the vendor libraries copied alongside it. Unreleased posts, internal docs, and confidential READMEs stay on your device.
Is the rendered preview pane XSS-safe?
Yes. Every HTML string assigned to innerHTML passes through DOMPurify.sanitize(html, { USE_PROFILES: { html: true } }) first. DOMPurify is the open-source XSS sanitizer maintained by Cure53; it is the same library used by Mozilla MDN, Atlassian, and Microsoft 365 to harden user-supplied HTML. The default html profile removes <script> elements, every on* event-handler attribute (onerror, onclick, etc.), javascript: URI schemes inside href / src, and known-dangerous CSS expressions. If your Markdown embeds raw <img src=x onerror=alert(1)>, the preview where document.querySelector('#output-preview img[onerror]') returns null and no alert fires.
Are GFM tables supported?
Yes. The Markdown → HTML direction handles pipe tables natively via marked's GFM mode — a header row separated by a |---|---| alignment row, followed by data rows, produces a <table> with <thead> + <tbody>. Strikethrough (~~text~~ → <del>text</del>) and task lists (- [ ] / - [x] → <input type="checkbox">) render the same way GitHub renders them.
Will my Markdown convert losslessly?
For the canonical GFM feature set (headings h1 through h6, ordered and unordered lists with nesting, bold / italic / strikethrough, inline links, inline images, fenced code blocks with language tags, inline code spans, pipe tables, task lists, blockquotes, horizontal rules, and autolinks) the HTML output is stable and matches GitHub's renderer. A couple of behaviours worth knowing: raw inline HTML inside your Markdown (e.g. <sub>text</sub>) passes through to the output unchanged, and CommonMark setext headings (=== underlines) and ATX headings (# Title) both produce the same <h1>. These are documented marked behaviours, not bugs. If you need the reverse, pulling rendered HTML back into Markdown, use the HTML to Markdown tool.
Is syntax highlighting in fenced code blocks supported?
Not in v1. Fenced code blocks render with monospaced font and a subtle background but without per-language token highlighting. Adding syntax highlighting would require bundling Prism or highlight.js, each of which adds 15–40 KB plus a per-language grammar file and a theme matrix that would need alignment with the Workshop Terminal palette. For now, the renderer focuses on correctness and XSS-safety; if there is user demand for inline highlighting, an opt-in toggle is a tractable follow-up.
This Markdown to HTML Converter ships with marked@12.0.2 and DOMPurify@3.1.7 bundled at the same origin, supports the full GFM feature set, and sanitizes every rendered HTML string before it touches the DOM. No upload, no CDN, no telemetry — every byte stays in your browser.