Markdown Converter

Convert between Markdown and HTML with preview

Usage Instructions

🚀 Quick Start

  • Paste content into the left input box
  • Select conversion mode (→HTML or →Markdown)
  • Content converts automatically, result shows on the right
  • Preview/HTML output: Markdown → HTML renders KaTeX/Mermaid by default

📌 Common Scenarios

  • Blog/Docs preview: quickly check Markdown rendering and colors
  • Email delivery: paste exported HTML into the email body (prefer inline styles)
  • Rich text → Markdown: clean webpage/CMS rich text into version‑controlled Markdown
  • Tech docs: render formulas/diagrams and export in one step
  • Editor migration: reconcile differences across Markdown flavors
  • Wiki/Knowledge base: convert HTML pages to Markdown for import
  • API changelog: turn HTML/descriptions into Markdown for review/PR

🎛️ Conversion Parameters & Rendering

  • Markdown → HTML renders KaTeX/Mermaid automatically
  • HTML → Markdown keeps/restores source; no re‑render
  • GFM (tables/tasks) is enabled by default; use standard Markdown for strict behavior
  • Soft line breaks are enabled; for strict behavior use blank lines or two trailing spaces
  • Very large inputs may trigger degraded preview (limit rendering/disable highlighting)

🧭 Usage Advice

  • Email: prefer inline styles for better compatibility
  • Long documents: convert in parts to avoid lag

⚠️ Limitations & Compatibility

  • Flavors differ: rendering varies across platforms; prefer common syntax
  • HTML → Markdown is best‑effort: styles/layout are often lost
  • HTML → Markdown ignores parts of HTML (scripts/styles/meta, embeds/forms, media, on* events, style/class, etc.)
  • Complex tables/nesting may degrade; please review
  • Images/video remain external links; not downloaded
  • Third‑party pre‑rendered Mermaid SVG cannot be reliably reversed

🔒 Privacy & Security

  • All processing happens in your browser; data never leaves your device
  • Doesn’t run <script> from pasted HTML
  • KaTeX/Mermaid render with safe configuration
  • Doesn’t auto‑sanitize all HTML; please review before/after conversion

❓ FAQ

Preview differs from the target platform — how to diagnose?

Identify the target flavor (CommonMark/GFM/custom). Avoid raw HTML and private extensions. Use standard line breaks (blank lines or two trailing spaces). Reduce to a minimal example, verify on the target platform, then expand.

How do I ship exported HTML safely to production?

This tool doesn’t execute <script>, but it also doesn’t auto‑sanitize. Sanitize on the server/publish pipeline with a whitelist library (e.g., DOMPurify), disallow on* handlers and dangerous URI schemes, and enforce CSP for external/inline scripts.

HTML → Markdown distorts complex structures — what should I do?

Prefer portable semantics: convert nested tables/lists into pipe tables and flatter lists; paste as plain text to strip span/style/class before converting; isolate a minimal case and adjust the source.

KaTeX/Mermaid limits and troubleshooting?

Syntax: KaTeX $$…$$ or inline $…$; Mermaid fenced as ```mermaid. Large inputs may degrade (show source/disable highlighting). Reduce density, convert in parts, and use minimal examples to pinpoint syntax issues. Recovery: KaTeX can be recovered from rendered HTML; Mermaid recovery only works for diagrams generated by this tool with embedded source.

Markdown Converter - Bidirectional Conversion - CrateX.app