DevTools Logo

Semantic Version Calculator

Semantic Version Calculator

Parse, compare and bump semantic versions

    Parse & bump version

    Compare two versions

    Comparison honours pre-release precedence per semver 2.0.0 — e.g. 1.0.0-alpha < 1.0.0, and numeric identifiers are compared as numbers (1.2.0 < 1.10.0).

    About

    Work with semantic versions: parse a version into its components, validate it, bump it to the next major/minor/patch/prerelease, and compare two versions. Follows Semantic Versioning 2.0.0, including pre-release and build metadata. Everything runs in your browser; nothing is uploaded.

    Examples

    Parse and bump a pre-release version

    Input
    2.0.0-beta.3
    Output
    major: 2, minor: 0, patch: 0
    prerelease: beta.3
    bump: patch → 2.0.1
    bump: prerelease → 2.0.0-beta.4

    A patch bump clears the pre-release. A pre-release bump increments the numeric tag: beta.3 → beta.4.

    Compare two versions with precedence

    Input
    1.0.0-alpha
    Output
    Paste 1.0.0-alpha into Version A and 1.0.0 into Version B:
    1.0.0-alpha < 1.0.0
    Explanation: Pre-release versions have lower precedence than the normal version.

    Many systems get this wrong and treat 1.0.0-alpha as greater than 1.0.0. Semver 2.0.0 specifies the opposite.

    About this tool

    Semantic Versioning (semver 2.0.0) is the dominant versioning scheme for software packages: MAJOR.MINOR.PATCH with optional pre-release and build metadata. The rules are precise — pre-release versions have lower precedence than the normal version, numeric segments are compared numerically, and build metadata is ignored during precedence comparison. Violations of these rules cause silent bugs in dependency resolution.

    This calculator parses and validates any semver string, shows the decomposed components, bumps any part (major/minor/patch/prerelease) with correct pre-release incrementing, and compares two versions with correct precedence rules.

    How to use this tool

    1. Enter a version

      Type a semver string (e.g. 1.2.3-alpha.1+build.123) into the input. The tool parses it and shows the full decomposition: major, minor, patch, prerelease tags, and build metadata.

    2. Bump the version

      Click major, minor, patch, or a prerelease bump. Pre-release incrementing follows the spec: 1.0.0-alpha.1 → 1.0.0-alpha.2; 1.0.0-alpha.9 → 1.0.0-alpha.10.

    3. Compare two versions

      Enter two versions and click Compare to see which is greater, with an explanation of why (pre-release precedence, numeric comparison, etc.).

    Use cases

    Determining the next version in a release

    After a release, bump major for breaking changes, minor for new features, or patch for bug fixes, with correct pre-release handling.

    Validating a version string

    Confirm that a version string from a package registry or a changelog follows semver 2.0.0 before writing automation around it.

    Comparing two versions for a changelog diff

    Compare the current installed version with a new candidate to determine whether it is a major, minor, or patch upgrade.

    Common mistakes

    Mistake:Treating 1.0.0-alpha as greater than 1.0.0.

    Fix:Semver says a pre-release version has LOWER precedence than the normal version. 1.0.0-alpha < 1.0.0. Failing this rule is the most common semver bug in package managers.

    Mistake:Comparing version strings numerically.

    Fix:String comparison treats '10.0.0' as less than '2.0.0' because '1' < '2'. Semver requires numeric comparison of numeric segments: 1.10.0 > 1.2.0.

    Mistake:Including build metadata in precedence comparisons.

    Fix:Build metadata (1.0.0+build.1 vs 1.0.0+build.2) is ignored in precedence comparison. Two versions that differ only in build metadata are considered equal.

    Frequently asked questions

    Does it support pre-release and build metadata?

    Yes. The parser handles pre-release tags (e.g. 1.0.0-alpha.1) and build metadata (e.g. 1.0.0+build.123). Pre-release precedence follows the spec: 1.0.0-alpha < 1.0.0-beta < 1.0.0. Build metadata is ignored in precedence comparisons.

    How does the prerelease bump work?

    1.0.0-alpha.1 → 1.0.0-alpha.2; 1.0.0-alpha.9 → 1.0.0-alpha.10 (numeric comparison). If there is no numeric pre-release tag, a new .1 is appended.

    Does it validate whether a string is a valid semver?

    Yes. Any non-semver string shows a validation error with an explanation of which rule is violated.

    Is my input uploaded anywhere?

    No. All parsing, comparison and bumping run entirely in your browser using the semver library; the input is never transmitted or stored.

    References & standards

    .env Secret Safety Linter

    Validate .env syntax and spot likely leaked credentials or placeholder secrets.

    .htaccess Generator

    Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

    2D Fluid Dynamics & Particle Physics Sandbox

    A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

    AI Function Calling Schema Generator

    Generate function calling JSON schemas from TypeScript interfaces

    Algorithm Arena & Data Structure Visualizer

    Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

    Ansible Playbook Generator

    Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML