1. License
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”
MIT allows use in paid and closed-source projects.
github.com/prettier/prettier/blob/main/LICENSE3. Used by agents' projects
Dependency in 1,320 public GitHub projects set up for AI coding agents that we scanned (21.1%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
prettier.io/llms.txtFrom the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What Prettier does
Prettier is a free code formatter. It rewrites JavaScript, TypeScript, CSS, HTML, Markdown and other files in one tidy, consistent style, without changing what the code does. Your team and your AI assistant stop arguing about spaces and line breaks, and changes show only real edits.
What people build with it
Tidy a whole project at once
You inherit a project, or your assistant wrote files in mixed styles; one command rewrites every file in the same style.
Block unformatted code in checks
Every pull request is checked automatically, so code that skipped formatting fails the check instead of slipping in.
Format files on every commit
Each time someone saves work to version control, the changed files are formatted first, so nobody waits for the server check.
Neat code that your app writes
Your app or script generates code, settings files or snippets; pass the text through Prettier before saving or showing it.
Format code inside a web page
A code playground, a docs site or a snippet box in your app formats what people paste, right in the browser.
Keep assistant edits easy to review Idea
Run Prettier after your AI assistant changes files, so the review shows real changes, not moved spaces and quotes.
Prettier popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Prettier is used
- Prettier is a dependency in 1,320 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (27.1% of the 4,867 JavaScript/TypeScript ones), #2 of 83 in linting and formatting.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 3,660; those are left out of every share on this page.
- The most used alternative in our scan is Biome (354 projects).
- Projects that use it most often also use ESLint (79.2%), TypeScript (83.9%), Husky (32.0%).
By coding agent
Often used with
Prettier in practice
Strengths
The docs say Prettier has no individual formatting rules to enable or disable. It reprints the entire program from scratch. The maintainers say this means "it’s not possible for the programmer to make a mistake there anymore."
The "Why Prettier?" page says the biggest reason to adopt it is to stop ongoing arguments over style.
The README says Prettier can run in your editor on save, in a pre-commit hook or in CI environments. It frames this as a way to keep a consistent style with no nit-picky comments in code review.
The "Why Prettier?" page quotes users. One ran it against "one of our larger JS codebases" in under 13 seconds. Another says the biggest benefit was formatting the entire code base at once.
Watch out for
Prettier does nothing for code-quality rules such as <code>no-unused-vars</code>. The docs call those the most important linter rules, so you still need a linter.
The docs admit the output may not match your preferences. They ask you to accept that "sacrifice" in exchange for automatic formatting.
The website lists Java, PHP, Ruby, Rust, TOML and XML under "Community Plugins", apart from the languages in its main list.
The README's long call, after Prettier wraps it
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne(),
);More about Prettier
Funding
- GitHub Sponsors: https://github.com/prettier
- Open Collective: https://opencollective.com/prettier
- thanks.dev: https://thanks.dev/u/gh/prettier
- Tidelift: https://tidelift.com/funding/github/npm/prettier
- Own page: https://github.com/prettier/prettier?sponsor=1
- 41 GitHub sponsors
Head to head
- Prettier vs Biome used together in 40 projects
Packages around it
- prettier-plugin-tailwindcss: Tailwind CSS plugin
- prettier-plugin-svelte: Svelte plugin
- prettier-plugin-organize-imports: Import organizing plugin
- prettier-plugin-astro: Astro plugin
- prettier-plugin-solidity: Solidity plugin
- prettier-plugin-packagejson: package.json plugin
More in Linting and formatting
Alternatives
Prettier This page
Pick Biome when you want one fast tool that both formats and lints web code.
Pick oxfmt when you want a fast JavaScript formatter from the Oxc compiler project.
Pick Black when the code to format is Python.
Get started
Tell your AI assistant
“Add Prettier 3.9.10 as an exact dev dependency with an empty .prettierrc and a .prettierignore for build output, run npx prettier . --write once, add npx prettier . --check to CI, and add eslint-config-prettier if ESLint is used.”
Install an exact version of Prettier in the project, so everyone formats the same way.
npm install --save-dev --save-exact prettier@3.9.10If the project uses ESLint, add eslint-config-prettier so the two do not fight over style.
npm install --save-dev eslint-config-prettier
Rules for your agent
## Prettier
- Use Prettier for formatting and a linter for catching bugs. Prettier does not handle code-quality rules such as `no-unused-vars`, `no-extra-bind` or `no-implicit-globals`.
- Do not look for individual formatting rules to toggle. Prettier has none and reprints the whole program from scratch.
- Linter formatting rules such as `max-len`, `no-mixed-spaces-and-tabs`, `keyword-spacing` and `comma-style` are the category the docs say Prettier makes unnecessary.
- Do not hand-wrap code for line length. Prettier re-prints with its own rules that take the maximum line length into account, wrapping code when necessary.
- For CI checks, the README links to the `list-different` section of the CLI docs.
- On an inconsistent existing codebase, the docs call running Prettier across it "a quick win".
Mistakes to avoid
Since version 3 every public function returns a Promise; without await you get "[object Promise]".
npx then downloads the newest Prettier, which can format differently from the project's version.
The standalone build loads no plugins by itself; in our run babel alone threw ConfigError: Couldn't find plugin for AST format "estree".
The docs say the plugin route is slower and fills the editor with red lines.
The custom parser option was removed in 3.0 in favour of plugins.
Questions
Will Prettier change what my code does?
It should not. Its first rule is to output valid code that behaves exactly as before; the docs ask to report any case where it does not.
Does Prettier replace ESLint?
No. Prettier handles layout; a linter catches likely bugs. The docs suggest eslint-config-prettier to turn off ESLint's style rules.
Can I make it format exactly the way I like?
Only a little. There are a few options such as line width and quotes, and the team does not add new ones.
How do I keep one part of a file as I wrote it?
Put a // prettier-ignore comment above it in JavaScript; other languages have similar comments.
Why did the default trailing commas change after an upgrade?
In version 3.0 the default for trailing commas changed from "es5" to "all", so upgrades from version 2 add more commas.