Markdown Editor (CodeMirror)
CodeMirror-based online Markdown editor supporting live preview, code highlighting, theme switching, syntax toolbar and export features
Input Area
Preview Output
Tool Documentation
This tool is an online Markdown editor. The left side is a Markdown editor with syntax highlighting, while the right side provides live preview with code highlighting. It is ideal for daily writing, technical documentation, API descriptions and blog drafts.
Key Features
- Left editor with Markdown syntax highlighting, line numbers and folding
- Right live preview area rendered by marked with code highlighting via Highlight.js (preview updates automatically while typing)
- Built-in DOMPurify sanitization to prevent rendering of malicious HTML and scripts
- Quick toolbar for bold, italic, quote, link, headings, lists and other common Markdown syntax
- Support for paste, clear, copy HTML, download Markdown and export HTML file
- Keyboard shortcuts: Ctrl/⌘ + B for bold, Ctrl/⌘ + I for italic, Ctrl/⌘ + L to clear editor
- Resizable split view between editor and preview on desktop by dragging the divider
- Light/dark theme switching with matching editor themes (eclipse/dracula)
How to Use
- Type or paste your Markdown content into the left editor;
- Use the toolbar buttons to quickly insert bold, quotes, lists, headings and more;
- The right side updates automatically with live preview, no extra button is required;
- When you are satisfied, click “Copy HTML” to get the rendered HTML code;
- You can also use “Download MD” and “Download HTML” to save content as local files.
Tips
- If you are new to Markdown, start with basic syntax like headings, lists and links;
- For code blocks, use ```language to mark the language name for better highlighting;
- If the preview seems outdated, slightly edit the content or check for syntax errors;
- When moving content between devices, it is recommended to copy Markdown first and render it again here;
- For publicly published content, avoid embedding untrusted HTML inside your Markdown.