Convert Markdown text to HTML quickly and easily. Supports headings, lists, links, and more.
HTML preview will appear here...
# H1
→
<h1>
## H2
→
<h2>
### H3
→
<h3>
**bold**
→
<strong>
*italic*
→
<em>
`code`
→
<code>
- Item
→
<li>
[Text](URL)
→
<a>

→
<img>
Enter Markdown text to see HTML preview...
'; htmlOutput.value = ''; updateOutputStats(''); return; } // Convert Markdown to HTML let html = simpleMarkdownToHtml(mdText); // Update preview and output htmlPreview.innerHTML = html; htmlOutput.value = html; // Update statistics updateOutputStats(html); } // Simple Markdown parser (lightweight alternative to full library) function simpleMarkdownToHtml(markdown) { let html = markdown; // Headers html = html.replace(/^### (.*$)/gim, '$1');
html = html.replace(/`([^`]+)`/gim, '$1');
// Blockquotes
html = html.replace(/^> (.*$)/gim, '$1'); // Lists html = html.replace(/^\s*-\s+(.*$)/gim, '
Enter Markdown text to see HTML preview...
'; htmlOutput.value = ''; updateCharCount(); updateOutputStats(''); markdownInput.focus(); } // Load example Markdown function loadExample() { markdownInput.value = exampleMarkdown; convertMarkdown(); updateCharCount(); showNotification('Example Markdown loaded!'); } // Copy both Markdown and HTML function copyAll() { const text = `Markdown:\n${markdownInput.value}\n\nHTML:\n${htmlOutput.value}`; copyToClipboard(text).then(() => { showNotification('Markdown and HTML copied!'); }).catch(err => { showNotification('Failed to copy: ' + err.message); }); } // Reset converter to initial state function resetConverter() { clearMarkdown(); allowHtmlCheck.checked = true; autoLinksCheck.checked = true; sanitizeHtmlCheck.checked = false; setViewMode('split'); showNotification('Converter reset!'); } // Update character count function updateCharCount() { const count = markdownInput.value.length; charCount.textContent = count.toLocaleString(); // Update line count const lines = markdownInput.value.split('\n').length; lineCount.textContent = lines; } // Update output statistics function updateOutputStats(html) { // Count HTML tags const tagMatches = html.match(/<\/?[a-z][\s\S]*?>/gi) || []; tagCount.textContent = tagMatches.length; // Calculate size const size = new Blob([html]).size; outputSize.textContent = size.toLocaleString(); } // Set view mode (edit, preview, split) function setViewMode(mode) { currentViewMode = mode; // Reset all buttons editModeBtn.classList.remove('bg-accent', 'text-primary'); previewModeBtn.classList.remove('bg-accent', 'text-primary'); splitModeBtn.classList.remove('bg-accent', 'text-primary'); editModeBtn.classList.add('text-gray-700', 'hover:bg-gray-200'); previewModeBtn.classList.add('text-gray-700', 'hover:bg-gray-200'); splitModeBtn.classList.add('text-gray-700', 'hover:bg-gray-200'); // Update UI based on mode switch(mode) { case 'edit': editorContainer.classList.remove('lg:grid-cols-2'); editorContainer.classList.add('lg:grid-cols-1'); document.querySelector('div.h-full:last-child').classList.add('hidden'); editModeBtn.classList.remove('text-gray-700', 'hover:bg-gray-200'); editModeBtn.classList.add('bg-accent', 'text-primary'); break; case 'preview': editorContainer.classList.remove('lg:grid-cols-2'); editorContainer.classList.add('lg:grid-cols-1'); document.querySelector('div.h-full:first-child').classList.add('hidden'); document.querySelector('div.h-full:last-child').classList.remove('hidden'); previewModeBtn.classList.remove('text-gray-700', 'hover:bg-gray-200'); previewModeBtn.classList.add('bg-accent', 'text-primary'); // Convert if we haven't already if (markdownInput.value && !htmlOutput.value) { convertMarkdown(); } break; case 'split': editorContainer.classList.remove('lg:grid-cols-1'); editorContainer.classList.add('lg:grid-cols-2'); document.querySelectorAll('div.h-full').forEach(el => el.classList.remove('hidden')); splitModeBtn.classList.remove('text-gray-700', 'hover:bg-gray-200'); splitModeBtn.classList.add('bg-accent', 'text-primary'); break; } } // Initialize when DOM is loaded document.addEventListener('DOMContentLoaded', function() { initMarkdownConverter(); setViewMode('split'); // Default to split view });Multilingual URL Opener, Batch Language URLs, Translated Pages Opener, i18n URL Tool
Automatically generate and open multiple language versions of your web pages with custom delay settings. Perfect for multilingual website management.
Multiple URL Opener, Open Multiple Links, Batch URL Opener, URL Scheduler
Open multiple URLs automatically with custom delay and batch settings. Manage your link opening history and control the process with our powerful URL opener tool.
Multilingual URL Opener, Batch Language URLs, Translated Pages Opener, i18n URL Tool
Automatically generate and open multiple language versions of your web pages with custom delay settings. Perfect for multilingual website management.
GTranslate URL Opener, Batch Language URLs, GTranslate Multilingual, i18n URL Tool
Automatically generate and open multiple language versions of your GTranslate web pages with custom delay settings.
Pinyin 演讲稿生成器
Pinyin 演讲稿生成器
Markdown to HTML
Markdown to HTML
Don't see the tool you need? Let us know via email, and we'll consider adding it.
869241891@qq.com