PACKAGE · MARKDOWN

marked

A markdown parser built for speed

WEEKLY DOWNLOADS 22.8M
STARS 36.9K
FORKS 3.5K
OPEN ISSUES 8
GZIP SIZE 12.7 kB
UNPACKED SIZE 450.3 kB
DEPENDENCIES 1
LAST UPDATED 3mo ago
DOWNLOAD TRENDS

marked downloads — last 12 months

Download trends for marked1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.045.6M91.1M136.7M182.3MJun 2025SepDecMarMay 2026
marked
ABOUT MARKED

Marked is a high-performance JavaScript library designed to parse Markdown text and convert it into HTML. It addresses the common need for rendering user-generated content or documentation formatted in Markdown within web applications, offering a fast and reliable conversion process. By abstracting away the complexities of Markdown syntax, Marked enables developers to seamlessly integrate rich text formatting into their applications without manual HTML generation.

Developed with speed as a primary design goal, Marked caters to developers who require efficient parsing of Markdown content, especially in performance-sensitive environments. Its focus on speed and adherence to specifications makes it a suitable choice for a wide range of applications, from blogs and documentation sites to content management systems. The library aims to provide a robust parsing engine that is both fast and compliant with established Markdown standards.

The core API of Marked is straightforward, primarily centered around the `marked.parse()` function. This function takes a Markdown string as input and returns the corresponding HTML string. Marked also provides extensibility through options that can be passed to the `parse` function, allowing customization of the rendering process. Developers can hook into the tokenization or apply custom rules, offering a degree of flexibility for advanced use cases.

Marked integrates easily into various JavaScript workflows and frameworks. It can be used directly in Node.js environments for server-side rendering or static site generation. In browser environments, it can be included via a script tag or imported as an ES module, making it compatible with front-end frameworks like React, Vue, and Angular. Its commonmark and GFM (GitHub Flavored Markdown) support also means it fits well into workflows that generate content based on these popular dialects.

With a weekly download count of 46.2 million, Marked is a mature and widely used library. Its relatively small bundle size of 12.7 kB (gzipped) makes it an attractive option for front-end applications where payload size is a concern. The library has seen consistent updates, with the latest version as of this writing being 18.0.5, indicating ongoing maintenance and development.

While Marked is highly efficient, developers should be aware that its primary focus is on speed and standard compliance. For extremely complex or niche Markdown extensions, or when specific sanitization requirements beyond basic HTML output are paramount, developers might need to supplement Marked with additional libraries or custom logic. The 10 open issues suggest that while stable, there are areas for ongoing improvement or feature requests within the community.

WHEN TO USE
  • When converting user-submitted Markdown content in a CMS or forum to HTML for display.
  • When generating static documentation sites from Markdown files using a Node.js build process.
  • When integrating Markdown previews in real-time within a text editor component using the `marked.parse()` function.
  • When rendering GitHub Flavored Markdown (GFM) in an application, leveraging its built-in support.
  • When optimizing for fast Markdown parsing in server-side rendering scenarios for improved response times.
  • When bundling front-end JavaScript and minimizing the impact of third-party libraries due to its 12.7 kB gzipped size.
WHEN NOT TO USE
  • If your Markdown parsing needs are extremely basic and can be handled by simpler string replacements, consider a custom function to avoid dependency.
  • If you require highly specialized, non-standard Markdown extensions not covered by GFM, you may need to manually extend Marked's rules or use a different parser.
  • When your primary requirement is extreme security sanitization of arbitrary HTML, consider a dedicated HTML sanitization library in conjunction with Marked.
  • If you are building a browser-only application and absolute smallest possible bundle size is critical, investigate lighter alternatives specifically optimized for browser environments.
  • When integrating with complex WYSIWYG editors that output their own proprietary HTML format, as Marked is designed for Markdown conversion, not arbitrary HTML manipulation.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 4
marked vs shiki ★ 13.4K · 7.8M/wk marked vs rehype ★ 2.2K · 2.0M/wk marked vs remark ★ 8.7K · 2.2M/wk marked vs @mdx-js/react ★ 19.6K · 7.9M/wk