Compare versions (SemVer)
Compare two SemVer versions, sort a list of versions and check which ones satisfy a range like ^1.2.0 or >=2 <3.
How to useCompare SemVer versions.
Version list and range
Compare versions (SemVer): what it is for
Type two versions and see which is newer and the type of difference (major, minor, patch or pre-release), with the changed parts highlighted. In the second part, paste a list of versions to sort and enter a range like ^2.0.0, ~1.4 or >=1.2 <3 to see which versions satisfy it and which is the highest, using npm’s rules.
How to use
- Type versions A and B.
- Paste a list of versions.
- Enter the range and see which ones match.
When to use it
- Understand package.json ranges.
- Sort release tags.
- Check whether an update breaks compatibility.
Frequently asked questions
How does semantic versioning work?
A version has three numbers, MAJOR.MINOR.PATCH. Major changes when compatibility breaks, minor when a compatible feature is added and patch when only a bug is fixed. Suffixes like -beta.1 mark pre-releases, which come before the final version.
What is the difference between ^ and ~?
^1.2.3 accepts any 1.x.x version from 1.2.3 (up to before 2.0.0). ~1.2.3 only accepts 1.2.x patches from 1.2.3 (up to before 1.3.0). These are npm’s rules.
Is 1.0.0-rc.1 greater than 1.0.0-beta.2?
Yes. Pre-release labels are compared part by part and alphabetically, so rc comes after beta. Both come before the final 1.0.0.
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 are free.