Package Version Format Translator

Paste one or more version strings (one per line) and see which ones are valid SemVer, valid PEP 440, both, or neither — and exactly why a version that looks fine in one ecosystem can be rejected, or silently mean something different, in the other.

Processed locally in your browser. Your file is never uploaded.

How to use this calculator

  1. Paste a version string, or several — one per line — nothing leaves your browser.
  2. Select "Check versions".
  3. Review each flagged value: which grammar it fails (or which subtle semantic difference applies), and why.
  4. Use the suggested rewrite where one is offered — some translations are only approximations, and those are explained rather than silently applied.

Assumptions

Methodology

Each line is parsed against both grammars using hand-rolled, spec-derived regular expressions (SemVer 2.0.0's own official grammar regex, and a PEP 440 pattern covering epoch/release/pre-release/post/dev/local segments). The result is then checked against the specific, well-documented ways the two ecosystems disagree: a hyphen SemVer requires before a pre-release that PEP 440 doesn't, dev/post releases PEP 440 has and SemVer has no equivalent for, build-metadata semantics that differ (SemVer ignores it for precedence, PEP 440's local version does not), a git-tag "v" prefix neither grammar expects, a leading zero that's invalid in strict SemVer, and a 2-component release that PEP 440 allows but SemVer doesn't.

Worked example

A Python-style pre-release without SemVer's required hyphen

Inputs: 1.0.0a1

Result: Valid PEP 440 (alpha 1), but strict SemVer requires a hyphen before any pre-release identifier and will reject this outright. Flagged as an error with the SemVer-correct rewrite "1.0.0-a1".

Build metadata vs. PEP 440's local version

Inputs: 1.2.3+build1

Result: Valid under both grammars as text, but SemVer requires the "+build1" part to be ignored for precedence (so "1.2.3+build1" == "1.2.3+build2"), while PEP 440's equivalent local-version segment does affect ordering. Flagged as a warning explaining the semantic difference; no rewrite is offered because the ambiguity is in the specifications, not the string.

A PEP 440 dev-release suffix

Inputs: 1.0.0.dev0

Result: Valid PEP 440 (a development release before 1.0.0), but SemVer has no directly equivalent concept. Flagged as an error explaining that an approximate SemVer spelling like "1.0.0-dev.0" is sometimes used, while being explicit that it's an approximation with different precedence rules — not offered as an automatic rewrite.

Practical guidance
Common mistakes

FAQs

Why is "1.0.0a1" flagged as an error instead of just a warning?

Because it's not merely non-idiomatic — a strict SemVer parser will fail to parse it at all, the same way a JSON parser fails on a trailing comma. That's a hard incompatibility, not a style preference.

Why doesn't the tool just rewrite "1.0.0.dev0" to a SemVer equivalent automatically?

Because there isn't a guaranteed-equivalent one. PEP 440's dev/post releases model "before" and "after" a release in a way SemVer's pre-release/build fields don't capture the same way, so any SemVer spelling is an approximation with different ordering behavior — this tool only auto-rewrites when the result is genuinely lossless.

Is "1.2.3+build1" actually broken?

Not broken as text — it's valid under both grammars. The risk is purely in how a build/local-version suffix affects version comparison, which differs between the two ecosystems' own tooling.