Markdown to HTML Converter
Markdown to HTML Converter turns Markdown into an HTML fragment on the site's server using the league/commonmark library. Choose GitHub Flavored Markdown for tables, strikethrough and task lists, or strict CommonMark. Keep Sanitize on to filter the result through HTML Purifier and see a safe live preview. Copy the markup or download converted-markdown.html; input is limited to 200,000 characters.
Use :साधन
Preview
Read सामग्री
From Markdown source to HTML markup
The Markdown to HTML Converter takes Markdown you paste in and returns the HTML a browser understands: <h2> for ##, <ul><li> for dash lists, <a href> for links, <pre><code> for fenced code and so on. You can choose between two Markdown dialects, decide whether the HTML is passed through a sanitiser, look at a live preview, and then copy the markup or download it as converted-markdown.html.
It is useful whenever a destination accepts HTML but not Markdown: a CMS field, an email template, a static page, a forum that takes HTML, or a documentation system that wants pre-rendered markup.
What powers the conversion
Conversion happens on the site's server. When you press Convert, the page sends your Markdown, the dialect you picked and the sanitiser setting to a PHP endpoint. The server converts the text with the league/commonmark library and, when sanitising is on, cleans the result with HTML Purifier against a fixed allowlist of tags. The HTML is returned to your page and shown in the output editor. The endpoint returns the result without storing it, but because the text is transmitted, avoid pasting confidential material you are not allowed to send to a third-party service.
A few rules apply on every conversion, whichever options you choose:
- Input limit: up to 200,000 characters per request. Longer input is rejected with a validation message.
- Front matter is dropped: a YAML block at the very top, between two
---lines, is removed before conversion so it does not show up as text in your HTML. - Raw HTML in the Markdown is stripped: inline tags you typed directly, such as
<b>or<span>, are removed and their text remains, while a block of HTML on its own lines, such as a<div>block, is dropped together with its content. This happens even with Sanitize off. - Unsafe links are neutralised: a link to a
javascript:address is output as an anchor without anhref.
CommonMark or GitHub Flavored?
The dropdown at the top offers CommonMark and GitHub Flavored (GFM), with GFM selected by default. The difference matters more than people expect:
| Markdown feature | CommonMark | GitHub Flavored (GFM) |
|---|---|---|
| Headings, emphasis, lists, quotes, code, links, images | Yes | Yes |
| Pipe tables | No, left as a paragraph of text | Yes, converted to <table> |
~~strikethrough~~ | No, tildes stay as text | Yes, becomes <del> |
Bare addresses like www.example.com | Stay plain text | Become clickable links |
Task lists - [x] done | Brackets stay as text | Converted to checkbox items (see Sanitize below) |
Choose CommonMark when the HTML must match a strict CommonMark renderer elsewhere, or when you deliberately want table-like text left alone. Choose GFM for README files, GitHub content and most everyday writing.
The Sanitize switch
Sanitize is on by default. With it on, the converted HTML is filtered so only a known set of elements survives: headings, paragraphs, line breaks and horizontal rules, bold, italic, underline, strikethrough, lists, links, images, blockquotes, preformatted code, spans, divs and table elements. Script, iframe, object and embed elements are never allowed.
That allowlist has two side effects worth knowing:
- Table column alignment is removed. GFM marks aligned columns with an
alignattribute on each cell, which the sanitiser does not keep. With Sanitize off the attribute stays. - Task list checkboxes are removed. The list items remain, but the checkbox inputs are stripped, so
- [x] donebecomes a plain bullet reading done. With Sanitize off the disabled checkbox inputs stay.
The preview panel only renders sanitised HTML. Turn Sanitize off and the badge changes to Preview disabled; the HTML is still produced and available as code, but the page will not render it. This keeps the page itself safe when you convert content you did not write.
How to convert
- Paste Markdown into Input Markdown, or press Paste.
- Pick GitHub Flavored (GFM) or CommonMark from the dropdown.
- Leave Sanitize on unless you need alignment attributes or task-list checkboxes in the output.
- Press Convert. The button shows a spinner while the server works.
- Read the HTML in Output HTML and check the rendered result in Preview.
- Use the copy icon to copy the markup, or the download icon to save
converted-markdown.html.
The footers show character and word counts for both input and output, handy for spotting a conversion that dropped more than expected. The clear icon empties both editors and the preview.
What you get, and what you do not
The output is an HTML fragment: the body content only, with no <!DOCTYPE>, <html>, <head> or stylesheet. That is exactly what CMS editors and templates expect. If you open the downloaded file directly in a browser it will display with default browser styling, which is normal. Fenced code blocks keep their language as a class, for example class="language-php", so a syntax highlighter on your site can pick them up. Headings do not get automatic id attributes, so add anchors yourself if you need in-page links.
Good practice
- Keep Sanitize on for anything you will paste into a public page. It is the safer default and removes anything outside the allowlist.
- Use GFM when your Markdown has tables. Under CommonMark they come out as a single paragraph of pipes.
- Write formatting in Markdown, not inline HTML. Raw tags are stripped, so
<u>or<span style>in your source will not reach the output. - Check images. Image paths are copied as written. Relative paths such as
images/a.pngonly work if the same path exists where you publish the HTML.
Limitations
- 200,000 characters per conversion; an internet connection is required because conversion runs on the server.
- Raw HTML inside Markdown is always stripped; it cannot be passed through.
- With Sanitize on, table alignment and task-list checkboxes are lost.
- No full-page wrapper, CSS theme or syntax highlighting is added.
- No extensions beyond CommonMark and GFM, so footnotes, definition lists, math and heading IDs are not supported.
Related tools
If you need a printable file rather than markup, use the Markdown to PDF Converter. For plain text with no tags at all, use the Markdown to Text Converter.
Frequently Asked Questions
FAQ
टिप्पणियाँ (0)
Describe the issue you encountered so we can investigate and improve the साधन.