Works on this device
Version Comparator
Type two versions to see which one is newer, or paste a list to sort it. Choose the kind of version number first: the rules for 1.0.0-rc.1, 1.0rc1 and 1.0~rc1 are not the same.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your comparison will show here
Type two versions and choose Compare.
Comparison
How it was worked out
How to use the comparator
- Choose Compare two versions or Sort a list of versions.
- Choose the kind of version number: Semantic Versioning, numbers with dots, Python packages (PEP 440) or Debian packages.
- Type the two versions, or paste a list with one version on each line.
- Choose Compare or Sort. The table shows the parts that were compared, or the sorted list.
The rules of each kind
- Semantic Versioning 2.0.0: MAJOR, MINOR and PATCH as numbers. A pre-release comes before its normal version, so
1.0.0-rc.1is older than1.0.0. Pre-release parts are compared one by one: numbers by value, text in ASCII order, a number before text. Build metadata after + is not counted. - Numbers with dots: each part is a whole number, compared from the left; a missing part counts as 0. So
1.2.10is newer than1.2.9, and1.2is the same as1.2.0. Android version names often look like this, but Android itself only compares the whole-number versionCode. - Python packages (PEP 440): an epoch such as
1!first, then the release numbers, then.devreleases, thena,bandrcpre-releases, then the release, then.postreleases. A+localpart comes after the same version without one. - Debian packages (dpkg):
[epoch:]upstream[-revision]. Text is compared in runs:~comes before everything, even the end, then letters, then other characters; runs of digits are compared as numbers. So1.0~rc1is older than1.0, and1.0+b1is newer.
Worked example
1.2.10and1.2.9as numbers with dots: the first two parts are the same; part 3 is 10 against 9, so 1.2.10 is newer. As plain text, 1.2.10 would come first, which is why text sorting gives the wrong order.1.0rc1and1.0.post1under PEP 440: the release 1.0 is the same; a release candidate comes before the release and a post-release after it, so 1.0rc1 is older.1.0~rc1-1and1.0-1under Debian rules: the upstream versions differ at~rc1, and~sorts before the end of the text, so 1.0~rc1-1 is older.
Limits you should know
- Python versions are read only in the normal form of PEP 440 (such as
1.0rc1, not1.0-RC1or1.0.0-alpha). Capital letters are read as small ones and a leading v is dropped. - RPM version comparison and the rules of other package managers (Ruby, Composer, Maven) are not offered here.
- To check whether a version follows Semantic Versioning, or to test npm ranges such as ^1.2.3, use the Semantic Version Checker.
- Up to 1,000 versions in a list.