Android essentials

versionCode vs versionName: which number does what

One is a label people read; the other is an integer Android and Google Play compare. Mixing them up is a classic upload rejection. Here is each one's job and a numbering scheme that lasts.

5 min read Updated September 2026

Quick answer: versionName is a free-form string shown to users ("2.1.0"). versionCode is a positive integer that Android compares to decide whether an install is an upgrade, and Google Play rejects any upload whose code is not higher than every code you have used before. Start at 1 / "1.0" and only ever go up.

Side by side

versionNameversionCode
Data typeStringInteger
Seen byUsers, on the listing and in SettingsNobody
Compared by AndroidNeverAlways
Example2.1.0, Autumn release58
Must rise on each uploadNoYes

Shipping version name "1.0" with version code 63 is perfectly valid. The name is decoration; the code is the mechanism.

Play's rule

Each upload needs a versionCode higher than any you have ever uploaded — not merely different. Play remembers every code, including ones from releases you deleted or that only reached an internal test track, and refuses anything at or below the highest. The message reads "Version code N has already been used", and the only way out is up.

Numbering schemes

Version Code GeneratorTurn a version name into a valid versionCode Open the tool
The version code generator converting version name 1.4.2 into code 10402 with the Gradle snippet
Whatever the scheme, the next number should be derivable without thought.

Plain counter — 1, 2, 3…

The code is a counter; the name carries meaning. Cannot overflow, cannot confuse. Right for most projects, with the one weakness that the number says nothing by itself.

Semantic — 1.4.2 → 10402

major×10000 + minor×100 + patch. The release is readable straight from a crash report. Minor and patch cap at 99, which is rarely a problem.

Date — 260911

yyMMdd. Sortable and self-describing, but one release per day.

Date + build — 26091101

yyMMddBB, up to 100 builds a day; common in CI. Note it crosses Play's ceiling in 2042.

The ceiling: 2,100,000,000

Play refuses any version code above 2,100,000,000 — just under the signed 32-bit limit. A scheme like yyyyMMddHH produces 2026091114 today, which is already over the line and rejected on first upload. Use a two-digit year, or do not encode dates.

What users feel

Higher code plus matching signature: Android installs it as an update and keeps data, databases and settings. Lower code: the install is refused — which is why sideloading an old APK over a newer one fails with a downgrade or parse error. Uninstalling first works but erases the app's data.

The signature half is not optional. An APK signed with a different key can never update an existing install, whatever the codes say; Android treats it as a different app with the same name.

Habits that avoid the error

Questions people ask

What is the difference between versionCode and versionName?

versionCode is an integer Android compares to decide which build is newer and users never see it. versionName is the readable string on the listing and is never compared.

Must versionCode increase every upload?

For Google Play, yes. Play keeps every code you have used and rejects anything at or below the highest, including codes from deleted or internal-test releases.

What is the highest versionCode allowed?

2,100,000,000. Four-digit-year date schemes with hours appended exceed it, which is why date-based codes should use a two-digit year.

Can I reuse a code after deleting a release?

No. Used codes are remembered for the life of the listing; once uploaded, a code is spent.

What should the first release use?

Code 1 and name 1.0 is conventional and keeps the maths obvious. Date-based codes are fine too; only the must-increase rule is enforced.

Read next

Ready to turn your site into an app?

Upload an HTML file or a ZIP, set your icon and name, and download a signed Android app. No Android Studio, no command line.

Open the builder