JavaScript Markdown parser libraries

Updated Nov 2026

JavaScript Markdown parsers read Markdown text and turn it into HTML, a syntax tree, or UI components. These libraries render documentation, comments, and the Markdown that language models return in chat replies.

Popularity

marked has the most monthly downloads in this comparison, at 486.2M.

LibraryMonthly downloadsStarsLast releaseLicense
marked
486.2M
37.3KNov 2026MIT
micromark
363.2M
2.2KSep 2026MIT
mdast-util-from-markdown
353.9M
296Oct 2026MIT
remark-parse
315.7M
9.0KSep 2023MIT
markdown-it
153.0M
22.0KOct 2026MIT
remark
37.7M
9.0KSep 2023MIT
@lezer/markdown
32.0M
147Oct 2026MIT
markdown-to-jsx
23.6M
2.4KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

marked compiles Markdown to HTML in the browser, on a server, or from its command-line tool. marked.parse returns an HTML string, and marked.use adds extensions that change how text is split into tokens or how tokens become HTML. A walkTokens hook visits every token before output, and with the async option on it can wait on asynchronous work. marked doesn't sanitize the HTML it produces, so output from untrusted Markdown goes through a sanitizer such as DOMPurify.

Downloads / mo
486.2M
Stars
37.3K
Last release
18.2.1
License
MIT

Strengths

  • Supports asynchronous token work. With async on, parse waits for walkTokens work before returning.
  • Extends tokenization and rendering. marked.use registers custom syntax and renderers.

Limitations

  • HTML output needs sanitizing. Output from untrusted Markdown needs a sanitizer such as DOMPurify.
  • Default settings are shared globally. A separate Marked instance keeps its own options and extensions.

Quickstart

From README.md
$ npm install marked@18.2.1
import { marked } from 'marked';

console.log(marked.parse('# Hello', { async: false }));

marked examples

From open-source projects on GitHub

micromark is a small CommonMark parser that also supports GitHub Flavored Markdown, MDX, math, and frontmatter through extensions. It runs as a state machine that emits concrete tokens with the position of every byte, then compiles those tokens straight to HTML. micromark takes a Markdown string and returns HTML, and raw HTML in the input stays escaped unless allowDangerousHtml is set. The tokens also feed mdast-util-from-markdown, which builds the syntax trees that remark uses.

Downloads / mo
363.2M
Stars
2.2K
Last release
4.0.3
License
MIT

Strengths

  • Tracks every byte. Each token records its exact position in the source text.
  • Escapes HTML by default. Raw HTML in the input stays escaped unless allowDangerousHtml is set.

Quickstart

From readme.md
$ npm install micromark@4.0.3
import { micromark } from 'micromark';

console.log(micromark('# Hello'));

micromark examples

From open-source projects on GitHub

mdast-util-from-markdown

mdast-util-from-markdown turns Markdown into an mdast syntax tree, a JSON structure with one node per heading, paragraph, link, and other element. fromMarkdown takes a string and returns the tree, using micromark's tokens underneath. Extensions add syntax such as GitHub Flavored Markdown or frontmatter. The function only parses, so other utilities turn the tree back into Markdown or HTML, and remark-parse wraps it for use in a unified pipeline.

Downloads / mo
353.9M
Stars
296
Last release
2.1.0
License
MIT

Strengths

  • Tree from one call. fromMarkdown returns an mdast tree with no processor or plugin setup.

Limitations

  • Parsing only. Turning the tree into HTML or Markdown takes other utilities, or remark.

Quickstart

From readme.md
$ npm install mdast-util-from-markdown@2.1.0
import { fromMarkdown } from 'mdast-util-from-markdown';

const tree = fromMarkdown('# Hello');
console.log(JSON.stringify(tree, null, 2));

mdast-util-from-markdown examples

From open-source projects on GitHub
export function parseGfmWithMath(text: string): Root {
  return recoverLocalImages(fromMarkdown(text, {
    extensions: [gfm(gfmOptions), cjkFriendlyStrong(), mathCompatibility(), math()],
    mdastExtensions: [gfmFromMarkdown(), mathFromMarkdown(), windowsPathDestinations()],
  }), text)
}

remark-parse is the plugin that adds Markdown parsing to unified, a framework that runs content through parse, transform, and output steps. unified().use(remarkParse) reads Markdown into an mdast syntax tree, and further plugins inspect or change that tree. remark-parse handles input only: writing Markdown back out needs remark-stringify, and the remark package combines both with unified. Syntax extensions such as remark-gfm plug in alongside it.

Downloads / mo
315.7M
Stars
9.0K
Last release
11.0.0
License
MIT

Strengths

  • Plugs into unified. unified().use(remarkParse) adds Markdown input to any unified processor.

Limitations

  • Input side only. Writing Markdown back out needs remark-stringify, or the remark package, which includes both.

Quickstart

From readme.md
$ npm install remark-parse@11.0.0 unified@11.0.5
import { unified } from 'unified';
import remarkParse from 'remark-parse';

const tree = unified().use(remarkParse).parse('# Hello');
console.log(JSON.stringify(tree, null, 2));

remark-parse examples

From open-source projects on GitHub

markdown-it follows the CommonMark spec and adds extensions such as URL autolinking and typographic replacements. new MarkdownIt() creates a parser, and render turns Markdown into HTML in one call. parse returns the token array instead, so code can inspect or change tokens before rendering. Rules can be added or replaced, and community plugins add syntax such as footnotes. Raw HTML in the input is off by default, and the html option turns it on.

Downloads / mo
153.0M
Stars
22.0K
Last release
15.0.3
License
MIT

Strengths

  • Allows custom parsing rules. Rules can be added, or existing ones replaced.
  • Exposes tokens before rendering. parse returns the token array before rendering.

Limitations

  • Raw HTML starts disabled. The html option turns raw HTML tags on.
  • Enabled HTML needs sanitizing. With HTML on, the output needs an external sanitizer.

Quickstart

From README.md
$ npm install markdown-it@15.0.3
import MarkdownIt from 'markdown-it';

const parser = new MarkdownIt();
console.log(parser.render('# Hello'));

markdown-it examples

From open-source projects on GitHub

remark transforms Markdown with plugins that inspect and change an mdast syntax tree. The remark package combines unified with remark-parse and remark-stringify, so one processor reads Markdown, runs plugins, and writes Markdown back out. remark().process returns the result as a file. HTML output takes a plugin such as remark-html, and GitHub Flavored Markdown features such as tables come from remark-gfm. The project lists more than a hundred plugins, and remark-cli checks and formats Markdown files from the command line.

Downloads / mo
37.7M
Stars
9.0K
Last release
15.0.1
License
MIT

Strengths

  • Produces Markdown after changes. One processor parses Markdown and writes it back out.
  • Exposes a document syntax tree. Plugins work on the mdast tree between parsing and output.

Limitations

  • HTML output needs a plugin. HTML output takes a compiler plugin such as remark-html.
  • GFM syntax needs a plugin. remark-gfm adds tables and task lists.

Quickstart

From readme.md
$ npm install remark@15.0.1
import { remark } from 'remark';

const file = await remark().process('# Hello');
console.log(String(file));

remark examples

From open-source projects on GitHub
export default async function markdownToHtml(markdown: string) {
  const result = await remark().use(html).process(markdown);
  return result.toString();
}

@lezer/markdown

@lezer/markdown is an incremental CommonMark parser built for code editors. It produces compact Lezer syntax trees and reuses parts of the previous tree when the text changes, so an edit reparses only what changed. parser.parse returns the tree, and configure adds extensions. The parser doesn't produce HTML and doesn't check that link references exist. CodeMirror's Markdown language package uses it for highlighting and editing support.

Downloads / mo
32.0M
Stars
147
Last release
1.8.1
License
MIT

Strengths

  • Incremental parsing. Reuses parts of the previous tree, so edits reparse only what changed.

Limitations

  • No HTML output. Returns a syntax tree only, for editors such as CodeMirror.
  • Unchecked link references. Parses [a][b] as a link even when no [b] reference exists.

Quickstart

From README.md
$ npm install @lezer/markdown@1.8.1
import { parser } from '@lezer/markdown';

const tree = parser.parse('# Hello');
console.log(tree.toString());

@lezer/markdown examples

From open-source projects on GitHub

markdown-to-jsx

markdown-to-jsx compiles Markdown, including GitHub Flavored Markdown tables and task lists, into React elements. Inline HTML in the Markdown is parsed into JSX, so rendering needs no dangerouslySetInnerHTML. The overrides option replaces any tag with a custom component or adds props to it. Separate entry points output HTML strings, Markdown, a syntax tree, or elements for React Native, SolidJS, and Vue.

Downloads / mo
23.6M
Stars
2.4K
Last release
9.10.6
License
MIT

Strengths

  • HTML becomes JSX. Inline HTML renders as React elements, with no dangerouslySetInnerHTML.
  • Overridable tags. The overrides option swaps any tag for a custom component or adds props.

Quickstart

From README.md
$ npm install markdown-to-jsx@9.10.6
import { compiler } from 'markdown-to-jsx/html';

console.log(compiler('# Hello'));

markdown-to-jsx examples

From open-source projects on GitHub

FAQ

To turn Markdown into HTML, use marked or markdown-it. marked output needs a sanitizer such as DOMPurify for untrusted input, while markdown-it disables raw HTML by default. To inspect or change documents with plugins, use remark. In React, markdown-to-jsx renders Markdown as components.

markdown-to-jsx turns Markdown into React elements and parses inline HTML into JSX, so the page needs no dangerouslySetInnerHTML. Its overrides option replaces any rendered tag with a custom component.

micromark is a small CommonMark parser that turns Markdown into tokens, with the position of every byte, and compiles them straight to HTML. Raw HTML in the input stays escaped unless allowDangerousHtml is set. mdast-util-from-markdown and remark build their syntax trees from micromark's tokens.

Both turn Markdown into HTML in one call and accept extensions. markdown-it disables raw HTML by default and returns its token array from parse. marked passes HTML through without sanitizing, and its walkTokens hook can run asynchronous work before output.

No. marked doesn't sanitize its output, and its README recommends running the HTML through a sanitizer such as DOMPurify, sanitize-html, or insane.

For coding agents

Found your Markdown parser library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official