Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

Semantic Version Calculator — Compare, Bump & Test Ranges

Everything about semantic versions in one place: compare two versions, calculate the next major/minor/patch/prerelease, and see exactly which versions an npm range like ^1.2.0 or ~2.3 allows — explained in plain English.

Atualizado em

Compare

Bump

Range check

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como usar: Semantic Version Calculator

  1. Compare: enter two versions to see which is newer and why (prerelease and build metadata included).
  2. Bump: enter the current version and click the change type to get the next version — copied automatically.
  3. Range check: enter an npm range like ^1.2.0, ~1.2, 1.x or >=1.2 <2 and a list of versions.
  4. Read the plain-English explanation and see which versions satisfy the range.

Semantic versioning: MAJOR.MINOR.PATCH

PartIncrease when…Example
MAJORyou make breaking changes1.4.2 → 2.0.0
MINORyou add features, backwards-compatible1.4.2 → 1.5.0
PATCHyou fix bugs, backwards-compatible1.4.2 → 1.4.3
Prereleaseyou publish a test version2.0.0-beta.1
Build metadatayou tag a build (ignored for precedence)1.4.2+sha.5114f85

npm range cheat sheet

RangeMeansAllows
^1.2.3Compatible with 1.2.3>=1.2.3 <2.0.0
^0.2.3For 0.x, minor is “major”>=0.2.3 <0.3.0
~1.2.3Patch updates only>=1.2.3 <1.3.0
1.x / 1Any 1.y.z>=1.0.0 <2.0.0
1.2.3 - 2.3Hyphen range>=1.2.3 <2.4.0
>=1.2 <1.5 || 2.xEither set1.2.0–1.4.x or 2.x

Prereleases only match a range if a comparator in the same set has a prerelease on the same major.minor.patch — so ^1.2.0 does not match 1.3.0-beta.1, but ^1.3.0-beta.0 does. This avoids installing unstable versions by accident.

Ranges live in your package.json. To decide the next version from your commits, use the Changelog Generator; to tag the release, the Git Command Generator.

Também pesquisado como: semver calculator, semver range checker, npm version range, caret vs tilde, semantic versioning, version bump, compare versions, semver prerelease.

Ferramentas que combinam com: Semantic Version Calculator

  • Gerador de fluxos de trabalho do GitHub Actions — Escolha sua pilha, gatilhos e etapas e receba um arquivo .github/workflows/ci.yml — instalação, cache, verificação de código, teste, compilação, uma matriz de versões e, opcionalmente, implantação no GitHub Pages, Vercel ou em um registro de contêineres.
  • Number Base Converter — Type a number in any base and see it in all the others instantly.
  • Verificador de Diferenças — Cole uma versão original e uma versão alterada para ver lado a lado as linhas adicionadas, removidas e modificadas — com as palavras exatas que mudaram destacadas dentro de cada linha.
  • YAML Validator — Paste a Docker Compose file, Kubernetes manifest, GitHub Actions workflow or any YAML to pinpoint errors, catch common pitfalls and get a cleanly formatted version.

Perguntas frequentes

Can I use this as a semver tester?
Yes. Enter a range such as ^1.2.0, ~2.3 or >=1.0 <2.0 and a list of versions: each version is marked as matching or not, with a plain-English explanation of the range.
What is the difference between ^ and ~ in package.json?
^1.2.3 allows minor and patch updates (up to, but not including, 2.0.0). ~1.2.3 allows only patch updates (up to 1.3.0). For 0.x versions, ^ is stricter: ^0.2.3 only allows 0.2.x.
Is 1.10.0 newer than 1.9.0?
Yes. Each part is compared as a number, not as text, so 10 > 9.
How do prerelease versions compare?
A prerelease is lower than the normal version: 2.0.0-beta.1 < 2.0.0. Prerelease identifiers are compared part by part — numbers numerically, text alphabetically, and numbers rank lower than text.
Does build metadata (+build) matter?
No, build metadata is ignored when comparing versions: 1.0.0+20261026 and 1.0.0+abc are equal in precedence.
Posso instalar o Semantic Version Calculator como um aplicativo da web e usá-lo offline?
Sim. O Semantic Version Calculator é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas