JavaScript & TypeScript

Markdown libraries for the browser and Node.js. Each renders the same core syntax; they differ mainly in size, speed and whether you want plain HTML or an AST to transform. Back to the overview.

markdown-it

Fast, CommonMark-compliant and highly pluggable — the engine behind many editors.

CommonMarkplugins
import MarkdownIt from 'markdown-it'

const md = new MarkdownIt()
const html = md.render('# Hello *world*')

View markdown-it →

marked

Tiny and very quick, with no dependencies — ideal for running in the browser.

lightweightbrowser
import { marked } from 'marked'

const html = marked.parse('# Hello *world*')

View marked →

remark

Markdown as an abstract syntax tree you can inspect and transform; part of the unified ecosystem.

ASTunified
import { remark } from 'remark'
import remarkHtml from 'remark-html'

const file = await remark()
  .use(remarkHtml)
  .process('# Hello *world*')

console.log(String(file))

View remark →

micromark

A small, CommonMark- and GFM-compliant tokenizer; the low-level core that powers remark.

CommonMarkGFM
import { micromark } from 'micromark'

const html = micromark('# Hello *world*')

View micromark →