37,299
stars
+4
3,825
forks
378
watchers
2,336
prs
1,697
issues
187
releases
134
discussions
README
Marked
- ⚡ built for speed
- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
- 🛠️ easily adaptable with custom extensions
- 🌐 works in a browser, on a server, or from a command line interface (CLI)
Demo
Check out the demo page to see Marked in action ⛹️
Docs
Our documentation pages are also rendered using marked 💯
Also read about:
Options
Extensibility
Compatibility
Node.js: Only current and LTS Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
Browser: Baseline Widely Available
Installation
CLI:
sh
npm install -g marked
In-browser:
sh
npm install marked
Usage
Warning: 🚨 Marked does not sanitize the output HTML. Please use a sanitize library, like DOMPurify (recommended), sanitize-html or insane on the output HTML! 🚨
DOMPurify.sanitize(marked.parse());
CLI
bash
Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html
hello world
bash
Print all options
$ marked --help
Node.js
js
import { marked } from 'marked';
const html = marked.parse(' Marked in Node.js');
console.log(html);
Browser
html
Marked in the browser
document.getElementById('content').innerHTML =
marked.parse(' Marked in the browser\n\nRendered by marked.');
or import esm module
html
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
document.getElementById('content').innerHTML =
marked.parse(' Marked in the browser\n\nRendered by marked.');
License
Copyright (c) 2018+, MarkedJS. (MIT License)
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)Top issues
#4050CommonMark spec gaps grouped by root cause, and a question about lookup tables21 comments · 2026-08-10#2355Measured performance decrease between major releases of Marked, time for a performance pass?12 comments · 2022-01-12#3435Support custom extensions "interrupting" built-in tokens4 comments · 2024-08-29#1225Markdown flavors + options3 comments · 2018-04-16#4184Tab inside a fenced code block in a block quote is expanded to spaces (regression in 18.1.2)2 comments · 2026-11-02#4176Code span inside link text drops the backslash or ends the link early (\], \[, backtick)2 comments · 2026-11-01#3996Bug: Architectural deviations from CommonMark specification2 comments · 2026-06-17#3590Select Extension priority2 comments · 2025-01-15
Discussions
#4186Organization membership request after contributing #41771 comments · 2026-11-03#4143CurlShot API docs rendered with marked: async walkTokens for highlighting, TOC from the heading renderer0 comments · 2026-10-17#4136NOS: Markdown notes rendered with Marked, kept beside the HTML pages you share0 comments · 2026-10-12#3988Showcase: A 3.5KB zero-dependency TeX-to-MathML compiler for supercharging math rendering in Marked1 comments · 2026-06-07#3980Markdown is not LaTeX1 comments · 2026-05-27#3878How to pass walkTokens each time differently?1 comments · 2026-01-24#3845🍮 Vanilla(static)CMS – Content management system0 comments · 2025-11-23#3799Support for GitHub Admonitions (i.e. [!Tip] block and other blocks)?1 comments · 2025-10-11
Latest release
v18.1.3 v18.1.3 2026-11-0218.1.3 (2026-11-02) Bug Fixes allow trailing tabs after a setext heading underline (4152) (1f1b480) avoid quadratic scan for unmatched emphasis delimiters (4103) (eab1e48), closes 4099 await promise arrays from walkTokens extensions (4153) (c38704c) cli: honor defaults and config when outputting tokens (4146) (9470e8f) collapse internal whitespace when normalizing link labels (4157) (02c73e8) do not allow a blank line inside a link reference definition label (4165) (f3d21af) don't treat an escaped ) or quote as an inline link or title closer (4151) (9cb84e0) end a list item before