Marked parses Markdown and compiles it to HTML for browsers, servers, and the command line. It implements common Markdown, CommonMark, and GitHub Flavored Markdown features with extension hooks.
Overview
Marked is a markdown parser and compiler aimed at speed and a small footprint. It parses markdown without long blocking caches, implements features from supported flavors and specifications, and can be extended with custom rules. The same engine runs in browsers, on servers, and via a global CLI.
Installation is available through npm for library use or a global CLI. The CLI reads stdin, strings, or files and can load JSON or JavaScript configuration for default parse options. Marked actively tracks compliance tables for Markdown 1.0, CommonMark, and GitHub Flavored Markdown, including tables, task lists, and strikethrough where listed.
The project documents that output HTML is not sanitized automatically; callers are advised to run a separate sanitizer such as DOMPurify on untrusted input. Zero runtime dependencies are claimed, and many third-party tools list Marked for on-the-fly markdown rendering.
Advanced configuration and extension APIs allow tailoring rendering behavior, and the official documentation site itself is rendered using Marked according to project notes.
Key features
- Markdown to HTML compilation
- CommonMark and GFM flavor support
- Browser, Node.js, and CLI usage
- Custom extension hooks
- Tree-friendly single-purpose parser
- CLI config via JSON or JS files
- No bundled sanitizer on output
- Zero stated runtime dependencies
Use cases
- Rendering README and docs sites
- In-browser markdown preview components
- Build-step HTML generation in CI
- CLI conversion of markdown files
- Embedding markdown in static site tools