[{"data":1,"prerenderedAt":148},["ShallowReactive",2],{"content-/markdown-to-html":3},{"id":4,"title":5,"body":6,"description":13,"extension":14,"meta":15,"navigation":142,"path":143,"seo":144,"sitemap":145,"stem":146,"__hash__":147},"content/markdown-to-html.md","Markdown to HTML Converter: MD to HTML Online, Free",{"type":7,"value":8,"toc":9},"minimark",[],{"title":10,"searchDepth":11,"depth":11,"links":12},"",2,[],"Convert Markdown to HTML in your browser. Paste or open an .md file, get clean indented HTML as a fragment or a full document, then copy it or download the .html file.","md",{"layout":16,"sections":17,"schema":132},"default",[18,24,46,59,62,64,92,127],{"type":19,"mode":20,"badge":21,"headline":22,"subheadline":23},"markdownTool","html","Free • Online • Private","Markdown to HTML Converter","Paste Markdown or open an .md file and get clean HTML you can copy or download. Choose an HTML fragment or a full document. It all runs in your browser.",{"type":25,"title":26,"items":27},"features","MD to HTML Without the Fuss",[28,31,34,37,40,43],{"title":29,"description":30},"Readable HTML","the output is indented, one block per line, so you can read it and paste it anywhere",{"title":32,"description":33},"Fragment or full document","get just the body markup, or a complete page with doctype, charset and a title",{"title":35,"description":36},"GitHub Flavored Markdown","tables, task lists, strikethrough and fenced code blocks all convert",{"title":38,"description":39},"Highlighted code, math and diagrams","fenced code with a language is highlighted with hljs classes, math becomes KaTeX HTML, and Mermaid blocks become inline SVG",{"title":41,"description":42},"Sanitized output","scripts, event handlers and javascript: links in the Markdown are stripped",{"title":44,"description":45},"Nothing is uploaded","conversion happens on your device, with no server and no account",{"type":47,"title":48,"steps":49},"howItWorks","How to Convert Markdown to HTML",[50,53,56],{"title":51,"description":52},"Paste or open","Paste Markdown into the left panel, or drop an .md file anywhere on the page.",{"title":54,"description":55},"Pick the output","Choose an HTML fragment for a CMS or template, or a full HTML document, with or without basic styles.",{"title":57,"description":58},"Copy or download","Click Copy HTML to put it on your clipboard, or Download .html to save it as a file.",{"type":60,"markdown":61},"articleContent","## What gets converted\n\nThe HTML comes from the marked library with GitHub Flavored Markdown on, cleaned by DOMPurify, then indented so it is easy to read. Each row below was checked against the tool's actual output.\n\n| Markdown | Converted? | HTML output |\n|---|---|---|\n| `#` to `######` headings | Yes | `\u003Ch1>` to `\u003Ch6>` with GitHub-style `id` attributes, so `#installation` links work |\n| Paragraphs | Yes | `\u003Cp>` |\n| Two trailing spaces or a trailing backslash | Yes | `\u003Cbr>` |\n| `**bold**`, `*italic*`, `~~strike~~` | Yes | `\u003Cstrong>`, `\u003Cem>`, `\u003Cdel>` |\n| Links and bare `www.` addresses | Yes | `\u003Ca href>` |\n| Images | Yes | `\u003Cimg src alt>`, with the path kept exactly as written |\n| Bulleted, numbered and nested lists | Yes | `\u003Cul>`, `\u003Col>` and `\u003Cli>` |\n| Task lists `- [x]` | Yes | `\u003Cli>` with a disabled checkbox `\u003Cinput>` |\n| Pipe tables with alignment | Yes | `\u003Ctable>` with `\u003Cthead>`, `\u003Ctbody>` and `align` attributes |\n| Fenced code with a language | Yes | `\u003Cpre>\u003Ccode class=\"hljs language-js\">` with highlight.js spans; the full document's styles include the colors |\n| Blockquotes and `---` rules | Yes | `\u003Cblockquote>` and `\u003Chr>` |\n| Safe raw HTML such as `\u003Cdetails>` or `\u003Csup>` | Yes | Kept |\n| `\u003Cscript>`, `\u003Cstyle>`, forms, `onclick`, `javascript:` links | No | Removed |\n| YAML front matter | Partial | Becomes an `\u003Chr>` and an `\u003Ch2>`, so delete it first |\n| Math (`$x^2$`, `$$...$$`) | Yes | KaTeX HTML; the full document links the KaTeX stylesheet it needs |\n| Mermaid diagrams | Yes | Inline `\u003Csvg>` |\n| Footnotes | No | Not converted |\n\nThe full-document option adds `\u003C!doctype html>`, a UTF-8 charset, a viewport tag and a `\u003Ctitle>` taken from the first heading. The optional styles are a short embedded stylesheet for readable type, tables and code.\n",{"type":60,"markdown":63},"## Common problems and fixes\n\n### My CMS shows the tags as text\n\nMost editors have a visual mode and an HTML or code mode. Pasting HTML into the visual mode shows the tags as text. Switch to the HTML, Code or Custom HTML block first, then paste the fragment. If you want to paste formatted text into a visual editor instead, use [Markdown to Google Docs](/markdown-to-google-docs), which copies rich text.\n\n### Code blocks have no colors\n\nColors come from highlight.js classes such as `hljs-keyword`, and the stylesheet for them is only in the full-document output. If you copied a fragment, either load highlight.js and a theme on your site, or switch to the full document and copy its `\u003Cstyle>` block. Blocks with no language on the fence, or a language the tool doesn't ship, stay plain.\n\n### Math shows as scattered symbols\n\nMath is converted to KaTeX HTML, which needs the KaTeX stylesheet and fonts. The full document links it; a fragment pasted into your own page needs the same `\u003Clink>` in its head.\n\n### The page looks plain in an email\n\nThe optional styles sit in a `\u003Cstyle>` block, and many email clients ignore or strip those. For email, copy the document as rich text from [Markdown to Google Docs](/markdown-to-google-docs), which puts the styles inline, and paste it into the message.\n\n### Images are broken\n\nImage paths are copied exactly. A relative path such as `images/chart.png` needs the image file to sit in that place next to your HTML file, or a full `https://` address.\n\n## Other ways to convert Markdown to HTML\n\n- **Pandoc.** `pandoc -f gfm -t html -s notes.md -o notes.html` writes a standalone page; leave out `-s` for a fragment. With `-f markdown`, Pandoc's own dialect, it also handles footnotes and math, and it supports page templates, which makes it the stronger choice for long documents.\n- **Libraries.** marked (the library this page uses) and markdown-it in JavaScript, or Python-Markdown in Python, do the conversion inside your own code.\n- **VS Code.** The built-in preview (Ctrl+Shift+V) shows the rendered page; extensions such as Markdown All in One add an export to HTML.\n- **Static site generators.** Hugo, Jekyll, Astro and Eleventy turn a folder of .md files into a whole website.\n\nUse this page when you want clean HTML from one document right now, with nothing to install and nothing uploaded.\n",{"type":65,"title":66,"items":67},"faqs","Markdown to HTML FAQ",[68,71,74,77,80,83,86,89],{"question":69,"answer":70},"How do I convert Markdown to HTML?","Paste your Markdown into the left panel or drop an .md file on the page. The right panel shows the generated HTML. Click Copy HTML to put it on your clipboard, or Download .html to save it as a file.",{"question":72,"answer":73},"What is the difference between an HTML fragment and a full HTML document?","A fragment is only the converted content (headings, paragraphs, lists and so on), for pasting into a CMS, a template or an existing page. A full document wraps it in doctype, html, head and body tags, with a UTF-8 charset, a viewport tag and a title taken from the first heading, so the file opens on its own in a browser.",{"question":75,"answer":76},"Which Markdown flavor is supported?","CommonMark with the GitHub Flavored Markdown extensions: tables, task lists, strikethrough, autolinks and fenced code blocks. It uses the marked library. Math ($...$ and $$...$$) renders with KaTeX and ```mermaid blocks become inline SVG. Footnotes are not supported.",{"question":78,"answer":79},"Does it highlight code?","Yes, with highlight.js for about 30 common languages. Each token gets a class such as hljs-keyword, and the full-document output includes the colors in its stylesheet. A fragment keeps the classes, so your own highlight.js theme can style them.",{"question":81,"answer":82},"Can I use Markdown directly in an HTML page?","Browsers don't render Markdown on their own; they show it as plain text. Either convert it to HTML first, as this page does, or load a JavaScript library such as marked on your page to convert it in the browser.",{"question":84,"answer":85},"What happens to raw HTML inside my Markdown?","Raw HTML is passed through DOMPurify. Script tags, style tags, forms, inline event handlers such as onclick, and javascript: links are removed. Ordinary tags such as details or sup stay.",{"question":87,"answer":88},"Is my Markdown uploaded anywhere?","No. The file is read with your browser's File API and converted on your device. Nothing is sent to a server.",{"question":90,"answer":91},"Can I convert HTML back to Markdown?","Yes. The [HTML to Markdown converter](/html-to-markdown) does the reverse: drop an .html file or paste HTML and get clean Markdown.",{"type":93,"title":94,"items":95},"relatedArticles","More Markdown Tools",[96,101,106,110,114,118,122],{"name":97,"badge":98,"description":99,"link":100},"Markdown to PDF","Tool","Download a PDF with selectable text and clickable links, built in your browser.","/markdown-to-pdf",{"name":102,"badge":103,"description":104,"link":105},"HTML to Markdown","Reverse","Turn an HTML page or file back into clean Markdown.","/html-to-markdown",{"name":107,"badge":98,"description":108,"link":109},"Markdown Viewer","Open an .md file and read it rendered, with tables, task lists and code.","/markdown-viewer",{"name":111,"badge":98,"description":112,"link":113},"Markdown to Google Docs","Copy Markdown as rich text for Google Docs, Gmail, Word or a visual CMS editor.","/markdown-to-google-docs",{"name":115,"badge":98,"description":116,"link":117},"Markdown to Word","Download a .docx with real Word headings, lists and tables.","/markdown-to-word",{"name":119,"badge":98,"description":120,"link":121},"Markdown to Plain Text","Strip the Markdown formatting and keep clean, readable text.","/markdown-to-text",{"name":123,"badge":124,"description":125,"link":126},"Markdown Cheat Sheet","Reference","Every Markdown element with examples, and the HTML each one becomes.","/markdown-cheat-sheet",{"type":128,"title":129,"subtitle":130,"cta":131},"ctaBanner","Have HTML and need Markdown instead?","Convert HTML, PDF, Word and other files to Markdown in your browser.",{"text":102,"link":105},{"howTo":133,"softwareApplication":135},{"name":48,"description":134},"Convert Markdown to HTML in the browser with Craft Markdown",{"name":136,"applicationCategory":137,"operatingSystem":138,"offers":139},"Craft Markdown to HTML Converter","UtilitiesApplication","Web Browser",{"price":140,"priceCurrency":141},"0","USD",true,"/markdown-to-html",{"title":5,"description":13},{"loc":143},"markdown-to-html","hWCUK78nf6kol_C0-6r5B5JXvdzvnSMQrNpenda-XwM",1791690569774]