Semver Comparator and Range Evaluator
Semver Comparator and Range Evaluator
Compare semantic versions and evaluate ranges with quick pass/fail output for dependency checks.
Compare Two Versions
Evaluate Range
About The Semver Comparator and Range Evaluator
The Semver Comparator and Range Evaluator compares two semantic versions and tests version lists against range expressions. It is useful for dependency checks, release notes, package upgrade planning, compatibility gates, and quick investigation of prerelease behavior.
The comparator follows SemVer precedence rules for major, minor, patch, and prerelease identifiers. Build metadata is preserved in display but does not affect precedence, so 1.0.0+build.1 and 1.0.0+build.2 compare as equal.
How to Compare Semantic Versions Online
- Enter two versions in Version A and Version B.
- Click Compare Versions to see which version has higher precedence.
- Use Swap Versions when you want to reverse the comparison without retyping.
- Enter a range expression and one version per line under Evaluate Range.
- Click Evaluate Range to see PASS/FAIL results for each candidate version.
Choosing Inputs Correctly
Compare Two Versions:
Use this for one-off precedence checks, especially when prerelease versions such as 1.4.2-beta.2 need to be compared with stable releases.
Evaluate Range:
Use this for dependency-style checks such as ^1.2.0, ~1.4.0, >=2.0.0 <3.0.0, wildcard ranges, and OR ranges separated by ||.
Common Use Cases
- Check whether a library version satisfies a dependency range.
- Confirm prerelease ordering before publishing or documenting a release.
- Compare version strings copied from package files, changelogs, or build output.
- Test multiple candidate versions against a supported-version policy.
Quick FAQ
Does build metadata affect comparison?
No. In SemVer, build metadata after + does not affect precedence.
Are prerelease versions handled differently?
Yes. Prerelease versions sort before the associated normal release, such as 1.0.0-alpha before 1.0.0.
Should I replace my package manager with this?
No. Use it for quick checks, then confirm range behavior with the package manager or SemVer library your project uses.
What version formats are supported?
Use SemVer-style versions. Vendor-specific versions, dates, and loose tags may not compare as expected.
Related Tools
OpenAPI Swagger Validator
Validate OpenAPI and Swagger JSON or YAML specs for paths, operations, responses, and metadata.
Dockerfile Linter
Check Dockerfiles for cache, security, image size, secrets, and container best-practice issues.
Kubernetes YAML Validator
Validate Kubernetes manifests for metadata, selectors, containers, resources, probes, and risky defaults.
YAML Formatter and Validator
Validate, format, and minify YAML content for configuration and API workflows.