Prettier Config Generator
Build a minimal .prettierrc with only the options you change.
About this tool
Set print width, tab width, quotes, semicolons, trailing commas, arrow parentheses, line endings and other Prettier options, then choose the file format. By default only non-default options are written, keeping the config short. A starter .prettierignore is included.
Prettier's options and defaults
Prettier is an opinionated code formatter, and most teams change only a few options. Prettier 3's defaults are printWidth 80, tabWidth 2, spaces rather than tabs, semicolons, double quotes, quoteProps "as-needed", trailingComma "all" (changed from "es5" in Prettier 3), bracketSpacing, arrowParens "always" and endOfLine "lf". Writing only your differences, for example printWidth 100 and singleQuote true, makes intent clear and lets you inherit future improvements. Formats: .prettierrc (JSON) is most common, YAML allows comments, prettier.config.js (ESM with a JSDoc type for editor autocomplete) suits computed configs, and a "prettier" key keeps everything in package.json. .prettierignore follows .gitignore syntax and should exclude build output, dependencies, lock files and minified files. Honest limits: if you're upgrading from Prettier 2, set trailingComma explicitly to avoid a large diff. Prettier also reads .editorconfig unless overridden. Pair it with eslint-config-prettier so ESLint doesn't fight the formatting, and run npx prettier --write . once. The .editorconfig generator, the JSON formatter and the JS minifier are related.
Frequently asked questions
What are Prettier's default settings?
printWidth 80, tabWidth 2, semicolons, double quotes, trailingComma 'all', arrowParens 'always' and LF line endings (Prettier 3).
Which Prettier config file should I use?
.prettierrc (JSON) is the most common. Use prettier.config.js if you need logic or type hints.
Why did my diff change after upgrading to Prettier 3?
The trailingComma default changed from 'es5' to 'all'. Set it explicitly to keep the old behaviour.
Is anything uploaded?
No. The file is generated in your browser and nothing is stored or sent.