How MarkdownTools Works
How the tools parse, sanitize, convert and export Markdown, and the public specifications they follow.
Everything runs in your browser
Every converter, generator and editor on the site runs as code in your browser tab. When you paste text or open a file, it is read and converted on your device; nothing is uploaded to us. That is also why most tools keep working offline once the page has loaded. The two optional exceptions, fetching a web page you ask for and saving documents to an account, are described in the privacy policy.
Parsing Markdown
Markdown is read in two passes, the way the CommonMark Spec describes: first the block structure (headings, paragraphs, lists, quotes, code blocks), then the inline content inside each block (emphasis, links, code spans). Following the specification means the same document gives the same result here as in other CommonMark-compliant editors.
On top of core CommonMark, the tools support the extensions in the GitHub Flavored Markdown Spec: tables, task lists, strikethrough and autolinks. Platform-specific syntax, such as callouts, wikilinks or math, is handled by the tool built for that platform, and each cheat sheet says which flavors support what.
Sanitizing the output
Markdown allows raw HTML, so a document could contain a script or an event handler. Before any preview is shown, the generated HTML is passed through an allowlist sanitizer that keeps structural elements defined in the WHATWG HTML Living Standard and removes scripts, inline event handlers and unsafe URLs, following the OWASP guidance on cross-site scripting. Opening a document you were sent is therefore safe to preview.
GFM tables
Tables follow the GFM table rules: a header row, a delimiter row whose colons set each column's alignment, and pipe-separated cells, with escaped pipes kept inside a cell. The table tools parse a table into rows and columns, let you edit or realign them, and write clean Markdown back out with padded columns.
Converting to and from spreadsheets uses the same model: CSV follows RFC 4180 quoting, so commas, quotes and line breaks inside a cell survive the round trip, and Excel, HTML, JSON and LaTeX exports are generated from the parsed rows rather than from text matching.
Exports and imports
- HTML is the sanitized output of the parser, ready to paste into a page or a CMS.
- PDF is produced by your browser's own print engine from styled HTML, so fonts, page size and margins match what you see in the preview.
- Word (.docx) files are written in the Office Open XML format, with real Word headings, lists and tables rather than pasted HTML.
- Imports (Word, HTML, PDF, rich text) go the other way: the document's structure is read on your device and mapped to the closest Markdown, and anything with no Markdown equivalent is kept as plain text.
- Markdown files are saved as UTF-8 plain text, identified by the media type in RFC 7763.
Accuracy and testing
The tools are covered by automated tests with sample documents, including edge cases from the specifications, and the site is checked in real browsers before a release. When a conversion cannot be exact, such as formatting that Markdown has no syntax for, the closest Markdown equivalent is used and the text itself is kept. Changes are listed in the changelog; if you find a document that converts wrongly, the contact page says how to report it.
Sources
- CommonMark Spec — the reference grammar for core Markdown
- GitHub Flavored Markdown Spec — tables, task lists, strikethrough and autolinks
- WHATWG HTML Living Standard — the HTML the tools produce and parse
- RFC 7763: The text/markdown Media Type — how Markdown files are identified
- RFC 4180: Common Format for CSV Files — the CSV the table tools read and write
- OWASP Cross Site Scripting Prevention Cheat Sheet — the basis for sanitizing rendered HTML
- ECMA-376 Office Open XML — the .docx format used for Word exports