Markdown Previewer & Editor
Write and preview GitHub Flavored Markdown in real time inside a split-screen Monaco editor. Supports syntax highlighting, interactive table of contents, live statistics, and HTML, PDF, or .md export locally in your browser.
# Hello World
This is **bold** and *italic* text.
- Item one
- Item two
```js
console.log('Hello!');
```Ready locally via WebAssembly & JavaScript<h1>Hello World</h1><p>This is <strong>bold</strong> and <em>italic</em> text.</p><ul><li>Item one</li><li>Item two</li></ul><pre><code>console.log('Hello!');</code></pre>100% Client-Side • Zero Server UploadPlain-text markup became the lingua franca of software documentation because it stays legible in a terminal, diffs cleanly in Git, and survives decades of tooling churn. Yet writing complex nested lists, pipe-delimited tables, and multi-language code blocks blindly in raw text quickly introduces subtle formatting errors that only surface after you push a commit. The Markdown Previewer & Editor pairs a full Monaco code editor with an instant GitHub Flavored Markdown (GFM) renderer inside your browser, letting you inspect rendered typography, verify syntax highlighting, navigate long outlines, and ship HTML or PDF artifacts without uploading confidential drafts to an external backend.
Inside the Markdown-to-HTML Rendering Pipeline
Rather than running brittle regular-expression string replacements, the preview pane compiles your document through a structured Abstract Syntax Tree (AST) pipeline modeled on the unified ecosystem:
- Markdown Lexing and Parsing (
mdast): Raw text is tokenized according to the CommonMark specification, withremark-gfmenabling GitHub's tabular, strikethrough, task-list, and autolink grammar rules. - HTML Tree Transformation (
hast): The Markdown AST maps onto an HTML tree. Passing the tree throughrehype-rawreparses embedded inline HTML tags (such as<kbd>,<details>, or<figure>) into proper DOM nodes instead of escaping them as literal text. - Syntax Highlighting (
rehype-highlight): Fenced code blocks declaring an info string (such astypescript,python,bash, orsql) are tokenized by Highlight.js into semantic<span>classes before React mounts the output.
On the authoring side, the left pane runs the Monaco Editor — the same text buffer engine that powers VS Code. Clicking any formatting toolbar button invokes Monaco's executeEdits API against the active selection range, wrapping highlighted text in markers or inserting a pre-selected placeholder rather than naively appending syntax to the bottom of the file. Every modification is debounced by 800 milliseconds and cached in browser localStorage, preserving your work across refreshes while keeping proprietary specifications strictly on your local device.
CommonMark Core vs. GitHub Flavored Markdown Reference
Many formatting surprises stem from assuming every Markdown parser handles extensions identically. The reference matrix below outlines how standard CommonMark differs from the GFM superset supported in the live previewer.
| Syntax Feature | CommonMark 0.31 | GFM Extension | Rendered HTML Element | Key Parsing Rule |
|---|---|---|---|---|
ATX Headings (## Title) | Supported | Supported | <h1>–<h6> with slug id | Requires a space after #; ##Title stays a paragraph |
Fenced Code (```lang) | Supported | Supported | <pre><code class="hljs"> | Info string after opening backticks triggers Highlight.js |
Pipe Tables (| A | B |) | Not supported | Supported | <table>, <thead>, <tbody> | Header separator row needs at least three hyphens per column |
Task Lists (- [x] Done) | Not supported | Supported | <li><input type="checkbox"> | Requires lowercase x or space inside brackets after list marker |
Strikethrough (~~old~~) | Not supported | Supported | <del> | Single or double tildes in GFM; avoid spaces adjacent to delimiters |
| Bare Autolinks | Requires <...> | Supported | <a target="_blank"> | Matches https:// and www. prefixes without angle brackets |
| Raw Inline HTML | Supported | Supported | Native DOM node | Block HTML needs blank lines around it to resume Markdown parsing |
Authoring Clean Syntax and Exporting Deliverables
Small whitespace conventions decide whether nested structures render predictably across GitHub, static site generators, and documentation portals. For example, indenting a fenced code block inside a numbered list requires aligning the fence with the first character of the list item's content, and literal pipe characters inside a GFM table cell must be backslash-escaped (\|):
1. Configure the build script before deployment:
```bash
npm run build && npm run lint
```
| Flag | Behavior | Example |
| :--- | :---: | :--- |
| `--strict` | Fails on warnings | `lint --strict` |
| `A \| B` | Escaped pipe inside cell | `echo "ok"` |
When building wide multi-column data matrices, hand-aligning Markdown pipes becomes tedious. You can visually assemble complex layouts or import spreadsheet rows in the HTML Table Generator and export ready-to-paste GFM table markup straight into this editor.
Standalone HTML Export vs. Paginated PDF Rendering
The Export menu supports three local output paths tailored to different publishing targets:
- Source
.mddownload: Emits the exact UTF-8 buffer from Monaco via a client-sideBlobURL withtext/markdownMIME metadata. - Standalone
.htmlexport: Captures the compiled preview DOM and wraps it inside a complete HTML5 skeleton containing clean system-stack typography, responsive image constraints, bordered table styles, and accent blockquotes. If you need to inspect tag nesting, adjust indentation, or strip whitespace before embedding the output in a web page, pass the exported file into the HTML Formatter. - Paginated A4
.pdfexport: Dynamically loadshtml2canvasat2xpixel density and slices the rendered document canvas across portrait A4 sheets usingjsPDF. Because rasterization captures exact visual styling, tables and syntax-highlighted code blocks keep their proportions without relying on inconsistent browser print dialogs.
For long technical handbooks, toggle the Table of Contents panel to verify heading depth (H1–H6) and click any anchor to scroll directly to that section in the preview. The statistics strip recalculates words, characters, lines, headings, and approximate reading time (computed at 200 words per minute) on every keystroke. When revising existing specifications or release notes, comparing your updated .md export against the previous version in the Diff Checker highlights line-level edits before opening a pull request.
Practical Pitfalls and HTML Sanitization Hygiene
Three recurring edge cases catch even seasoned technical writers:
- Hard line breaks vs. soft wraps: A single newline inside a paragraph collapses into a space under CommonMark. Force a
<br>element intentionally by appending either a trailing backslash (\) or two spaces at the end of the line. - Underscores inside code identifiers: GFM disables intraword emphasis for underscores (
my_variable_namestays literal), whereas some older CommonMark parsers italicize_variable_. Wrapping every identifier in backticks guarantees portable rendering everywhere. - Inline HTML security boundaries: Because
rehype-rawfaithfully renders raw HTML tags, this editor is ideal for solo authoring and trusted repository documentation on your own device. If you ever embed copied HTML output into a multi-user web application that accepts untrusted input, always run the HTML through a strict allowlist sanitizer such as DOMPurify server-side or client-side to strip<script>tags andon*event attributes.
How to Use Markdown Previewer & Editor
Type directly into the Monaco editor pane, paste existing Markdown, or drag and drop a local .md, .markdown, or .txt file onto the workspace.
Use the formatting toolbar to wrap selected text in bold, italics, inline code, links, blockquotes, lists, task items, or GFM table templates at your exact cursor position.
Switch between Split, Editor-only, and Preview-only modes, or toggle Word Wrap and adjust editor font size for comfortable long-form writing.
Click the hash icon to open the auto-generated Table of Contents and jump smoothly to any heading in long documents.
Verify document length, heading structure, and reading duration in the live statistics strip above the editor.
Copy raw Markdown or rendered HTML with one click, or open the Export menu to download a .md source file, standalone .html page, or A4 .pdf document.
Real Examples
Basic Markdown Formatting
Common Markdown syntax and their rendered output.
# Hello World
This is **bold** and *italic* text.
- Item one
- Item two
```js
console.log('Hello!');
```<h1>Hello World</h1><p>This is <strong>bold</strong> and <em>italic</em> text.</p><ul><li>Item one</li><li>Item two</li></ul><pre><code>console.log('Hello!');</code></pre>GFM Table
Creating tables with GitHub Flavored Markdown.
| Feature | Status |
|---------|--------|
| Tables | ✅ |
| Tasks | ✅ |<table><thead><tr><th>Feature</th><th>Status</th></tr></thead><tbody><tr><td>Tables</td><td>✅</td></tr><tr><td>Tasks</td><td>✅</td></tr></tbody></table>Task List
Interactive checkboxes for project tracking.
## Sprint Tasks
- [x] Set up project
- [x] Write tests
- [ ] Deploy to production<h2>Sprint Tasks</h2><ul><li><input type="checkbox" checked disabled> Set up project</li><li><input type="checkbox" checked disabled> Write tests</li><li><input type="checkbox" disabled> Deploy to production</li></ul>Frequently Asked Questions
Which Markdown specification does the live previewer follow?
Does the editor allow raw inline HTML elements inside Markdown documents?
How does automatic draft recovery work if I close my browser tab?
What is the difference between copying rendered HTML and downloading an HTML file?
How are multi-page PDF exports generated from long Markdown files?
Key Features
- Monaco Editor engine with cursor-aware toolbar insertion, bracket pair colorization, line numbers, word wrap, and adjustable 10px to 24px font scaling
- GitHub Flavored Markdown rendering supporting pipe tables, task lists, strikethrough, autolinks, and inline HTML passthrough
- Automatic fenced code block syntax highlighting with one-click per-block code copy buttons
- Toggleable interactive Table of Contents extracted from H1 through H6 headings with smooth anchor scrolling
- Real-time telemetry bar tracking word count, character count, line count, heading count, and estimated reading time at 200 words per minute
- Local file drag-and-drop for .md, .markdown, and .txt files plus instant export to .md, styled standalone .html, and paginated A4 .pdf
Common Use Cases
- Drafting and reviewing GitHub README.md files, CHANGELOG entries, and pull request templates before committing to Git
- Authoring technical RFCs, architecture decision records, and API usage guides with syntax-highlighted code snippets
- Converting Markdown drafts into clean, styled HTML snippets for static site generators, headless CMS editors, or newsletters
- Exporting structured meeting notes, release summaries, and project specs directly into shareable A4 PDF handouts
- Auditing long-form documentation hierarchy and section flow using the interactive Table of Contents outline
- Inspecting raw Markdown files received from collaborators without installing a desktop editor or IDE plugin
Related Tools
Explore More Tools in This Category
View All Developer & Utility ToolsSQL Formatter & Beautifier
Format, beautify, minify, and validate SQL queries across nine relational and cloud warehouse dialects with Monaco syntax highlighting, query complexity scoring, and line-level diff checks — 100% client-side.
YAML Formatter & Beautifier
Format, beautify, minify, validate, and convert YAML documents instantly. Supports Kubernetes YAML, Docker Compose, GitHub Actions, YAML-to-JSON conversion, diff comparison, and linting — all client-side.
Word Counter & Character Counter
Analyze your writing in real time. Count words, characters, sentences, paragraphs, and spaces. Calculate keyword density, estimated reading time, readability scores, and platform limits.
Case Converter
Transform text casing instantly. Convert between UPPERCASE, lowercase, Title Case, Sentence case, AP/Chicago styles, camelCase, snake_case, and kebab-case. Clean whitespace and audit SEO title lengths.
Regex Tester & Live Debugger
Validate ECMAScript regular expressions in real time with match highlighting, named capture group inspection, flag toggles, and catastrophic backtracking diagnostics.
JSON to CSV Converter
Flatten nested JSON objects and arrays into RFC-4180 compliant CSV spreadsheets with configurable delimiters and UTF-8 BOM encoding directly in your browser.
CSV to JSON Converter
Transform RFC-4180 CSV datasets into clean, strongly typed JSON arrays with automatic delimiter detection and number/boolean coercion right in your browser.
JSON to YAML Converter
Convert JSON payloads into clean, human-readable YAML 1.2 manifests with safe string quoting for Kubernetes, Docker Compose, GitHub Actions, and OpenAPI specs.