MDMarkdown ↔ HTML Converter
Markdown is a lightweight markup language that lets you write formatted documents using plain text. It is widely used in GitHub READMEs, technical blogs, wikis, and documentation platforms — all of which ultimately render Markdown as HTML. Conversely, converting existing HTML back to Markdown makes content easier to version-control and maintain. This tool supports bidirectional conversion with practical options: GFM (GitHub Flavored Markdown) tables and task lists, KaTeX math expressions, and flexible HTML output formatting (Pretty, Minify, Raw).
How to Use
- 1Choose conversion direction
Select 'Markdown → HTML' or 'HTML → Markdown' at the top. Your input is preserved when you switch modes.
- 2Configure options
In Markdown → HTML mode you can choose the HTML output format (Pretty / Minify / Raw), toggle GFM support (tables and checkboxes), and enable KaTeX math rendering. In HTML → Markdown mode you can set the heading style (ATX or Setext), bullet marker (-, *, +), code block style (Fenced or Indented), and specify tags to keep as raw HTML.
- 3Paste input or load an example
Paste text into the left pane or click 'Load Example' to load sample content. Conversion runs automatically after a short debounce and the result appears on the right.
- 4Check the live preview
The preview pane at the bottom shows the rendered output. In Markdown → HTML mode it renders the converted HTML; in HTML → Markdown mode it re-renders the Markdown result so you can verify the round-trip.
- 5Copy the result
Click the copy button next to the output to send the converted text to your clipboard.
Tips
- 💡Paste your GitHub README into Markdown → HTML mode to preview exactly how it will render on GitHub before you push.
- 💡Converting HTML blog posts to Markdown makes them much easier to version-control and edit in the future.
- 💡KaTeX math uses standard LaTeX syntax: $inline formula$ or $$block formula$$. Example: $E=mc^2$.
- 💡GFM table syntax (| Col | Col |) and task lists (- [ ] item) are automatically converted to their Markdown equivalents when converting HTML → Markdown.
- 💡Use 'Keep Tags' to preserve specific HTML tags as-is during HTML → Markdown conversion — useful for custom elements or complex tables you want to keep in HTML.
- 💡'Pretty' outputs indented, readable HTML. 'Minify' strips whitespace for the smallest possible file size. 'Raw' gives you the exact output from the marked parser.
FAQ
- Q. What is Markdown?
- A. Markdown is a lightweight markup language created by John Gruber in 2004. It lets you write formatted text using plain-text syntax (like **bold** and # Heading) that converts to HTML. It is widely used in GitHub, Notion, and technical documentation.
- Q. How does GitHub Flavored Markdown (GFM) differ from standard Markdown?
- A. GFM adds tables, task lists (- [x]), syntax-highlighted fenced code blocks (```lang), autolinked URLs, and strikethrough text. It is the variant used on GitHub, GitLab, and many other platforms.
- Q. Is the converted HTML safe to render directly?
- A. Not always. Markdown can contain raw HTML including script tags, which creates XSS vulnerabilities if rendered without sanitization. Always sanitize HTML with a library like DOMPurify before rendering user-supplied Markdown.