πŸ› οΈ Developer Tools
Β· 1 min read

Free Markdown to HTML Converter


Convert Markdown to clean HTML. Runs entirely in your browser.

]+)`/g, β€˜$1’); // Headings html = html.replace(/^######\s+(.+)$/gm, β€˜
$1
’); html = html.replace(/^#####\s+(.+)$/gm, β€˜
$1
’); html = html.replace(/^####\s+(.+)$/gm, β€˜

$1

’); html = html.replace(/^###\s+(.+)$/gm, β€˜

$1

’); html = html.replace(/^##\s+(.+)$/gm, β€˜

$1

’); html = html.replace(/^#\s+(.+)$/gm, β€˜

$1

’); // Bold and italic html = html.replace(/***(.+?)***/g, β€˜$1’); html = html.replace(/**(.+?)**/g, β€˜$1’); html = html.replace(/*(.+?)*/g, β€˜$1’); // Images html = html.replace(/![([^]])](([^)]+))/g, '$1'); // Links html = html.replace(/[([^]]+)](([^)]+))/g, β€˜$1’); // Blockquotes html = html.replace(/^>\s+(.+)$/gm, β€˜
$1
’); // Horizontal rules html = html.replace(/^---$/gm, '
'); // Unordered lists html = html.replace(/^[-*]\s+(.+)$/gm, β€˜
  • $1
  • ’); html = html.replace(/((?:
  • .</li>\n?)+)/g, β€˜
      $1
    ’); // Ordered lists html = html.replace(/^\d+.\s+(.+)$/gm, β€˜
  • $1
  • ’); // Paragraphs html = html.replace(/^(?!<[a-z])((?!</?\w).+)$/gm, β€˜

    $1

    ’); // Clean up empty paragraphs html = html.replace(/

    \s*</p>/g, ”); return html.trim(); } function convertMd() { var md = document.getElementById(β€˜md-input’).value; var html = mdToHtml(md); document.getElementById(β€˜md-html’).value = html; document.getElementById(β€˜md-preview’).innerHTML = html; } function togglePreview() { document.getElementById(β€˜md-preview-wrap’).style.display = document.getElementById(β€˜md-show-preview’).checked ? β€˜block’ : β€˜none’; } function copyMdHtml(btn) { navigator.clipboard.writeText(document.getElementById(β€˜md-html’).value); btn.textContent = β€˜Copied!’; setTimeout(function() { btn.textContent = β€˜Copy HTML’; }, 1500); } document.getElementById(β€˜md-input’).addEventListener(β€˜input’, convertMd);

    Supported Syntax

    • Headings (# H1 through ###### H6)
    • Bold (**text**) and italic (*text*)
    • Links ([text](url)) and images (![alt](url))
    • Code blocks (triple backticks) and inline code
    • Unordered and ordered lists
    • Blockquotes (> text)
    • Horizontal rules (---)

    For a full reference, see the Markdown Cheat Sheet.

    Related: Best Hosting for AI Projects