Toolvito

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

See which of two versions is newer, and the step that decides it.

Your 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.

How to use the comparator

  1. Choose Compare two versions or Sort a list of versions.
  2. Choose the kind of version number: Semantic Versioning, numbers with dots, Python packages (PEP 440) or Debian packages.
  3. Type the two versions, or paste a list with one version on each line.
  4. 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.1 is older than 1.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.10 is newer than 1.2.9, and 1.2 is the same as 1.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 .dev releases, then a, b and rc pre-releases, then the release, then .post releases. A +local part 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. So 1.0~rc1 is older than 1.0, and 1.0+b1 is newer.

Worked example

  • 1.2.10 and 1.2.9 as 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.0rc1 and 1.0.post1 under 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-1 and 1.0-1 under 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, not 1.0-RC1 or 1.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.

Related tools