How to use the Browserslist generator
- Choose a Target: Browserslist defaults, Baseline widely available, Modern evergreen, Broad, or Legacy (older devices).
- Add Extra queries (one per line) if needed, for example
node 22. - List anything to drop in Exclude (one per line).
op_mini allis filled in. - Pick the Format: a
.browserslistrcfile or abrowserslistfield for package.json. - Tick Separate development target (latest browsers only) if you want faster local builds, then copy the result.
What it does and when to use it
Build tools need to know which browsers to support. Autoprefixer uses it to decide which CSS prefixes to add, and Babel uses it to decide which JavaScript to rewrite for older engines. Browserslist is the shared format all these tools read, so one list keeps them in step.
Use it when a project has no list, or to drop very old browsers and shrink your output. Babel’s preset-env reads the list when no targets are set, as in the Babel config generator output. The package.json form goes into the file from the package.json generator; check the merged file with the JSON validator.
How it works
Each preset is a short list of queries, which Browserslist joins with OR:
| Preset | Queries |
|---|---|
| Browserslist defaults | defaults (> 0.5%, last 2 versions, Firefox ESR, not dead) |
| Baseline widely available | baseline widely available (needs Browserslist 4.25+) |
| Modern evergreen | last 2 versions of Chrome, Firefox, Safari (major) and Edge, plus Firefox ESR |
| Broad | > 0.2%, last 2 versions, Firefox ESR, not dead |
| Legacy | > 0.1%, last 4 versions, Firefox ESR, not dead, iOS and Safari 12+, Chrome 70+ |
Your extra queries follow the preset, and the exclusions come last as not lines. A not line removes browsers from everything above it, which is why the tool keeps exclusions at the end.
Worked examples
Defaults with Opera Mini removed.
# .browserslistrc — Browserslist defaults
# defaults = > 0.5%, last 2 versions, Firefox ESR, not dead.
# Check coverage with: npx browserslist --coverage
defaults
not op_mini all
Baseline in package.json with a development target. The output is a browserslist object with a production list ("baseline widely available", "not op_mini all") and a development list of the last Chrome, Firefox and Safari versions.
Legacy plus Node.js, without IE. Preset Legacy, extra node 22, exclusions op_mini all and IE 11. The seven legacy queries are followed by node 22, not op_mini all and not IE 11.
Limits and tips
- Update the data. Usage numbers come from the caniuse-lite package in your project; run
npx update-browserslist-db@latestnow and then. - One config only. If both
.browserslistrcand a package.json field exist, Browserslist reports an error; keep one. - Test a query before you commit it on the official browsersl.ist site.
Frequently asked questions
Which preset should I start with?
Why does the page not show how many users are covered?
Why is Opera Mini excluded by default?
What is the development target for?
Do I write "not" in the Exclude box?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.