Download Rehype

rehype is a JavaScript library, not a desktop application. There is no .exe, .dmg or app installer. You either install the package with npm, or download the source code from the official GitHub repository.

Ways to get rehype compared
OptionWhat you getUse it whenOfficial source
npm package rehypeThe library, ready to import in Node.js code. npm installs its dependencies.You are writing a script, build step or app that processes HTML.npmjs.com/package/rehype (opens in a new tab)
npm package rehype-cliA rehype terminal command for processing files.You want to format, minify or check HTML files without writing code.npmjs.com/package/rehype-cli (opens in a new tab)
Source codeThe monorepo: rehype, rehype-parse, rehype-stringify and rehype-cli sources, tests and docs.You want to read the code, debug it, or contribute.github.com/rehypejs/rehype (opens in a new tab)

Option 1: install the npm package (recommended)

For almost everyone, “downloading rehype” means adding it to a project with npm. Run this inside your project folder (the folder with package.json):

Terminal
npm install rehype

rehype is ESM only: it exports a named function, rehype, and has no default export. Use import in a module (a .mjs file, or "type": "module" in package.json):

example.mjs
import {rehype} from 'rehype'
import rehypeFormat from 'rehype-format'

const input = `<!doctype html><html lang=en><head><title>Demo</title></head>
<body><main><h1>Hello</h1><p>Formatted by <b>rehype</b>.</p></main></body></html>`

const file = await rehype().use(rehypeFormat).process(input)

console.log(String(file))

That example also uses rehype-format (npm install rehype-format). Running it with node example.mjs prints:

Output Output
<!doctype html>
<html lang="en">
  <head>
    <title>Demo</title>
  </head>
  <body>
    <main>
      <h1>Hello</h1>
      <p>Formatted by <b>rehype</b>.</p>
    </main>
  </body>
</html>

The rehype readme states that the current release line, rehype@^13, is kept compatible with Node.js 16 and later. For the current version number, check the npm page (opens in a new tab); this site does not mirror version numbers that would go stale. Step-by-step instructions are in Install rehype with npm.

Option 2: install rehype-cli

rehype-cli provides a command called rehype. Install it locally in a project together with the plugins you want to run:

Terminal
npm install rehype-cli rehype-format

Then format a file in place (the --output flag without a path writes back to the same file):

Terminal
npx rehype index.html --use rehype-format --output

The full option list is in the official rehype-cli documentation (opens in a new tab). Our rehype-cli setup page walks through tested commands.

Option 3: download the source code

The official repository is github.com/rehypejs/rehype (opens in a new tab). Its default branch is main (checked on November 11, 2026). You can clone it with Git:

Terminal
git clone https://github.com/rehypejs/rehype.git
cd rehype
npm install
npm test

Or download a ZIP archive of the main branch directly from GitHub:

Download source ZIP (main branch, from GitHub) (opens in a new tab)

The source ZIP is not an installable application. It contains JavaScript source files, tests and documentation. To use rehype in a project, install it from npm instead. To run the tests from source, you need Node.js and npm.

The archive link points to GitHub's own archive service for the current main branch, so its contents change as the project changes. Releases and their notes are listed on the GitHub releases page (opens in a new tab).

What this site does not offer

  • No mirrors or re-hosted copies. Every download link goes to GitHub or npm.
  • No installers, EXE, DMG or APK files. rehype does not have any.
  • No download counters, “latest version” badges or popularity numbers, because we would have to make them up or let them go stale.

License

rehype is released under the MIT License; the license file in the official repository names Titus Wormer as the copyright holder, and the project is developed by many contributors in the unified collective. Plugins have their own licenses; most rehype plugins are MIT, a few (such as the rehype-dom packages) are ISC.

Use ↑ ↓ to move, Enter to open.