# prettier

> Prettier is an opinionated code formatter

Latest version **3.9.6** (published 2026-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install prettier
pnpm add prettier
yarn add prettier
bun add prettier
```

Provides the command `prettier`.

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; popular repo; extremely popular.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.9.6 |
| Published | 2026-07-21 |
| First published | 2017-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 0 |
| Unpacked size | 9.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52247 |
| Author | James Long |
| Maintainers | jlongster, lydell, thorn0, vjeux, fisker, suchipi, duailibe, ikatyang, azz, sosukesuzuki, prettier-bot |

## Links

- npm: https://www.npmjs.com/package/prettier
- Repository: https://github.com/prettier/prettier
- Homepage: https://prettier.io
- Issues: https://github.com/prettier/prettier/issues
- Funding: https://github.com/prettier/prettier?sponsor=1
- npm.io page: https://npm.io/package/prettier

## Recent versions

- 3.9.6 (latest) — 2026-07-21
- 4.0.0-alpha.13 (next) — 2025-11-18
- 3.9.5 — 2026-07-09
- 3.9.4 — 2026-06-30
- 3.9.3 — 2026-06-29
- 3.9.2 — 2026-06-29
- 3.9.1 — 2026-06-27
- 3.9.0 — 2026-06-27
- 3.8.5 — 2026-06-26
- 3.8.4 — 2026-06-09
- 3.8.3 — 2026-04-15
- 3.8.2 — 2026-04-10
- 3.8.1 — 2026-01-21
- 3.8.0 — 2026-01-14
- 3.7.4 — 2025-12-03
- … 180 more at https://npm.io/package/prettier/versions

## README

[![Prettier Banner](https://unpkg.com/prettier-logo@1.0.3/images/prettier-banner-light.svg)](https://prettier.io)

<h2 align="center">Opinionated Code Formatter</h2>

<p align="center">
  <em>
    JavaScript
    · TypeScript
    · Flow
    · JSX
    · JSON
  </em>
  <br />
  <em>
    CSS
    · SCSS
    · Less
  </em>
  <br />
  <em>
    HTML
    · Vue
    · Angular
  </em>
  <br />
  <em>
    GraphQL
    · Markdown
    · YAML
  </em>
  <br />
  <em>
    <a href="https://prettier.io/docs/plugins">
      Your favorite language?
    </a>
  </em>
</p>

<p align="center">
  <a href="https://github.com/prettier/prettier/actions?query=branch%3Amain">
    <img alt="CI Status" src="https://img.shields.io/github/check-runs/prettier/prettier/main?style=flat-square&label=CI"></a>
  <a href="https://codecov.io/gh/prettier/prettier">
    <img alt="Coverage Status" src="https://img.shields.io/codecov/c/github/prettier/prettier.svg?style=flat-square"></a>
  <a href="https://x.com/acdlite/status/974390255393505280">
    <img alt="Blazing Fast" src="https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg?style=flat-square"></a>
  <br/>
  <a href="https://www.npmjs.com/package/prettier">
    <img alt="npm version" src="https://img.shields.io/npm/v/prettier.svg?style=flat-square"></a>
  <a href="https://www.npmjs.com/package/prettier">
    <img alt="weekly downloads from npm" src="https://img.shields.io/npm/dw/prettier.svg?style=flat-square"></a>
  <a href="https://github.com/prettier/prettier#badge">
    <img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
  <a href="https://x.com/intent/follow?screen_name=PrettierCode">
    <img alt="Follow Prettier on X" src="https://img.shields.io/badge/%40PrettierCode-9f9f9f?style=flat-square&logo=x&labelColor=555"></a>
</p>

## Intro

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.

### Input

<!-- prettier-ignore -->
```js
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
```

### Output

```js
foo(
  reallyLongArg(),
  omgSoManyParameters(),
  IShouldRefactorThis(),
  isThereSeriouslyAnotherOne(),
);
```

Prettier can be run [in your editor](https://prettier.io/docs/editors) on-save, in a [pre-commit hook](https://prettier.io/docs/precommit), or in [CI environments](https://prettier.io/docs/cli#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!

---

**[Documentation](https://prettier.io/docs/)**

[Install](https://prettier.io/docs/install) ·
[Options](https://prettier.io/docs/options) ·
[CLI](https://prettier.io/docs/cli) ·
[API](https://prettier.io/docs/api)

**[Playground](https://prettier.io/playground/)**

---

## Badge

Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

```md
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

---
_Source: https://npm.io/package/prettier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
