Semantic Version Validator
Paste a version string to validate it against the SemVer 2.0.0 spec.
Result
How it is calculated
After trimming spaces from both ends, the string is matched against the official SemVer 2.0.0 pattern: MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]. MAJOR, MINOR and PATCH must be non-negative whole numbers with no leading zeros (0 is fine, 01 is not). The optional pre-release part follows a hyphen and is made of dot-separated identifiers using letters, digits and hyphens, where purely numeric identifiers also may not have leading zeros. The optional build part follows a plus sign and uses the same characters, but leading zeros are allowed there.
If the match succeeds, each part is shown separately and an absent part is displayed as a dash. If it fails, the string is reported as invalid and every field shows a dash. The tool only checks the format; it does not compare two versions or tell you which is newer.
Worked example
Input: 2.4.1-beta.3+build.20240115. The core before any hyphen or plus is 2.4.1, so major = 2, minor = 4, patch = 1. The text after the first hyphen and before the plus is the pre-release, beta.3, made of the identifiers “beta” and “3”. The text after the plus is the build metadata, build.20240115. Every rule is satisfied, so the validity result is Yes and all five parts are filled in.
Common mistakes
- Adding a “v” prefix (v1.2.3). It is common in git tags, but the SemVer grammar does not allow it, so the tool reports it as invalid. Strip the “v” first.
- Writing only two parts (1.2). SemVer always requires major, minor and patch, so a missing patch makes the string invalid.
- Padding numbers with zeros, such as 1.02.3 or 1.0.0-01. Leading zeros are rejected in the core numbers and in numeric pre-release identifiers.
- Leaving a trailing hyphen or plus (1.2.3- or 1.2.3+). An empty pre-release or build section is not allowed.
- Expecting build metadata to matter when ordering versions. It is accepted and displayed here, but SemVer says it is ignored when comparing precedence, and this tool does no comparison at all.
About this calculator
Semantic Versioning 2.0.0 (semver.org) is the widely adopted spec — used by npm, Cargo, Composer, and most modern package registries — for structuring version numbers as MAJOR.MINOR.PATCH, where major increments signal breaking changes, minor increments add backward-compatible features, and patch increments are backward-compatible fixes, optionally extended with a hyphenated pre-release tag (like -beta.1) and a plus-prefixed build metadata tag (like +20130313144700).
This tool checks whether a pasted version string is valid under the SemVer 2.0.0 grammar and, if so, breaks it into its major, minor, patch, pre-release, and build components. Software developers publishing packages, CI/CD pipeline maintainers validating release tags, and package registry tooling authors use it to catch malformed version strings before they cause a broken publish or a dependency-resolution failure.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments