HTML to MDX
Convert HTML to clean MDX-ready Markdown
New to MDX? Read MDX vs Markdown or browse the MDX cheatsheet.
How to Convert HTML to MDX
Paste HTML into the editor and the converter produces MDX-compatible Markdown. Headings, paragraphs, lists, links, and code blocks become standard Markdown. Tables, complex nested markup, and unknown elements are preserved as raw HTML — which is valid MDX. The output is ready to paste into a Next.js, Docusaurus, or Astro MDX file.
What gets converted
Standard HTML elements with Markdown equivalents are converted: h1 through h6, p, strong, em, code, pre, a, ul, ol, li, blockquote, hr, img. Code blocks preserve language hints from class="language-*" attributes. Simple tables become Markdown tables; complex tables (with rowspan or colspan) stay as raw HTML.
Migration use cases
Use this converter when migrating content from a CMS that exports HTML — Notion, Confluence, WordPress, Ghost, or static-site exports. The output drops cleanly into any MDX-based docs platform (Next.js, Docusaurus, Astro, Gatsby) without further processing.
Why preserve raw HTML
MDX accepts raw HTML inline. When markup cannot be expressed in Markdown (complex tables, custom elements, embedded iframes), the converter leaves the original HTML in place rather than dropping data. Content survives the conversion — only executable markup is removed for safety (see below).
What is removed for safety
Executable HTML is stripped: <script> blocks, <style> blocks, and inline event handlers like onclick or onload. MDX compiles to a React component tree that runs in your app, so passing arbitrary scripts through would be an XSS footgun for anyone migrating content from a CMS. Visible content (text, links, images, structure) is always preserved.
Frequently Asked Questions
Is the HTML to MDX converter free and open source?
What HTML elements does it convert?
Is any content dropped during conversion?
Can I convert content from Notion or Confluence?
Does it preserve syntax highlighting hints?
About this tool
The HTML to MDX converter is free and open source. It runs entirely in your browser. Your input is never uploaded, stored, or logged — you can verify this by opening the network tab in your browser developer tools while the tool runs. The full source code is on GitHub under the Apache 2.0 license, so you can read the code, file issues, or fork the project. There are no ads, no accounts, and no usage limits. Built and maintained by Jamdesk.
Maintained by Jamdesk · Last reviewed
Publish converted MDX as live docs
Jamdesk renders MDX natively — no further conversion needed. Learn more
Related Tools
Publish converted MDX as live docs
Jamdesk renders MDX natively — no further conversion needed. Learn more