GTIN check digit calculator
Enter the leading digits 629104150021 and get check digit 3 and the full code 6291041500213, a GTIN-13. Catch a mistyped product code before it reaches a label, a retailer or a marketplace listing. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Digits
- 629104150021
- Check digit
- 3
- Gtin
- 6291041500213
- Payload length
- 12
- Gtin length
- 13
A Global Trade Item Number (GTIN) is the GS1 identifier printed as an EAN, UPC, or ITF barcode on consumer packs, inner packs, and logistics units. The last character is a check digit computed from the leading digits so a single mistype or a scanner substitution is usually rejected before the code is stored, printed, or sent to a marketplace. The check digit is the value that makes that sum a multiple of ten.
How the GS1 GTIN check digit is calculated
A GTIN always ends with a single check digit that the brand does not pick: it is a pure function of the leading digits that precede it. Start at the right of the leading digits. Add the weighted products to obtain the weighted sum.
The check digit equals ten minus that sum modulo ten, with a second modulo ten so a remainder of zero produces check digit zero rather than ten. After the check digit is appended, the same right-to-left three-one pattern applied to the full code yields a multiple of ten—that is the acceptance test a scanner or warehouse system should apply.
This is not the Luhn algorithm used on payment cards: Luhn doubles every second digit from the right and splits products above nine, while GS1 uses a strict three-or-one weight and never splits. The computation is local and deterministic: no GS1 registry call, no network, and no clock.
Where a GTIN check digit calculator earns its keep
Catalog and PIM teams receive company-prefix plus item-reference strings from internal SKU systems and must append the official GS1 check digit before the code is published to a retailer, a marketplace, or a shipping label. Retail receiving apps recompute the check digit from the leading digits of a scanned GTIN so a single transposition does not create a phantom SKU and a stock mismatch against the advanced shipping notice.
E-commerce onboarding forms can show the expected check digit next to a paste field and block submit when the trailing character the seller typed does not match, which is cheaper than a later listing rejection. Data-quality jobs walk every GTIN column in a catalog export, strip the last character, recompute, and quarantine rows where the stored check digit no longer matches—catching both human edits and off-by-one bugs in generators that padded the wrong family length.
Compared with a GTIN-14-only validator or a multi-symbology barcode checker, the search intent here is the generic phrase people type: they want a GTIN check digit from leading digits, not a fourteen-digit logistics mode and not an ISBN-specific path.
What you can do with it
Catch mistyped GTINs at receiving or onboarding
Recompute the check digit from the leading digits of a scanned or pasted GTIN and block put-away or listing when the trailing character does not match.
Audit GTIN columns in catalog and EDI exports
Strip the last character of every stored GTIN, recompute with this calculator, and quarantine rows whose check digit no longer matches the GS1 weighted sum.
FAQ
What is a GTIN check digit?
It is the last digit of a Global Trade Item Number, computed with a GS1 modulo-10 weighted alternating sum so single-digit typing and scanning errors are usually caught before the code is stored or printed.
Which GTIN lengths are supported?
The same GS1 rule covers GTIN-8, GTIN-12, GTIN-13, and GTIN-14.
What happens if the input contains letters, spaces, or hyphens?
The engine never strips punctuation in silence, so a hyphenated paste cannot become a wrong product code. Failed validation is not billed.
Is the GTIN check digit calculator free?
The browser tool is free and runs locally.
How do I check a GTIN I already have?
Remove the last digit, enter the rest and compare the check digit you get with the one printed. If they differ, the code was mistyped or misread. A correct code also passes the full test: weighting all digits three and one from the right gives a multiple of ten.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fin/gtin-check-digit \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"digits":"629104150021"}'const res = await fetch("https://api.kit.forhosting.com/fin/gtin-check-digit", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"digits": "629104150021"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/gtin-check-digit",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"digits": "629104150021"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/gtin-check-digit", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"digits":"629104150021"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"digits":"629104150021"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/gtin-check-digit", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"digits": "629104150021"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.gtin_check_digit",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_digits | 32 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This GTIN check digit calculator applies the official GS1 modulo-10 rule: a weighted alternating sum counted from the right of the payload, with the rightmost leading digit multiplied by three and the weights then alternating one and three toward the left. Send the leading digits of a GTIN-8, GTIN-12, GTIN-13, or GTIN-14—without the check digit—and the response returns the check digit, the completed GTIN, the weighted sum, and the GTIN family when the payload length is standard. Any non-digit character fails with invalid_input instead of silent stripping, so a hyphenated paste never becomes a wrong product code. The same pure arithmetic powers the free browser tool and the prepaid API path.
How the GS1 GTIN check digit is calculated
GS1 uses one modulo-10 rule for GTIN-8, GTIN-12 (UPC-A), GTIN-13 (EAN-13), and GTIN-14, which is why this calculator can complete any of those families from their payload alone. Multiply the rightmost payload digit by three, the next digit to the left by one, the next by three, and keep alternating until every leading digit has a weight. Typical payload lengths are seven digits for GTIN-8, eleven for GTIN-12, twelve for GTIN-13, and thirteen for GTIN-14, and those lengths are labelled in the family field when they match.
Input contract, response shape, and error behaviour
An empty string or a missing field also fails before any weighted sum runs. The default example 629104150021 is a twelve-digit GTIN-13 body whose check digit is three, so gtin becomes 6291041500213. Failed validation is not billed. POST a JSON body with digits set to the leading GTIN characters only—do not include the check digit you want computed. The field must be a string of characters zero through nine; alias keys such as number, text, gtin, code, and payload are accepted so integrations that already speak those names do not need a rename. Leading zeros matter (a UPC-A body often starts with zero), so send a JSON string rather than a JSON number if the payload could begin with zero. Spaces, hyphens, letters, and punctuation are non-digit characters and fail with invalid_input naming the digits field, instead of being stripped in silence. On success the body echoes digits, returns check_digit as a one-character string from zero to nine, returns gtin as the completed identifier (payload plus check digit), reports payload_length and gtin_length, includes weighted_sum for audit trails, and sets algorithm to gs1-mod-10. When the payload length is seven, eleven, twelve, or thirteen, family is GTIN-8, GTIN-12, GTIN-13, or GTIN-14 respectively; other lengths omit family rather than inventing a name. Because the path is pure parse with no clock, random source, or network, the same JSON body always yields the same JSON result on the free browser tool and on the API at $0.002 per successful request. Keep requests to a short digit string; this endpoint computes a check digit, it does not look up products or draw bars.
Where a GTIN check digit calculator earns its keep
Print shops that emit EAN-13, UPC-A, or ITF-14 symbols pin gtin in tests so the barcode library and this API never drift. Do not treat a passing check digit as proof of brand ownership or GS1 registration; it only proves the mod-10 digit is consistent with the payload under standard GS1 weights.
Integration use cases
Complete a GTIN for labels and listings
Send the leading payload digits, store check_digit and gtin, and feed the completed identifier into an EAN-13, UPC-A, or ITF-14 label printer or a marketplace listing form.
Technical questions
How do I compute a GTIN check digit with this API?
POST with digits set to the leading payload only (no check digit). Typical lengths are 7, 11, 12, or 13. The response includes check_digit and gtin (the completed identifier).