Semver Calculator – Compare & Increment

Compare semantic versions and increment them. Useful for package management. Runs in your browser.

Need to validate or check versions? Try our Semver Tester.

Examples

Compare:
1.2.3 vs 2.0.0 → Version 1 is less than Version 2
1.0.0-alpha vs 1.0.0 → Prerelease has lower precedence
Increment Major:
1.2.3 → 2.0.0
1.2.3-alpha.1 → 2.0.0 (prerelease stripped)
Increment Minor:
1.2.3 → 1.3.0
Increment Patch:
1.2.3 → 1.2.4
1.2.3-alpha.1 → 1.2.4-alpha.2 (prerelease incremented)
Check Requirement:
1.2.3 satisfies ^1.2.0 → ✅ Yes
1.2.3 does NOT satisfy ^2.0.0 → ❌ No
1.2.3 satisfies >=1.0.0 <2.0.0 → ✅ Yes

About Semantic Version Calculator

The Semantic Version Calculator is an essential tool for developers working with version numbers and package management. It follows the Semantic Versioning (SemVer) 2.0.0 specification exactly, matching npm and semantic-release behavior. Perfect for determining version increments, comparing package versions, checking requirements, and managing software releases.

Use Cases:

  • Comparing package versions for dependency management
  • Determining next version number for releases
  • Understanding version differences
  • Managing npm, pip, or other package versions
  • Planning version increments for releases
  • Following semantic versioning best practices

Key Features:

  • SemVer 2.0.0 Compliant: Matches npm & semantic-release behavior exactly
  • Compare Versions: Full prerelease precedence support (1.0.0-alpha < 1.0.0)
  • Increment Versions: Smart prerelease handling (strip or increment)
  • Check Requirements: Supports ^ (caret), ~ (tilde), >=, >, <=, <, =, and AND conditions
  • Smart Validation: Helpful error messages with suggestions
  • Explanations: "Why this result?" for all operations
  • Copy to Clipboard: Copy comparison summaries, incremented versions, and requirement results
  • Strict Mode: Toggle for exact SemVer 2.0.0 compliance
  • 100% browser-based - no server processing

Semver Tester & Checker Features:

Our semver calculator also functions as a semver tester and checker. Test version validity, check compatibility, compare versions, and increment version numbers—all in one tool. Whether you need to calculate the next version, test if a version is valid, or check if a version meets requirements, our tool handles it all. For dedicated version validation and requirement testing with batch validation support, see our Semver Tester & Checker.

  • Version Calculator: Compare and increment versions
  • Version Tester: Validate version formats and test compatibility
  • Version Checker: Check if versions meet requirements

Explore these related free tools to enhance your productivity and workflow.

Frequently Asked Questions

What is semantic versioning?

Semantic versioning (SemVer) is a versioning scheme using three numbers: MAJOR.MINOR.PATCH (e.g., 1.2.3). MAJOR for incompatible changes, MINOR for backward-compatible features, and PATCH for backward-compatible bug fixes.

How do I compare two versions?

Enter two semantic versions (e.g., 1.2.3 and 2.0.0) and select 'Compare Versions'. The tool will tell you which version is greater, less, or if they're equal, and show the difference.

How do I increment a version?

Enter a semantic version and select 'Increment Version'. Choose whether to increment major, minor, or patch version. The tool will calculate the next version according to semantic versioning rules.

What version formats are supported?

The tool supports standard semantic versioning format: MAJOR.MINOR.PATCH (e.g., 1.2.3). It also supports pre-release versions (1.2.3-alpha) and build metadata (1.2.3+20240101), though these are not used in comparison.

Is the semver calculator free to use?

Yes! Our semver calculator is 100% free with no registration required, no usage limits, and no hidden fees. You can compare and increment as many versions as you need for your development work.

Are my versions stored or tracked?

No, all version calculations happen locally in your browser. We don't store, save, or have access to any versions you calculate. Your privacy is completely protected.

What's the difference between major, minor, and patch versions?

Major versions indicate incompatible API changes. Minor versions add functionality in a backward-compatible manner. Patch versions make backward-compatible bug fixes. This follows the semantic versioning specification.

Can I compare versions with pre-release tags?

Yes! The tool fully supports SemVer 2.0.0 prerelease precedence. Prerelease versions have lower precedence than normal versions (e.g., 1.0.0-alpha < 1.0.0). Numeric prerelease identifiers compare numerically, and alphanumeric ones compare lexically. Build metadata is ignored in comparisons per SemVer spec.

How do I check if a version satisfies a requirement?

Use the 'Check Requirement' operation. Enter a version (e.g., 1.2.3) and a requirement (e.g., ^1.2.0, ~2.4.1, >=1.0.0 <2.0.0). The tool will tell you if the version satisfies the requirement and explain why. Supports caret (^), tilde (~), comparison operators (>=, >, <=, <, =), and space-separated AND conditions.

How do I increment a version correctly?

Increment major for breaking changes, minor for new features that don't break existing code, and patch for bug fixes. When incrementing major or minor, lower version numbers reset to 0 (e.g., 1.2.3 → 2.0.0 for major increment).

What happens if I compare identical versions?

If two versions are identical (same major, minor, and patch numbers), the tool will indicate they are equal, regardless of any pre-release tags or build metadata differences.

Can I use this for npm package versions?

Yes! The tool follows the semantic versioning specification used by npm and many other package managers. You can use it to compare package versions and determine the next version for your npm packages.

How do I compare semantic versions online?

Use the Compare Versions mode. Enter Version 1 and Version 2 (e.g., 1.2.3 and 1.3.0). The tool will show which version is higher using SemVer 2.0.0 rules.

How do I check if a version meets a requirement?

Use the 'Check Requirement' operation. Enter a version (e.g., 1.2.3) and a requirement (e.g., >=1.0.0, <2.0.0, ~1.2.0, ^1.0.0). The tool reports whether the version satisfies the requirement and explains why.

What's the difference between semver calculator and semver tester?

The semver calculator focuses on comparing versions and incrementing version numbers. The semver tester validates and checks versions against requirements. Use the tester for validation/checking and the calculator for comparisons and increments.