Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

Semantic Version Calculator — Compare, Bump & Test Ranges

Everything about semantic versions in one place: compare two versions, calculate the next major/minor/patch/prerelease, and see exactly which versions an npm range like ^1.2.0 or ~2.3 allows — explained in plain English.

Mis à jour le

Compare

Bump

Range check

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : Semantic Version Calculator

  1. Compare: enter two versions to see which is newer and why (prerelease and build metadata included).
  2. Bump: enter the current version and click the change type to get the next version — copied automatically.
  3. Range check: enter an npm range like ^1.2.0, ~1.2, 1.x or >=1.2 <2 and a list of versions.
  4. Read the plain-English explanation and see which versions satisfy the range.

Semantic versioning: MAJOR.MINOR.PATCH

PartIncrease when…Example
MAJORyou make breaking changes1.4.2 → 2.0.0
MINORyou add features, backwards-compatible1.4.2 → 1.5.0
PATCHyou fix bugs, backwards-compatible1.4.2 → 1.4.3
Prereleaseyou publish a test version2.0.0-beta.1
Build metadatayou tag a build (ignored for precedence)1.4.2+sha.5114f85

npm range cheat sheet

RangeMeansAllows
^1.2.3Compatible with 1.2.3>=1.2.3 <2.0.0
^0.2.3For 0.x, minor is “major”>=0.2.3 <0.3.0
~1.2.3Patch updates only>=1.2.3 <1.3.0
1.x / 1Any 1.y.z>=1.0.0 <2.0.0
1.2.3 - 2.3Hyphen range>=1.2.3 <2.4.0
>=1.2 <1.5 || 2.xEither set1.2.0–1.4.x or 2.x

Prereleases only match a range if a comparator in the same set has a prerelease on the same major.minor.patch — so ^1.2.0 does not match 1.3.0-beta.1, but ^1.3.0-beta.0 does. This avoids installing unstable versions by accident.

Ranges live in your package.json. To decide the next version from your commits, use the Changelog Generator; to tag the release, the Git Command Generator.

Aussi recherché comme : semver calculator, semver range checker, npm version range, caret vs tilde, semantic versioning, version bump, compare versions, semver prerelease.

Outils complémentaires : Semantic Version Calculator

  • Générateur de workflows GitHub Actions — Choisissez votre pile, vos déclencheurs et vos étapes, puis obtenez un script commenté .github/workflows/ci.yml — installation, mise en cache, analyse syntaxique, test, compilation, une matrice de versions et, en option, un déploiement vers GitHub Pages, Vercel ou un registre de conteneurs.
  • Number Base Converter — Type a number in any base and see it in all the others instantly.
  • Vérificateur de différences — Collez une version originale et une version modifiée pour comparer côte à côte les lignes ajoutées, supprimées et modifiées — les mots exacts qui ont été modifiés étant mis en évidence dans chaque ligne.
  • YAML Validator — Paste a Docker Compose file, Kubernetes manifest, GitHub Actions workflow or any YAML to pinpoint errors, catch common pitfalls and get a cleanly formatted version.

Questions fréquentes

Can I use this as a semver tester?
Yes. Enter a range such as ^1.2.0, ~2.3 or >=1.0 <2.0 and a list of versions: each version is marked as matching or not, with a plain-English explanation of the range.
What is the difference between ^ and ~ in package.json?
^1.2.3 allows minor and patch updates (up to, but not including, 2.0.0). ~1.2.3 allows only patch updates (up to 1.3.0). For 0.x versions, ^ is stricter: ^0.2.3 only allows 0.2.x.
Is 1.10.0 newer than 1.9.0?
Yes. Each part is compared as a number, not as text, so 10 > 9.
How do prerelease versions compare?
A prerelease is lower than the normal version: 2.0.0-beta.1 < 2.0.0. Prerelease identifiers are compared part by part — numbers numerically, text alphabetically, and numbers rank lower than text.
Does build metadata (+build) matter?
No, build metadata is ignored when comparing versions: 1.0.0+20261026 and 1.0.0+abc are equal in precedence.
Puis-je installer Semantic Version Calculator en tant qu’application web et l’utiliser hors ligne ?
Oui. Semantic Version Calculator est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires