markedjs /marked

A markdown parser and compiler. Built for speed.

★ 37,299⑂ 3,825👁 378⑃ 2,336● 1,697▤ 187◈ 134
TypeScriptNOASSERTIONCreated 2011-07-24marked.js.org
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

Discussions

Latest release

v18.1.3 v18.1.3 2026-11-02
18.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 

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON