A super-fast TypeScript/JavaScript compiler and parser written in Rust, usable from Rust and from JavaScript.
markedjs/marked
A fast, low-level markdown parser and compiler for JavaScript that runs in browsers, Node.js, and the command line.
- Stars
- 37,253
- Forks
- 3,784
- Open issues
- 33
- Last commit
- 21 hours ago
What is it?
Marked is a markdown parser and compiler written in TypeScript. It converts markdown text into HTML and is designed to be lightweight, implementing the features of the supported markdown flavors and specifications without caching or blocking for long periods.
It can be used in three ways: as an npm package in Node.js, bundled into a browser page via a CDN script or ES module, or through the marked CLI to convert files and stdin into HTML. The library is extensible through custom extensions that hook into its parsing pipeline.
Because Marked does not sanitize its output, the project recommends running the generated HTML through a sanitizer such as DOMPurify before inserting it into a page.
Key features
- 01Parses markdown and compiles it to HTML.
- 02Implements the features of supported markdown flavors and specifications.
- 03Extensible through custom extensions.
- 04Works in browsers, on Node.js servers, and from the command line.
- 05Lightweight, with no caching layer.
Use cases
- Rendering markdown content such as blog posts or documentation in a web page.
- Converting markdown files to HTML from a shell script or build step.
- Adding markdown rendering to a Node.js backend or static site generator.
Quick start
- 1
Install the marked CLI globally with npm
npm install -g marked - 2
Convert markdown from stdin to HTML with the CLI
marked -o hello.html
Things to know
- Does not sanitize output HTML, so a separate sanitizer like DOMPurify is required for untrusted input.
- Only current and LTS Node.js versions are supported.
Topics
FAQ
- What is marked?
- A fast, low-level markdown parser and compiler for JavaScript that runs in browsers, Node.js, and the command line. Marked is a markdown parser and compiler written in TypeScript. It converts markdown text into HTML and is designed to be lightweight, implementing the features of the supported markdown flavors and specifications without caching or blocking for long periods.
- Is marked free to use? What license does it have?
- marked is open source under the Other license. Check the license terms before using it in commercial products.
- Is marked still maintained?
- Actively maintained. The last commit to marked was on Oct 21, 2026.
- What can I use marked for?
- Rendering markdown content such as blog posts or documentation in a web page. Converting markdown files to HTML from a shell script or build step. Adding markdown rendering to a Node.js backend or static site generator.
- How do I install marked?
- Install the marked CLI globally with npm: npm install -g marked Convert markdown from stdin to HTML with the CLI: marked -o hello.html
- Where can I get marked?
- The source code and installation instructions are on GitHub: https://github.com/markedjs/marked
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A collection of high-performance JavaScript and TypeScript tools written in Rust, including a parser, linter, formatter, transformer, minifier and resolver.
Universal markup converter, a Haskell library and CLI that converts documents between dozens of markup formats such as Markdown, HTML, LaTeX, and DOCX.
Renders markdown into responsive, email-safe HTML that works across major email clients, plus a plain-text version.
A compiler toolchain that turns C and C++ code into WebAssembly so it can run in browsers, Node.js and other Wasm runtimes.
A TypeScript-like language and compiler that turns a typed subset of TypeScript into WebAssembly modules.