How this Markdown to HTML converter works
Markdown is a plain-text format where # makes a heading, **double asterisks** make bold text and a line starting with - becomes a bullet. It is how READMEs, documentation, static site generators and most note apps store writing. This Markdown to HTML converter turns that text into clean, semantic HTML as you type, and the reverse direction turns existing HTML back into Markdown, which is the fastest way to move old blog posts or CMS pages into a Markdown-based site.
Step by step
- Choose a direction: Markdown to HTML or HTML to Markdown. Switching moves the current output into the input, so you can round-trip a document to check it.
- Paste your text, type it, or open a
.mdor.htmlfile. - Check the rendered preview below the output. It updates live and follows the site theme.
- Copy the result, or download it. For HTML you can tick Full HTML page to get a complete document with a doctype, charset and viewport tag.
Supported Markdown syntax
The converter follows CommonMark for the core syntax and adds the GitHub Flavored Markdown extensions people rely on:
# Heading 1 Heading 2
## Heading 2 ---------
**bold** *italic* ~~strikethrough~~ `inline code`
[link](https://example.com "Title") 
<https://example.com> or just https://example.com
- bullet 1. numbered - [x] done
- nested item 2. second item - [ ] to do
> blockquote
| Left | Center | Right |
|:-----|:------:|------:|
| a | b | c |
```css
.btn { color: red; }
```
Fenced code blocks get a class="language-css" attribute, the convention that syntax highlighters such as Prism and highlight.js look for. Inline HTML is passed through untouched, a backslash escapes any punctuation character (\* stays a literal asterisk), and reference-style links ([text][ref] with [ref]: url on its own line) are resolved.
Converting HTML to Markdown
Paste a web page, a WordPress post or an email template and the converter walks the document tree, keeping the structure and dropping the rest. Headings, paragraphs, emphasis, links, images, nested and numbered lists, checkboxes, code, blockquotes and tables all come across. Scripts, styles, forms and layout-only wrappers like <div> and <span> are discarded, and table cell alignment is preserved in the delimiter row. Text that would accidentally become Markdown, such as a stray asterisk, is escaped.
Tips and common mistakes
- Leave a blank line before lists, tables and code fences. Without one, some parsers treat the list as part of the previous paragraph.
- Indent nested lists under the text, not the marker. Under
- itemthat means two spaces; under1. item, three. - Line breaks need two trailing spaces or a backslash. A single Enter just continues the paragraph. This catches out almost everyone once.
- Underscores inside words are safe.
snake_case_namestays as written; only underscores at word edges create emphasis. - Tidy the output. The HTML is compact by design. Run it through the HTML and CSS formatter to indent it, or the minifier to shrink it for production.
- Check edits between drafts by pasting two versions of a document into the text diff checker.
One security note: Markdown allows raw HTML, so never render Markdown from untrusted users on your own site without sanitizing it first. This page renders its preview in a sandboxed frame with scripts disabled, and links using javascript: are neutralized in the output.
Frequently asked questions
How do I convert Markdown to HTML?
Paste or type Markdown into the input box. The HTML appears instantly in the output box, with a rendered preview underneath. Copy it, or download it as an .html file, optionally wrapped in a complete page with a doctype and head.
Can I convert HTML back to Markdown?
Yes. Switch the direction to HTML to Markdown and paste your HTML. Headings, paragraphs, emphasis, links, images, nested lists, task lists, code blocks, blockquotes and tables are converted, while scripts, styles and layout wrappers are dropped.
Does it support GitHub Flavored Markdown?
It supports the GitHub extensions people use most: tables with column alignment, task lists, strikethrough, fenced code blocks with a language label, and bare URLs that turn into links automatically.
Is it safe to preview HTML from an unknown source?
Yes. The preview renders inside a sandboxed frame with scripts disabled, so pasted HTML cannot run JavaScript, submit forms or read anything on this page. The conversion itself also happens in your browser, so nothing is uploaded.
How do I add a line break in Markdown?
End the line with two spaces or a backslash, then press Enter. A single line break on its own is treated as a space inside the same paragraph, and a blank line starts a new paragraph.