PHPackages                             parsedown/parsedown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. parsedown/parsedown

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

parsedown/parsedown
===================

Parser for Markdown.

1.8.0(3mo ago)21342.8k—8.6%3[1 issues](https://github.com/parsedown/parsedown/issues)3MITPHPPHP &gt;=7.1CI passing

Since Jul 10Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/parsedown/parsedown)[ Packagist](https://packagist.org/packages/parsedown/parsedown)[ Docs](http://parsedown.org)[ RSS](/packages/parsedown-parsedown/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (86)Used By (3)

Parsedown
=========

[](#parsedown)

[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/7555722c69bd2e4576b6cee9ca50aa94008ff1934bb21c5c13d0381f9687ce01/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061727365646f776e2f7061727365646f776e2f756e69742d74657374732e79616d6c3f6c6f676f3d676974687562253230616374696f6e73266c6f676f436f6c6f723d7768697465)](https://github.com/parsedown/parsedown/actions/workflows/unit-tests.yaml)[![Packagist Version](https://camo.githubusercontent.com/80fa0723353d6e9a4d23dce442c6e3827b4c65c2b319026e2c256e423e314312/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061727365646f776e2f7061727365646f776e3f6c6162656c3d737461626c65)](https://camo.githubusercontent.com/80fa0723353d6e9a4d23dce442c6e3827b4c65c2b319026e2c256e423e314312/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061727365646f776e2f7061727365646f776e3f6c6162656c3d737461626c65)[![Packagist Total Downloads](https://camo.githubusercontent.com/cd539edc1d500d6c4104a7fa0d1391d07754e525e75fedf4796676874c31923f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7061727365646f776e2f7061727365646f776e3f636f6c6f723d626c7565)](https://packagist.org/packages/parsedown/parsedown)[![GitHub License](https://camo.githubusercontent.com/1b04649c3ce36e501adaf1ad69da19a9ebd72084f5877ac61d8b05b75e32f30f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7061727365646f776e2f7061727365646f776e3f636f6c6f723d7465616c)](https://github.com/parsedown/parsedown?tab=MIT-1-ov-file#MIT-1-ov-file)[![Matrix](https://camo.githubusercontent.com/c5495be879c91b6fa6cc3d28eab44fe040fee38ef9cf163bf459fe2ddef74c9e/68747470733a2f2f696d672e736869656c64732e696f2f6d61747269782f7061727365646f776e2533416d61747269782e6f72673f6c6f676f3d656c656d656e74)](https://matrix.to/#/#parsedown:matrix.org)

Better Markdown Parser in PHP — [demo](https://parsedown.org/demo)

Note

**This is a Community-maintained Fork of the [Original Parsedown](https://github.com/erusev/parsedown)** library written by [Emanuil Rusev](https://github.com/erusev).

Features
--------

[](#features)

- One file
- No dependencies
- [Super fast](https://parsedown.org/speed)
- Extensible
- [GitHub flavored](https://github.github.com/gfm)
- [Tested](https://parsedown.org/tests/) in 7.1 to 8.5
- [Markdown Extra extension](https://github.com/erusev/parsedown-extra)

Installation
------------

[](#installation)

Install the [composer package](https://packagist.org/packages/parsedown/parsedown "The Parsedown package on packagist.org"):

```
composer require parsedown/parsedown
```

Or download the [latest release](https://github.com/parsedown/parsedown/releases/latest "The latest release of Parsedown") and include `Parsedown.php`

Example
-------

[](#example)

```
$Parsedown = new Parsedown();

echo $Parsedown->text('Hello _Parsedown_!'); # prints: Hello Parsedown!
```

You can also parse inline markdown only:

```
echo $Parsedown->line('Hello _Parsedown_!'); # prints: Hello Parsedown!
```

More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](https://youtu.be/wYZBY8DEikI).

Security
--------

[](#security)

Parsedown is capable of escaping user-input within the HTML that it generates. Additionally Parsedown will apply sanitisation to additional scripting vectors (such as scripting link destinations) that are introduced by the markdown syntax itself.

To tell Parsedown that it is processing untrusted user-input, use the following:

```
$Parsedown->setSafeMode(true);
```

If instead, you wish to allow HTML within untrusted user-input, but still want output to be free from XSS it is recommended that you make use of a HTML sanitiser that allows HTML tags to be whitelisted, like [HTML Purifier](http://htmlpurifier.org/).

In both cases you should strongly consider employing defence-in-depth measures, like [deploying a Content-Security-Policy](https://scotthelme.co.uk/content-security-policy-an-introduction/) (a browser security feature) so that your page is likely to be safe even if an attacker finds a vulnerability in one of the first lines of defence above.

Safe mode does not necessarily yield safe results when using extensions to Parsedown. Extensions should be evaluated on their own to determine their specific safety against XSS.

Escaping HTML
-------------

[](#escaping-html)

> WARNING: This method is not safe from XSS!

If you wish to escape HTML in trusted input, you can use the following:

```
$Parsedown->setMarkupEscaped(true);
```

Beware that this still allows users to insert unsafe scripting vectors, ex: `[xss](javascript:alert%281%29)`.

Frequently Asked Questions
--------------------------

[](#frequently-asked-questions)

### How does Parsedown work?

[](#how-does-parsedown-work)

It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a `-` then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).

We call this approach "line based". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.

### Is it compliant with CommonMark?

[](#is-it-compliant-with-commonmark)

It passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve.

### Who uses it?

[](#who-uses-it)

[Laravel Framework](https://laravel.com/), [Bolt CMS](https://boltcms.io), [Grav CMS](https://getgrav.org/), [Herbie CMS](https://herbie.tebe.ch/), [Kirby CMS](https://getkirby.com/), [October CMS](https://octobercms.com/), [Pico CMS](https://picocms.org), [Statamic CMS](https://www.statamic.com/), [phpDocumentor](https://www.phpdoc.org/), [RaspberryPi.org](https://www.raspberrypi.org/), [Symfony Demo](https://github.com/symfony/demo)and [more](https://packagist.org/packages/erusev/parsedown/dependents).

### How can I help?

[](#how-can-i-help)

Use it, star it, share it and if you feel generous, [donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=528P3NZQMP8N2).

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 56.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~341 days

Total

85

Last Release

91d ago

Major Versions

0.9.4 → 1.0.0-rc.12014-04-17

1.7.4 → 2.0.x-dev2022-05-21

PHP version history (3 changes)1.6.1PHP &gt;=5.3.0

2.0.x-devPHP ^7.1||^8.0

1.8.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e0f163cff45d47762e6352bac467f6b33badfd78b12817fe37f086d467ae71d?d=identicon)[dregad](/maintainers/dregad)

![](https://www.gravatar.com/avatar/6cd931e3b6a93cc893618a2ffaf14728bec5727d72d854953fd13aa92d20b2ff?d=identicon)[eagostini](/maintainers/eagostini)

---

Top Contributors

[![erusev](https://avatars.githubusercontent.com/u/184170?v=4)](https://github.com/erusev "erusev (513 commits)")[![aidantwoods](https://avatars.githubusercontent.com/u/3288888?v=4)](https://github.com/aidantwoods "aidantwoods (246 commits)")[![dregad](https://avatars.githubusercontent.com/u/449891?v=4)](https://github.com/dregad "dregad (34 commits)")[![PhrozenByte](https://avatars.githubusercontent.com/u/920356?v=4)](https://github.com/PhrozenByte "PhrozenByte (28 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (20 commits)")[![naNuke](https://avatars.githubusercontent.com/u/4591126?v=4)](https://github.com/naNuke "naNuke (7 commits)")[![rhukster](https://avatars.githubusercontent.com/u/1084697?v=4)](https://github.com/rhukster "rhukster (6 commits)")[![wkpark](https://avatars.githubusercontent.com/u/232347?v=4)](https://github.com/wkpark "wkpark (6 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (5 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (4 commits)")[![Daniel-KM](https://avatars.githubusercontent.com/u/2138485?v=4)](https://github.com/Daniel-KM "Daniel-KM (4 commits)")[![xPaw](https://avatars.githubusercontent.com/u/613331?v=4)](https://github.com/xPaw "xPaw (3 commits)")[![Ayesh](https://avatars.githubusercontent.com/u/811553?v=4)](https://github.com/Ayesh "Ayesh (3 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (3 commits)")[![jmsv](https://avatars.githubusercontent.com/u/14852491?v=4)](https://github.com/jmsv "jmsv (3 commits)")[![KaneCohen](https://avatars.githubusercontent.com/u/578455?v=4)](https://github.com/KaneCohen "KaneCohen (3 commits)")[![luizbills](https://avatars.githubusercontent.com/u/1798830?v=4)](https://github.com/luizbills "luizbills (2 commits)")[![grogy](https://avatars.githubusercontent.com/u/1322983?v=4)](https://github.com/grogy "grogy (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (2 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (2 commits)")

---

Tags

parsermarkdown

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/parsedown-parsedown/health.svg)

```
[![Health](https://phpackages.com/badges/parsedown-parsedown/health.svg)](https://phpackages.com/packages/parsedown-parsedown)
```

###  Alternatives

[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

3.0k404.0M702](/packages/league-commonmark)[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.8M192](/packages/erusev-parsedown-extra)[tovic/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5933.7k](/packages/tovic-parsedown-extra-plugin)[taufik-nurrohman/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5932.3k](/packages/taufik-nurrohman-parsedown-extra-plugin)[benjaminhoegh/parsedown-toc

Table of Contents Extension for Parsedown.

2133.6k4](/packages/benjaminhoegh-parsedown-toc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
