marked
v17.0.6 MITA markdown parser built for speed
marked Download Trends
About marked
Marked is a high-performance JavaScript Markdown parser designed to efficiently convert Markdown text into HTML. It addresses the common need to render rich text content from a simple markup language on the web, making it an ideal choice for projects requiring fast and reliable Markdown processing. Its primary goal is speed and compliance with various Markdown specifications.
The core philosophy behind Marked centers on delivering exceptional parsing speed without compromising on accuracy, catering to developers who integrate Markdown rendering into their applications. It's built with a focus on being a robust and predictable tool for transforming Markdown, suitable for a wide range of use cases from static site generators to dynamic content delivery platforms.
Marked's API includes straightforward methods like `marked.parse(markdownString)` for basic conversion and `marked.use(options)` for advanced customization. Developers can extensively configure the parser's behavior, including enabling or disabling specific GFM (GitHub Flavored Markdown) extensions and setting up custom renderers for HTML elements. This makes it adaptable to nuanced content requirements.
Integration with various JavaScript frameworks and build tools is seamless due to its standard ES Module export and CommonJS compatibility. Marked fits well within Node.js environments for server-side rendering or pre-compiling Markdown files, and in browser environments for client-side rendering. Its inclusion in workflows that involve content management systems or documentation generators is straightforward.
With a gzipped bundle size of just 12.5 kB, Marked offers a significant performance advantage for client-side applications where load times are critical. Its recent update in April 2026 indicates ongoing maintenance, and its maturity is reflected in its widespread adoption and substantial GitHub star count of 36.8K, suggesting a stable and well-tested library.
While Marked excels at speed and GFM compliance, developers should be aware that extensive customization might require a deeper understanding of its internal workings. For extremely niche parsing requirements not covered by its extensive options or custom renderers, alternative approaches might be considered, though for the vast majority of Markdown to HTML needs, Marked provides a comprehensive solution.
When to use
- When converting user-generated Markdown content to HTML in real-time within a web application.
- When building documentation sites or README renderers that require GitHub Flavored Markdown (GFM) support.
- When server-side rendering Markdown content with Node.js to improve initial page load performance.
- When integrating Markdown parsing into static site generators that need to pre-render content.
- When aiming to minimize JavaScript bundle size by using an efficient Markdown parser with a 12.5 kB gzipped size.
- When needing to customize the HTML output for specific Markdown elements using custom renderers.
When NOT to use
- If your primary requirement is sanitizing untrusted HTML after Markdown conversion, consider a dedicated HTML sanitization library.
- If you only need to parse a very limited subset of Markdown and require an even smaller footprint, a more minimalist parser might be suitable.
- If your project involves complex, non-standard markup structures that deviate significantly from CommonMark or GFM specifications, extensive custom renderers might become cumbersome.
- If you depend on advanced features like live preview synchronization within a rich text editor, using Marked directly on the client might require additional state management logic.
- If full CommonMark specification compliance is an absolute requirement and GFM extensions are not desired, verify Marked's behavior against strict CommonMark test suites.