Skip to content

Markdown to HTML Converter & Preview

Convert Markdown to HTML with a live preview, copy the markup, or save it as a PDF — raw HTML is escaped, so a pasted document cannot run anything.

Markdown

76 words · 738 B

Preview

1 min read

Release notes

A short Markdown to HTML example covering the constructs this converter supports. Everything below is rendered in your browser.

What changed

  • Faster cold starts on eu-west-1
  • Task lists work:

    • escape raw HTML
    • add footnotes
  • Nested lists, too
  1. First
  2. Second
  3. Third

A table

RegionLatencyStatus
eu-west-142msok
us-east-188msok

Code

export function greet(name: string): string {
  return `Hello, ${name}`;
}

Blockquotes work, and so does strikethrough, emphasis and a link.


Raw HTML such as <b>this</b> is escaped and shown as text rather than rendered — see the FAQ for why.

Options

Words
76
Characters
738
Headings
4
Links
1
Images
0
Code blocks
1
Tables
1
Reading time
1 min
  • 2 raw HTML tags were escaped and shown as text. This renderer never passes HTML through — see the FAQ for why.

Converted in your browser — nothing is uploaded. Raw HTML in the source is escaped and shown as text rather than rendered, so a document you were sent cannot run anything on this page. Save as PDF opens your browser's print dialog with the preview alone; choose “Save as PDF” as the destination.

About the Markdown to HTML Converter & Preview

A Markdown to HTML converter with a live preview, running entirely in your browser. Type on the left, see the rendered result on the right, and switch to the HTML tab to copy the markup. It covers the GitHub-Flavoured constructs people actually write: headings, lists, task lists, tables with alignment, fenced code, blockquotes, strikethrough, reference links and autolinks.

Raw HTML in the source is escaped and shown as text rather than rendered. That is a deliberate difference from most Markdown converters, and it is what makes this markdown preview safe to point at a document somebody sent you: a <script> tag in the input becomes visible text, not running code. The count of escaped tags is reported rather than hidden, so you always know it happened.

For markdown to PDF, the Save as PDF button opens your browser's print dialog with the preview alone — no page chrome, no editor — and you choose Save as PDF as the destination. It is honest about what it does: this is the browser's own PDF engine, not a converter pretending to write the file itself, and the result respects page breaks around headings, tables and code blocks.

Every URL passes a scheme check before it reaches an href or a src, so javascript: and data: links are rejected while the link text is kept. Nothing is uploaded, and after the page loads it works offline.

  • Live preview and a copyable HTML output, from one editor
  • GitHub-Flavoured tables with per-column alignment, task lists and strikethrough
  • Fenced code blocks with a language class, plus indented code blocks
  • Reference links, collapsed and shortcut references, autolinks and optional bare-URL linkification
  • Heading ids and a clickable outline, with duplicate headings given distinct ids
  • Word count, character count, and reading time at 225 words per minute
  • Save as PDF through the browser's print dialog, with a print stylesheet that prints the document alone
  • Raw HTML escaped and counted; unsafe URL schemes rejected and reported

How to use it

  1. Type or paste Markdown into the left pane. The preview updates as you type.
  2. Switch to the HTML tab to read or copy the generated markup — it is the same string the preview renders.
  3. Use the outline to jump between headings on a long document.
  4. Toggle the options if you want bare URLs left as text, heading ids omitted, or task list syntax left literal.
  5. For a PDF, click Save as PDF and pick Save as PDF as the destination in your browser's print dialog.

Real-world use cases

Technical writers & docs engineers

Check how a README, guide or release note actually renders before committing it — tables, task lists and nested lists are exactly the constructs that are hardest to get right by eye in a raw text editor.

Backend & API developers

Preview a changelog entry or an OpenAPI description field written in Markdown, and copy the generated HTML straight into a place that expects markup rather than source.

Open source maintainers

Paste a contributor's PR description or an issue body to read it rendered without opening it on GitHub — and because raw HTML is escaped rather than executed, this is safe to do with content from someone you don't yet trust.

DevOps & SRE

Render a runbook or incident postmortem written in Markdown to check formatting — headings, code blocks and tables in particular — before it goes into a wiki or gets paged out from during an incident.

Anyone converting Markdown to PDF

Turn a Markdown resume, proposal or one-page doc into a PDF via Save as PDF, without installing a converter or reaching for a document editor just to produce a static handout.

Examples

A table with alignment

Input
| Region | Latency | Status |
| --- | ---: | :---: |
| eu-west-1 | 42ms | ok |
Output
<table>
<thead>
<tr><th>Region</th><th style="text-align:right">Latency</th>
<th style="text-align:center">Status</th></tr>
</thead>
...

Colons in the delimiter row set the alignment: `---:` is right, `:---:` is centre. A row with fewer cells than the header is padded rather than breaking the table.

Task lists

Input
- [x] escape raw HTML
- [ ] add footnotes
Output
<li class="task-list-item">
  <input type="checkbox" disabled checked /> escape raw HTML
</li>

The checkboxes are disabled, because ticking one in a preview would not change your source file — an editable checkbox that silently does nothing is worse than a static one.

Raw HTML is escaped

Input
Text with <b>bold</b> and <script>alert(1)</script>
Output
<p>Text with &lt;b&gt;bold&lt;/b&gt; and
&lt;script&gt;alert(1)&lt;/script&gt;</p>

2 raw HTML tags were escaped and shown as text.

CommonMark says to pass HTML through. This converter does not, and says so — see the FAQ.

An unsafe link keeps its text

Input
[click me](javascript:alert(1))
Output
<p>click me</p>

1 URL was rejected because of an unsafe scheme.
The link text is kept; the link is not.

Escaping the markup is not enough on its own: a javascript: href executes on click regardless. The check decodes HTML entities first, because a browser decodes them in an attribute before following the link.

Common errors

MessageCauseFix
My HTML is showing as text instead of renderingIntentional. This converter escapes raw HTML rather than passing it through.There is no option to disable it, because the escaping is what makes the preview safe. If you need HTML passed through, use a converter with a sanitiser you have configured deliberately — and read what it allows before you trust it.
A list is not nestingThe nested items are not indented far enough. A nested list must be indented to at least the position where the parent item's text begins.Use two spaces for a `-` bullet and three for `1.`, aligning with the parent's content. Tabs are not treated as indentation here.
My table is not rendering as a tableThe delimiter row is missing or malformed. A table needs a header row followed immediately by a row of dashes.Add `| --- | --- |` under the header, with one cell per column. Alignment colons go on that row, not the header.
Underscores in a variable name turned into italicsThey did not — intra-word underscores are deliberately not emphasis, so `some_variable_name` survives intact.Nothing to fix. If you genuinely want emphasis inside a word, use asterisks: `un*frigging*believable`.
A single line break did not become a new lineMarkdown joins soft-wrapped lines into one paragraph, which is the specified behaviour and usually what you want.End the line with two spaces, or with a backslash, for a hard break. Use a blank line for a new paragraph.
Save as PDF printed the whole pageThe print stylesheet did not apply — usually an older browser, or printing from a keyboard shortcut before the page finished loading.Use the Save as PDF button rather than the browser's print shortcut, and reload if the page was still loading. The rule hides everything except the preview.

Frequently asked questions

Is my document uploaded anywhere?

No. Parsing and rendering both happen in your browser, so an unpublished draft or an internal document never leaves your machine. Disconnect from the network and the page keeps working — which is the only real demonstration of a claim like this.

Why is raw HTML escaped instead of rendered?

Because the preview renders this tool's output directly into the page, so anything passed through would execute here. Markdown is frequently something you were sent rather than something you wrote, and a preview that runs a <script> tag out of a pasted README is a vulnerability rather than a feature. The alternative — passing HTML through a sanitiser allowlist — is a defensible design and a much larger surface to get right; escaping is provably safe, and the tool tells you when it happened rather than altering your document silently.

How does Markdown to PDF work here?

Through your browser's own print-to-PDF, not a PDF writer of ours. The button calls the print dialog with a stylesheet that hides everything except the rendered document and adds sensible page breaks around headings, tables and code blocks; you choose Save as PDF as the destination. The result uses your system fonts and your chosen paper size, and it is a real PDF — but it is the browser producing it, and saying otherwise would be a claim the tool cannot back.

Which flavour of Markdown is this?

CommonMark with the widely-used GitHub extensions — tables, task lists, strikethrough and autolinks. Not supported: footnotes, definition lists, math, inline HTML, and CommonMark's full delimiter-run rules for adjacent emphasis, where `***x***` here produces strong wrapping em rather than the other order. Semantically identical, structurally not, and worth knowing if you are diffing output against another renderer.

Is the HTML output safe to publish?

It is safe from the input, which is the hard part: every character is escaped, and every URL is scheme-checked with entities decoded first. What it does not include is styling — the markup carries no classes beyond a language class on code blocks and a task-list class on checkbox items, so you style it yourself. Check it against your own content security policy before publishing, as you would with any generated markup.

Can I use it on a very long document?

Yes. Parsing is linear in the length of the document and re-renders are deferred while you type, so a long README stays responsive. There is no size cap, and the preview scrolls rather than growing the page.

Why are heading ids added, and can I turn them off?

So the outline can link to sections, and so the generated HTML has anchors you can link to from elsewhere — the same slugs GitHub generates. Duplicate headings get a numeric suffix rather than colliding, which is what makes the anchors reliable in a long document. Turn the option off if you generate ids yourself downstream.

Does it support GitHub-specific extensions like @mentions or issue links?

No. @mentions, #123 issue links, and emoji shortcodes like :tada: are features of GitHub's own rendering layer, not part of the Markdown or GFM specification — they depend on a repository context this converter has no concept of. Standard GFM syntax (tables, task lists, strikethrough, autolinks) is fully supported; anything that only makes sense inside GitHub's UI is rendered as literal text.

Last updated