What it does
Marked is a Markdown compiler for JavaScript projects and a command-line tool. It parses supported Markdown flavors into HTML or tokens and can be extended with custom renderers, tokenizers and hooks. Teams use it to turn authored Markdown into page content or build-time output. Marked deliberately focuses on parsing rather than HTML sanitization, so applications processing untrusted text need a separate security step.
For a documentation site, keep Markdown as the authoring format and call marked.parse during rendering or a build step. The CLI can also read a Markdown file and write generated HTML, which is useful for a small conversion task. Extensions let a project adjust tokenization or rendering for its own syntax.
Marked's security warning is important: generated HTML is not sanitized. If user-submitted Markdown is rendered, pass the output through an appropriate sanitizer before inserting it into a page. Parsing and sanitization solve different problems. The documentation also describes supported Markdown flavors and extensions, so check the parser behavior against the content format a site expects.
Strengths
- The project offers both a JavaScript parser and a command-line interface for converting Markdown.
- Custom extensions, renderers, tokenizers and hooks provide ways to adapt parsing to a project's needs.
Watch out for
- Marked does not sanitize generated HTML; untrusted input needs a separate sanitization step before it is displayed.
- The parser's supported Markdown flavors and extensions should be checked against the format required by a particular project.
Best for
- Rendering trusted Markdown in a JavaScript application or documentation build.
- Converting Markdown files to HTML from a command line.
Sources
- Marked documentation and usage (Oct 26, 2026)
- markedjs/marked official repository (Oct 26, 2026)
- Marked MIT license (Oct 26, 2026)
