Browser-based document converter · Markdown to HTML

Markdown to HTML Converter

Renders Markdown as clean HTML, as a complete styled page or as a body fragment ready to paste into a CMS or an email template.

Input

Markdown files (.md, .markdown, .txt), up to 25MB

Drop your Markdown file here or click to choose

.md, .markdown, .mdown, .txt

or paste

Files are read and converted on your device. Nothing is uploaded, and the result is yours to download or open in the Word editor.

Result

HTML file, ready to download or edit

Choose a file to see the HTML result here.

Markdown to HTML Converter

Operator: Abdulla Al Fahad. How tools are built and checked

Markdown is for writing; HTML is what browsers, content management systems and email tools actually consume. The Markdown to HTML Converter renders CommonMark and GitHub-flavoured Markdown as plain, readable HTML in one of two shapes. Complete HTML page produces a standalone file with a UTF-8 charset, a title, a viewport tag and a short embedded stylesheet, so it opens properly in any browser. Body content only produces just the markup, ready for the code view of a CMS, a help centre or an email template.

Rendered shows the page in a sandboxed frame, HTML code shows the markup, Copy puts the HTML on the clipboard and Download .html saves it. Paste Markdown into the box and press Convert text, drop a .md, .markdown or .txt file, or press Try a sample to load a short project plan with a nested list, a table, a quote and a link. A pasted document takes its title and file name from its first heading.

Key features

  • Renders CommonMark headings, paragraphs, emphasis, code, links, quotes, lists and thematic breaks, plus the GitHub extensions for tables, task lists, strikethrough and bare URLs.
  • Two outputs: a complete page with charset, title, viewport and an embedded stylesheet, or body markup only.
  • Rendered and HTML code previews, with Copy and Download .html.
  • Counts skipped image references and names a pasted document after its first heading.

How Markdown becomes HTML

The Markdown dialect is the one the Markdown to Word converter reads, and that page lists the syntax in detail: CommonMark blocks and inline marks plus GitHub pipe tables, task lists, strikethrough and bare URLs, with front matter removed and indented code deliberately ignored. What this page adds is the HTML each construct becomes. # and ## headings become h1 and h2, and ### and deeper all become h3. Paragraphs become p, with a br where a line ended in two spaces or a backslash. Lists become ul or ol with any nested list inside its parent li, quotes become blockquote, and a task box becomes a ☐ or ☑ character rather than a checkbox input. Pipe tables become table with th cells in the first row. A fenced block with several lines becomes pre and code, a single-line fenced block becomes a code element inside a p, and a thematic break becomes an empty paragraph rather than an hr.

Inline marks become em, strong, s and code; links become a elements only for http, https and mailto addresses; image references produce nothing beyond a count in the warning. Raw HTML is not passed through verbatim: b, i, u, s, code, mark, a, br and the common block tags are read and re-written in the clean output form, and attributes such as class and id are dropped.

The markup produced from Markdown syntax carries no classes, ids or inline styles; the only styles that can appear come from raw HTML in the source, such as a mark highlight. Complete HTML page wraps the body in a doctype, html lang="en", meta charset="utf-8", a viewport meta, the title and a style block: Arial at 11pt with a 1.6 line height in near-black (#111), a column at most 8.5 inches wide with a one-inch margin, h1 at 20pt, h2 at 15pt and h3 at 12.5pt, tables with 1px #9a9a9a borders and a light grey (#f2f2f2) header row, a blockquote with a 3px left border, and blue (#1155cc) links. Body content only is the same markup without the wrapper; table rows and list items sit on their own lines, each closing li on the line that follows.

How it works

Parsing is shared with the Markdown to Word converter, whose page walks through the block and inline scanners; the HTML writer is what differs. It serialises the blocks as h1 to h3, p, blockquote, ul and ol with nested lists inside li, table with th in the first row, pre and code for multi-line code, and strong, em, u, s, code and a for runs, linking only web and mail addresses.

In Complete HTML page mode the markup is placed in a document skeleton with the stylesheet; in Body content only mode it is returned as is. The result is shown in a sandboxed iframe or as a code listing and saved as a UTF-8 .html file.

Common use cases

  • A developer turns a README into a standalone HTML page for an internal portal that cannot render Markdown.
  • A marketing team drafts a newsletter in Markdown and pastes the body markup into an email tool.
  • A support writer converts articles drafted in Markdown into HTML for a help-centre editor's code view.
  • A product manager converts release notes from a chat assistant into HTML for a changelog page.

How to use this tool

  1. Press Try a sample to see both output modes at work, then paste your own Markdown and press Convert text (a dropped .md file converts immediately).
  2. Switch the Output select between Complete HTML page and Body content only; the result is rebuilt immediately.
  3. Review the Rendered preview for structure, then switch to HTML code to inspect the markup.
  4. Paste the copied markup into the CMS code view, or download the .html file and open it in a browser.

Example

Markdown input (pasted)

---
title: Release notes
---
# Release 3.1

The importer now reads **ISO 8601** dates and `.tsv` files.

## Fixes

- Dates before 1970 no longer shift by a day
- [x] Export keeps column order

| Area | Status |
| --- | --- |
| Importer | Done |

> Full details are in the [changelog](https://example.com/changelog).

HTML output, Body content only (the page title would be Release 3.1)

<h1>Release 3.1</h1>
<p>The importer now reads <strong>ISO 8601</strong> dates and <code>.tsv</code> files.</p>
<h2>Fixes</h2>
<ul>
  <li>Dates before 1970 no longer shift by a day
</li>
  <li>☑ Export keeps column order
</li>
</ul>
<table>
  <tr><th>Area</th><th>Status</th></tr>
  <tr><td>Importer</td><td>Done</td></tr>
</table>
<blockquote><p>Full details are in the <a href="https://example.com/changelog">changelog</a>.</p></blockquote>

Tips for best results

  • Start pasted Markdown with a # heading. It becomes the page title in the head and the download name, so a document that opens with # Release 3.1 saves as Release 3.1.html.
  • Use fenced code blocks with two or more lines when you need a pre block; a one-line fence is written as inline code.
  • Pick Body content only for a CMS, help centre or email tool, where the site's stylesheet should decide how headings look, and Complete HTML page for a file people will open on its own.
  • Switch to HTML code after converting to check the markup you are about to paste, then back to Rendered to confirm the structure.

Edge cases to watch

The html element always carries lang="en". For a page in another language, edit that attribute after downloading.

A title in YAML or TOML front matter is not used. The front matter block is removed entirely, and the title comes from the first heading or the file name.

Class and id attributes on raw HTML are stripped, so a <div class="warning"> in the source becomes a plain paragraph.

Numbered lists are written as ol without a start attribute, so a list that begins at 3 in the Markdown renders from 1.

Common errors and how to fix them

Paste some Markdown first.
The paste box was empty when Convert text was pressed. Paste your Markdown, or press Try a sample for a worked example.
No text was found in the pasted Markdown.
After removing front matter, link definitions and image references, nothing was left to render; a file that is only a ![cover](cover.png) line or only metadata converts to nothing.
No text was found in this Markdown file.
The uploaded file has no renderable content, or it is not a text file at all. Open it in a text editor to check, and save it as UTF-8 plain text.
This converter accepts Markdown files (.md, .markdown, .txt), up to 25MB. "draft.docx" has a different extension.
Only Markdown and plain-text extensions are accepted. A Word file belongs in the Word to Markdown converter; rename a Markdown file with an unusual extension to .md, or paste its contents.

Best practices

  • Keep one h1 per document, as the first line, and build the rest of the outline with ## and ###; the page title and structure both follow from it.
  • Prefer Body content only whenever the HTML will be placed inside another page; two stylesheets fighting over the same headings is the usual cause of odd spacing.
  • Check the rendered preview for ☐ and ☑ characters and for empty paragraphs where you expected rules, and adjust the source rather than the output.

What the embedded stylesheet gives you and how to replace it

The style block in a complete page is deliberately small: about ten rules that make an unstyled document pleasant to read, with the text column capped at 8.5 inches and centred so that it mimics a printed page on a wide monitor and collapses to full width on a phone. Nothing in the markup depends on these rules, because there are no classes to target: the stylesheet addresses elements only.

That makes the page easy to restyle: replace the contents of the style tag with your own rules, or delete the block and link an external stylesheet, and the document still renders because the structure is plain h1, p, ul and table. If the output is going into a site that already has a design, choose Body content only instead; the fragment inherits the host page's styles, and the only inline style you may need to remove is the background colour on a mark element from raw HTML.

Frequently asked questions

Why is my code block a paragraph?

A fenced block with one line is written as a code element inside a p, because only multi-line code becomes pre. Put the code on two lines if you need a block.

Can I keep the classes from HTML written inside my Markdown?

No. Inline and block HTML is parsed and rewritten as semantic markup, and attributes other than href are discarded; add classes afterwards in your CMS.

Why is there an empty paragraph where my horizontal rule was?

A line of three or more *, - or _ characters becomes an empty p containing a br, because the shared document model has no rule element; replace it with an hr after downloading.