Markdown Editor: Write, Preview and Export Markdown in the Browser

A markdown editor solves one problem well: you type plain text, and you see the page it becomes without leaving the window. The version on this site goes a step further than most writing boxes. The left pane takes Markdown, the right pane renders it on every keystroke, and the same draft can leave as source, as a PDF, as a PNG, as a DOCX file or as a ZIP bundle. Nine fenced-block engines turn code into drawings, from a Mermaid flowchart to a chemistry structure. Everything runs in the tab, so there is no upload and no account.

The rest of this page is a working guide: what the renderer accepts, where the diagram fences go, how each export behaves, and which habits keep a document intact when it moves to another tool.

What a live preview actually changes

Writing Markdown blind is a small tax paid on every paragraph. You type a pipe table, save, switch to a viewer, notice that a column is missing its separator row, go back, fix it. Each round trip costs seconds, and the mistakes cluster in the same places: tables, nested lists, links with parentheses inside the URL.

A live preview removes the round trip. The renderer here reparses the whole document after each change, so a broken table shows up as a broken table while the cursor is still in the source. The three view modes exist for different kinds of work. Editor only keeps the source full width when you are pasting a large block. Preview only turns the page into something you can read on a phone. Split is the default, because it is the mode where the feedback loop is shortest.

The counters under the editor report words and lines as you type. They are crude on purpose: a word is a whitespace-separated token, so a URL counts as one word and a hyphenated compound counts as one too. If a publisher gave you a 1,200-word ceiling, the counter tells you where you stand before you export, not after.

Two details are easy to miss on the first visit. The editor keeps the draft in the textarea, so a page reload clears it; export or copy before you close the tab. And Copy HTML works on the rendered preview node, which means the button needs the Preview or Split view to be open when you press it. Neither behaviour is hidden, but both surprise people who expect a saved document.

The Markdown dialect this editor renders

Most "Markdown support" claims stop at headings and bold text. The pipeline here is a stack of remark parsers on the input side and rehype transforms on the output side, fourteen and ten of them respectively, and each one adds a specific piece of syntax.

GitHub Flavored Markdown is the base: pipe tables with column alignment, task lists with real checkboxes, strikethrough, autolinks that turn a bare URL into a link, and fenced code blocks that keep their language tag. On top of that sit the extensions people actually use in notes. Frontmatter between triple dashes is parsed as metadata instead of leaking into the page as a horizontal rule. GitHub alert blockquotes become callout boxes. Definition lists, footnotes, subscript, superscript, inserted text, emoji shortcodes and CJK-friendly line breaking all have their own plugin.

Code fences are highlighted with Prism, line-aware, so a snippet keeps the colours it has in an editor. Raw HTML authored inside the Markdown is allowed, then sanitized, so a <details> block or a <figure> renders while a script tag does not survive. External links get the right rel attributes automatically.

SyntaxWhat you typeWhat the preview shows
Tablepipes with a separator rowa real table with aligned columns
Task list- [x] itema checked checkbox and the label
Math$a^2+b^2=c^2$typeset formula
Diagrama fence tagged mermaida drawn flowchart
Callout> [!NOTE] blockquotea bordered note box
Footnote[^1] plus its definitiona numbered reference and a list at the end

One trade-off is worth stating plainly: because the parser follows GFM rather than every flavour ever shipped, a document written for a specific vendor extension may render differently. The extensions above cover the common cases. Anything beyond them arrives as literal text, which is at least visible rather than silently dropped.

Math, diagrams and the fenced-block trick

Fenced blocks are the most useful feature on the page, and the least obvious. A block tagged with a language name is handed to the matching renderer instead of being printed as code. Nine names are wired up, each loaded on demand, so a document with no diagrams pays nothing for them.

Mermaid covers flowcharts, sequence diagrams, class diagrams, state machines, Gantt charts and pie charts. The chart engine takes Chart.js definitions for bar, line and pie data. Graphviz handles dot syntax for graphs that need precise layout. Flowchart.js draws simple process diagrams from its own compact syntax. Markmap turns a nested list into a mind map. ABC renders music notation, SMILES renders chemical structures, WaveDrom renders digital timing diagrams, and Temml renders MathML for maths that needs more than inline KaTeX.

The practical effect is that one file can hold the prose, the tables, the formulas and the diagrams, and the diagrams stay editable as text. That is the whole argument for diagrams-as-code: a flowchart in a fenced block diffs in version control, where a screenshot does not.

A working example, pasted into the editor as is:

flowchart LR
A[Draft in Markdown] --> B{Preview looks right?}
B -->|Yes| C[Export]
B -->|No| D[Fix the table]
D --> B

The fence is the only contract. Tag the block correctly and the drawing appears in the preview; mistype the tag and the block falls back to highlighted code, which is a readable failure rather than a blank pane. For math, single dollar signs wrap inline expressions and double dollar signs wrap display equations, both rendered by KaTeX with the syntax you already write in LaTeX.

Exporting: five paths from one draft

The export row is where this editor earns its place over a text box with a preview. Five outputs come from the same buffer, and each one suits a different destination.

OutputWhat lands on diskWhere it fits
Download .mddocument.md, the source exactly as typedrepositories, static site generators, notes apps
PDFa print-styled page built from the previewsending a read-only document to someone without Markdown tools
PNGa snapshot image of the rendered previewslides, chat messages, design reviews
DOCXa Word document with headings and tablesoffices where Word is the exchange format
ZIPa bundle of the export setarchiving a draft with its assets

The two clipboard buttons cover the fast cases. Copy MD takes the source, which is what you want when moving a draft into a Git commit. Copy HTML takes the sanitized markup of the preview, which is what you want when pasting into a CMS that accepts rich text or into an email client that mangles plain Markdown.

A caution about the PDF and PNG paths: both render what the preview shows. If a diagram is still loading, or a code block is still being highlighted, the export can catch the pane mid-render. Wait for the drawing to appear, then export. For DOCX, expect structure rather than pixel fidelity: headings become heading styles, tables become editable tables, and code keeps its monospace treatment, but a hand-tuned visual layout will not survive the trip.

A ten-minute walkthrough

Start with a blank editor and type a heading and two sentences. The preview shows the heading at its real size immediately, which is the fastest way to confirm the pipeline is alive.

Next, add a table. Write the header row, then the separator line with dashes and pipes, then two rows. If the preview shows a single paragraph of pipes, the separator row is missing or has the wrong number of columns. This is the single most common Markdown error, and the live pane catches it in under a second.

Then add a task list with one checked and one unchecked item, and a fenced code block tagged with a language name. Both render as their final form. If you are writing documentation, this is the point where the draft starts to look like the published page.

Now the diagram. Add a fence tagged mermaid with three nodes and two arrows, and watch the code block turn into a drawing. If the diagram fails, the usual causes are a missing diagram keyword on the first line, a label with unescaped punctuation, or a fence that is not exactly three backticks.

Finish by loading a real document. Use the file picker to open a .md file from disk, or drop it onto the editor. The draft is replaced, the preview re-renders, and the counters update. From there, export: download the .md if the file is going back into a repository, or the PDF if it is going to a reader who does not work in Markdown.

The sample button exists for the same reason: it loads a document that exercises headings, lists, a table, a code block and a task list in one go, so you can confirm the renderer before trusting it with your own text.

Where the browser-only design has limits

No upload is a real benefit and a real constraint. The good part: the draft never leaves the device, there is no account, and a confidential note can be pasted without a second thought. The constraint: nothing is stored. Close the tab and the textarea is gone, so a long document needs an export before you leave.

Very large files are the second limit. The renderer reparses on every keystroke, so a document of a few hundred kilobytes starts to feel heavy, and a multi-megabyte file makes typing lag. The workaround is simple: switch to Editor only while writing, then render when you pause. Splitting a huge document into sections is better still, because the preview stays responsive and the export stays small.

The third limit is flavour. GFM plus the plugins listed above covers the syntax most documents use. A file written for a tool with proprietary extensions may need small edits before it renders as intended. That is a property of Markdown in general rather than of this editor: every renderer picks a dialect, and the honest ones say which.

None of these limits touch the common case. A README, a technical note, a meeting record or a blog draft is small, portable and exported within the same session.

Markdown habits that survive export

A few habits keep a document intact when it moves between tools, and they cost nothing while writing.

Use the separator row in every table, with the same column count as the header. Keep code fences tagged, because an untagged fence loses its highlighting. Prefer relative links inside a repository and absolute links outside it. Put a blank line before and after a table, a list and a fenced block, since parsers differ on adjacency. And keep one idea per heading: a section that answers one question exports cleanly to any format, including PDF and DOCX, where page breaks interact badly with long mixed sections.

For documents that will be read on a phone, Preview only is the honest test. For documents that will be committed, Download .md is the honest test: open the file in a plain editor and check that nothing was converted into something you did not type.

Frequently Asked Questions

Which Markdown flavour does the editor render?

GitHub Flavored Markdown, plus frontmatter, footnotes, definition lists, alert callouts, subscript, superscript and emoji shortcodes. Raw HTML is sanitized before it reaches the page.

Can I export to something other than .md?

Yes. Download the draft as PDF, PNG, DOCX or ZIP from the same toolbar, or copy the source and the rendered HTML to the clipboard.

How do diagrams work?

Tag a fenced block with a supported name, such as mermaid, chart, graphviz, markmap, smiles, abc, wavedrom, flowchart or mathml, and the block renders as a drawing.

Is my text uploaded anywhere?

No. The parser, the renderer and every export run in the browser tab. There is no account and no server-side copy.

Does it support LaTeX math?

Inline math between single dollar signs and display math between double dollar signs is typeset with KaTeX. A mathml fence is the second path for the same syntax.

Can I open an existing file?

The picker accepts .md, .markdown, .txt, .html and .htm, and files can be dropped onto the editor. Content is read locally.

Why does Copy HTML need the preview open?

The button copies the rendered preview node, so Preview or Split has to be active when you press it. Copy MD works from any view.

What about very long documents?

Rendering runs on every keystroke. Switch to Editor only for a huge file, or split it into sections, and the preview stays responsive.

Sam Berry
Sam Berry

Michigan, USA · SO reputation 7994 · Badges: 8🥇45🥈62🥉 · SO member since 2012