Skip to content

Markdown to HTML Converter

Turn Markdown into ready-to-paste HTML, as a fragment or a complete document, with a safe preview beside it.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Markdown to HTML Converter?

This tool compiles GitHub-flavoured Markdown (headings, lists, tables, task lists, fenced code, links, images) into HTML and shows you the source code, not just the rendering. The result can be pasted into a CMS, an email template, a static page or a component.

By default the HTML is sanitized: <script>, event handlers such as onclick, and javascript: or data: links are removed and external links receive rel="noopener noreferrer". You can also indent the output and wrap it in a full <!doctype html> page with your own title.

How does it work?

  1. Paste your Markdown in the input box.
  2. Keep "Sanitize the HTML" on for untrusted content; turn it off only if you fully trust the source.
  3. Choose pretty-printing, GFM line breaks, and whether to wrap the result in a full HTML document with a title.
  4. Copy the HTML source or download it as document.html; the sanitized preview is shown underneath.

Common use cases

  • Converting a README or documentation page to HTML for a static site.
  • Producing the HTML body of a newsletter or email from Markdown notes.
  • Generating a standalone HTML file from meeting notes to share as an attachment.
  • Checking exactly which HTML tags a Markdown construct produces.

Examples

Try this input in the tool above:

# Release notes

A short **Markdown** demo with *emphasis*, ~~strikethrough~~ and `inline code`.

## Checklist

- [x] Write the draft
- [x] Add a table and a code block
- [ ] Review the [style guide](https://example.com/style-guide)
- [ ] Publish

## Steps

1. Install the dependencies
2. Run the build
3. Check the output

## Comparison

| Format   | Readable | Portable |
|----------|:--------:|---------:|
| Markdown | yes      | high     |
| HTML     | partly   | high     |
| PDF      | yes      | medium   |

```js
const greet = (name) => `Hello, ${name}!`;
console.log(greet("world"));
```

> Tip: a blank line starts a new paragraph.

---

See the [documentation](https://example.com/docs) fo
…

Privacy

Markdown to HTML Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

With sanitizing turned off the HTML source is unfiltered and may contain any raw HTML found in your Markdown. The preview always stays sanitized. Styling is not included: the output has no CSS.

Frequently asked questions

What does the sanitize option change?

It runs the HTML through DOMPurify with a strict allow-list, removing scripts, inline event handlers, styles and dangerous URL schemes. Off, you get the raw converter output.

Can I get a complete web page instead of a fragment?

Yes. Enable "Full HTML document" to add <!doctype html>, <html lang>, a charset and viewport meta tag, your title and the <body> wrapper.

Is Markdown inside HTML blocks converted?

Following the CommonMark rules, Markdown inside a raw HTML block is left as-is. Leave a blank line after the opening tag if you need it processed.

More tools in Markdown & Diagrams →