Prettier is an opinionated code formatter for JavaScript, TypeScript, and web-language developers who want one consistent style enforced automatically across a codebase.
What it is
Prettier is an open-source code formatter written in JavaScript and released under the MIT licence. It works by parsing your source code into an AST and re-printing it from scratch according to its own fixed rules, taking the configured maximum line width into account and wrapping code whenever a line would run long. It handles a broad set of languages in one tool: JavaScript, TypeScript, Flow, JSX, JSON, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown, and YAML.
The problem it solves is style disagreement. Because formatting is decided by the parser and printer rather than by the original author, the same input always produces the same output, which means debates over indentation, line breaks, and argument wrapping never reach code review. A call such as foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne()) is re-printed with one argument per line, so a reviewer never has to post a nit-picky comment about formatting again.
Key capabilities
- Formats JavaScript, TypeScript, Flow, JSX, and JSON alongside CSS, SCSS, and Less from a single tool.
- Handles component and markup languages including HTML, Vue, and Angular templates, plus GraphQL, Markdown, and YAML.
- Re-prints code from a parsed AST with its own rules, wrapping lines according to the maximum line length option.
- Runs in your editor on save, so files are formatted as you write them.
- Runs as a pre-commit hook to block unformatted code before it enters the repository.
- Runs in CI environments using the CLI's
--list-different mode to detect files that are not formatted.
- Exposes a documented CLI and API, with a browser playground at prettier.io/playground for previewing options.
Who uses it and how
- Individual developers who install it locally and format files on save through editor integration.
- Teams that add it as a pre-commit hook so every contribution arrives already formatted.
- Continuous-integration pipelines that run the CLI in list-different mode to fail builds containing unformatted files.
- Projects mixing multiple languages — for example Vue single-file components with GraphQL and YAML configuration — that want one formatter covering all of them.
- Open-source maintainers who advertise the enforced style with the
code style: prettier badge so contributors know expectations up front.
Getting started
Install it as a development dependency following the installation guide at prettier.io/docs/install, then run it through the CLI, an editor integration, or a pre-commit hook; full instructions for each are in the documentation at prettier.io/docs.
How it compares
Prettier stands alone in this registry: no other formatter or similar tool is named in the available facts for a direct comparison, and it carries no competing paid product in its category.
When to use it — and when not to use it
It runs as a local CLI with no server, database, storage, or mail component, so there is nothing to self-host or operate — but that also means teams that want per-project control over formatting conventions beyond Prettier's own options should look elsewhere, since the tool deliberately makes that choice for you. The project is actively maintained under an MIT licence, though 1,462 open issues suggest a substantial backlog of unresolved requests and bug reports for prospective adopters to weigh.
project readme (upstream, from github) — read inline

Opinionated Code Formatter
JavaScript
· TypeScript
· Flow
· JSX
· JSON
CSS
· SCSS
· Less
HTML
· Vue
· Angular
GraphQL
· Markdown
· YAML
Your favorite language?
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
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
Output
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne(),
);
Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments 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
Install ·
Options ·
CLI ·
API
Playground
Badge
Show the world you're using Prettier → 
[](https://github.com/prettier/prettier)
Contributing
See CONTRIBUTING.md.