On this page
Overview
Marked is a Markdown parser and compiler that converts Markdown into HTML. It is designed as a lightweight low-level parser for Node.js, browsers, and CLI workflows, with options and custom extensions for adapting tokenization and rendering.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Convert Markdown strings to HTML with marked.parse
In Node.js, pass Markdown text to marked.parse() to produce HTML. The package also ships browser-oriented UMD and ESM builds for client-side rendering.
Convert standard input or files from the CLI
The globally installed marked command can read Markdown and write HTML with -o; marked --help lists available command-line options.
Sources: [1]
Extend parsing and rendering with options and custom extensions
The official documentation exposes configuration options and an extension system so projects can add custom tokenizers, renderers, and related Markdown processing behavior.
Sources: [1]
Best fit
Fits Markdown previews, documentation, and content-conversion pipelines
It is useful when server-side conversion, browser previews, and CLI batch workflows should share a compact Markdown parser.
Sources: [1]
Before adoption
Generated HTML is not sanitized
The README explicitly states that Marked does not sanitize its output and recommends sanitizers such as DOMPurify or sanitize-html. Untrusted Markdown output should not be inserted into the DOM without sanitization.
Sources: [1]
Official sources
- [1]Marked v18.0.14 README(2026-10-05)
- [2]Marked v18.0.14 package metadata(2026-10-05)
- [3]Marked v18.0.14 release(2026-10-05)
- [4]Marked MIT license(2026-10-05)
Supplemental curator note
Marked makes it easy to share Markdown-to-HTML parsing across Node.js, browsers, and CLI workflows, but sanitizing generated HTML is explicitly outside its responsibility. When rendering untrusted input, plan to pair it with a sanitizer such as DOMPurify as the README recommends.
Try it in 3 steps
- 1
Check Node.js and install Marked 18.0.14
Verify the package's Node.js 20+ requirement and pin the stable release in a temporary directory.
node -e 'if (Number(process.versions.node.split(".")[0]) < 20) throw new Error("Marked 18 requires Node.js >= 20")' && demo=$(mktemp -d "${TMPDIR:-/tmp}/marked.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact marked@18.0.14 - 2
Create a script that converts Markdown to HTML
Follow the README's Node.js usage pattern with
marked.parse()and convert a heading plus strong text.printf "%s\n" "import { marked } from 'marked';" "const html = marked.parse('# Hello **Marked**');" "console.log(html);" "if (!html.includes('<strong>Marked</strong>')) throw new Error('unexpected output');" > demo.mjs - 3
Run the conversion and verify the output
Print the generated HTML and let the script assert that
<strong>Marked</strong>is present.node demo.mjs
Growth
Growth trends · Last 30 days
37,223 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 29
- Open PRs
- 14
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- markdown
- compiler
- parser
- commonmark
- gfm
- hacktoberfest
- Stars
- 37,223
- Forks
- 3,747
- Watchers
- 384
- Open issues
- 12
- Contributors
- 233
- Owner type
- Organization
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Oct 5, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- melonJS6,401 Stars
3 shared tag(s)
Build browser-based 2D and 2.5D games through one API across WebGPU, WebGL 2, and Canvas
JavaScript - Mermaid90,537 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Generate flowcharts, sequences, classes, ER diagrams, Gantt charts, and more from text syntax
TypeScript - Vite83,152 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Combine a native-ESM dev server and HMR with Rolldown-powered production builds
TypeScript - Redux61,484 Stars
2 shared tag(s) · 1 shared category(s) · Same language
make shared-state updates explicit with stores/actions/reducers, while modern code uses Toolkit
TypeScript - Zustand58,786 Stars
2 shared tag(s) · 1 shared category(s) · Same language
manage React state with provider-free hook stores and subscribe through selectors
TypeScript - date-fns36,649 Stars
2 shared tag(s) · 1 shared category(s) · Same language
format, compare, and calculate JavaScript dates with small pure functions
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.