Skip to content
ToolBoxGenie

Markdown to HTML Converter

Text Tools · Added 18 August 2026

Paste Markdown and get the HTML it produces, with a rendered preview beside it — or switch direction and turn a page of HTML back into readable Markdown. Both conversions happen in your browser, so a draft, an internal wiki page or a client README never leaves your machine.

Direction

Converted as you type. Nothing is sent to a server.

How to use the markdown to html converter

  1. 1Choose the direction: Markdown to HTML, or HTML to Markdown.
  2. 2Paste or type into the input box — the conversion updates as you type.
  3. 3Adjust the options: line-break handling and heading ids one way, bullet style and heading style the other.
  4. 4Read the rendered preview to check the result before you use it.
  5. 5Copy the output, or download it as a .html or .md file.

Examples

A README section

Input
## Install\n\nRun `npm install`, then see the [docs](https://example.com).
Result
<h2 id="install">Install</h2>\n<p>Run <code>npm install</code>, then see the <a href="https://example.com">docs</a>.</p>

A table

Input
| Setting | Default |\n| --- | ---: |\n| timeout | 30s |
Result
A full <table> with <thead>, <tbody> and right-aligned cells from the colon in the delimiter row

HTML back to Markdown

Input
<h1>Notes</h1><ul><li>First</li><li>Second</li></ul>
Result
# Notes\n\n- First\n- Second

Divs, classes and inline styles are unwrapped — the text survives, the presentation does not.

About the markdown to html converter

Why Markdown won

Markdown was written in 2004 with one stated goal: a document should be readable as plain text. That constraint is why it beat every richer alternative for READMEs, documentation, issue trackers and note-taking apps. A Markdown file is useful even to someone with no Markdown renderer, which is not true of HTML, and it survives being pasted into an email.

The cost of that readability is that Markdown cannot express everything HTML can, and the conversion is one-way lossless at best. Going from Markdown to HTML always works; coming back means deciding what to throw away.

When you need the HTML

The usual reasons are a CMS that only accepts HTML, an email template, a legacy system, or a static page you are assembling by hand. In each case what you want is clean, semantic markup — headings that are headings, lists that are lists — rather than the div soup a WYSIWYG editor produces.

The output here is deliberately plain: no wrapper divs, no classes, no inline styles. That makes it easy to style with your own CSS and easy to diff, and it means pasting it into an existing page will not fight the page's own stylesheet.

And when you need it back

Converting HTML to Markdown is usually part of a migration: moving a blog off a hosted platform, pulling documentation out of a wiki, or turning a web page into notes. The goal is not a perfect reproduction but a clean, editable text file that keeps the structure and loses the presentation.

Expect to do some cleanup afterwards, particularly around nested tables, figures with captions, and anything that was laid out with divs rather than described semantically. Those are the constructs Markdown has no vocabulary for, and no converter can invent one.

Frequently asked questions

Which flavour of Markdown does it support?
CommonMark's core syntax — headings both ATX and Setext, emphasis, links and images, ordered and unordered lists with nesting, blockquotes, fenced and indented code blocks, and horizontal rules — plus the two GitHub extensions people rely on most: tables and task lists, along with strikethrough. Reference-style links, footnotes and raw HTML blocks are not supported, and the page says so rather than converting them incorrectly.
Why is the HTML I wrote inside my Markdown showing as text?
It is escaped on purpose. The preview renders whatever the converter produces, so letting arbitrary tags through would mean a pasted document could run scripts in your browser. Every angle bracket in the source is escaped before parsing, and the only tags in the output are ones the converter generated itself. A <script> in your input therefore appears as visible text — the safe direction to be wrong in.
What happens to HTML that has no Markdown equivalent?
It is unwrapped rather than dropped: a div, a span, a class or an inline style disappears and the text inside it survives. Script, style, head and SVG contents are discarded entirely, since converting them would produce nonsense. That means the round trip is lossy in one direction by design — Markdown is a smaller language than HTML, and pretending otherwise produces a file full of raw tags.
Should a single line break become a <br>?
By default no, which is what CommonMark specifies: a single newline inside a paragraph is treated as a space, and only a blank line starts a new paragraph. Some tools — notably GitHub comments and many chat apps — break on every newline instead. The option is there because which behaviour is right depends entirely on where the output is going.
Are the heading ids safe to link to?
They follow the common convention — lowercased, punctuation removed, spaces turned into hyphens — which is what GitHub and most static site generators produce, so anchor links usually match. They are not guaranteed identical to any particular generator's algorithm, so if you are linking into a specific platform's rendering, check one anchor before relying on all of them.