GTIN-14 check digit
Enter the thirteen digits 1001234567890 and get check digit 2, for the full case code 10012345678902. Use it to finish the GTIN-14 of a carton or logistics unit, or to check a fourteen-digit code before it reaches a warehouse system. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Number
- 1001234567890
- Calculation mode
- Compute
- Input
- 1001234567890
- Check digit
- 2
- With check
- 10012345678902
Trade items that move as cases, packs, or logistics units are identified with a fourteen-digit Global Trade Item Number: GTIN-14. The first digit is a packaging indicator that distinguishes the unit from the consumer-level GTIN; the middle digits carry the company prefix and item reference; the last digit is a GS1 check digit that catches single-digit typing and scanning errors before the code reaches a warehouse system or marketplace.
What the fourteen digits of a case code say
A GTIN-14 identifies a trade item at a packaging level above the single consumer unit: a case, a pack or a logistics unit. It is always fourteen digits long. The first digit is the packaging indicator, which tells a carton apart from the item inside it. The next twelve digits carry the company prefix and the item reference, often the item's GTIN-13 without its own check digit. The last digit is the check digit. It belongs to the same family of rules as GTIN-8, UPC-A and EAN-13, so the logic will look familiar if you have worked with retail barcodes.
How the check digit is worked out, and where it goes wrong
Take the thirteen digits before the check digit and start from the right. Multiply the rightmost digit by three, the next one by one, and keep alternating. Add everything up and take ten minus the remainder after dividing by ten; if that gives ten, the check digit is zero. For 1001234567890 the result is 2, so the full code is 10012345678902. Typical mistakes are counting the weights from the left, reusing the old EAN-13 check digit after adding an indicator, and pasting codes with spaces or hyphens, which are refused rather than quietly cleaned. A matching check digit proves the code is well formed, not that the product is listed anywhere.
How the GTIN-14 check digit is calculated
A GTIN-14 is always fourteen digits. The first digit is the indicator (often zero through eight for packaging hierarchy, nine for variable measure in some schemes); digits two through thirteen form the base trade-item number, commonly a zero-padded GTIN-13 without its own check digit or an equivalent company-prefix plus item reference; digit fourteen is the check digit. Equivalently, the full fourteen-digit string including the check digit must have a GS1-weighted sum that is a multiple of ten when the same right-to-left weights are applied across all fourteen positions.
This is the same family of mod-10 rules used for GTIN-8, GTIN-12 (UPC-A), GTIN-13 (EAN-13), and GTIN-14; only the fixed length and the presence of the indicator digit make GTIN-14 specific. The algorithm is deterministic and local: no GS1 catalog lookup, no network call, and no clock.
What you can do with it
Audit GTIN-14 columns in catalog and EDI exports
Batch-validate every fourteen-digit logistics GTIN in a PIM or partner file and quarantine rows whose check digit no longer matches the recomputed expected value.
FAQ
What is a GTIN-14 check digit?
It is the fourteenth digit of a GTIN-14 code, computed with a GS1 mod-10 weighted sum so single-digit typing and scanning errors are usually caught before the case or pack code is stored or printed.
Is the GTIN-14 check digit tool free?
The browser tool is free and runs locally.
What does the first digit of a GTIN-14 mean?
It is the packaging indicator, which tells a case or pack apart from the unit a shopper buys. It usually runs from 0 to 8 for packaging levels, and in some schemes 9 marks variable-measure items.
How do I turn an EAN-13 into a GTIN-14?
Drop the last digit of the EAN-13, put the packaging indicator in front, and calculate a new check digit here over those thirteen digits. The check digit of the original EAN-13 is not carried over.
Does a correct check digit mean the product exists?
No. The check only shows that the fourteen digits are consistent with each other. No GS1 catalog is consulted, so it cannot tell you whether the code was actually assigned to an item.
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/enc/gtin14 \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"number":"1001234567890"}'const res = await fetch("https://api.kit.forhosting.com/enc/gtin14", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"number": "1001234567890"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/gtin14",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"number": "1001234567890"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/gtin14", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"number":"1001234567890"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"number":"1001234567890"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/gtin14", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"number": "1001234567890"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.gtin14",
"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.
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 capability implements the standard mod-10 rule on a thirteen-digit payload—weights counted from the right, odd positions times three, even positions times one—and either returns the check digit plus the completed fourteen-digit string, or validates a full fourteen-digit code with an explicit valid flag and the expected digit. Non-numeric input and wrong lengths fail with invalid_input instead of silent stripping, so you never store a half-cleaned case code. The same pure arithmetic runs free in the browser and at the published API price for automation.
How the GTIN-14 check digit is calculated
To compute it, take the thirteen payload digits and walk them from right to left: multiply the rightmost payload digit by three, the next by one, alternating, then form the check digit as ten minus that weighted sum modulo ten, modulo ten again so a zero remainder yields check digit zero. Compared with multi-symbology barcode validators, the search intent here is narrow: people who need a GTIN-14 check digit calculator for thirteen-digit payloads, not a general UPC-or-ISBN checker.
Input contract, modes, and error behaviour
Send a number field that contains only characters zero through nine. Wrong length is an explicit error that names the mode and the length you sent—thirteen for compute, fourteen for validate—so client forms can show “need thirteen digits” without guessing. Empty strings, missing number, and invalid mode values fail before any weighted sum runs and are not billed. Prefer compute when you mint or complete logistics GTINs from an indicator plus base; prefer validate when you gate a warehouse scan, ASN line, or partner file import on a full fourteen-digit code. Spaces, hyphens, letters, and decimal points are rejected as non-numeric input with invalid_input so a silently stripped value never reaches storage. Mode compute is the default: the engine requires exactly thirteen digits, returns check_digit as a one-character string, and returns with_check as the fourteen-digit GTIN-14 you can print on a case label or persist in a PIM. Mode validate requires exactly fourteen digits; the response reports valid true when the trailing digit matches the recomputed expected_check_digit, and always includes payload (the first thirteen digits), check_digit, expected_check_digit, and length fourteen. Alias keys such as digits, gtin, and code are accepted for the same payload field so integrations that already speak “gtin” do not need a rename. 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.
Where GTIN-14 check digits fit real workflows
Warehouse and logistics teams receive thirteen-digit internal case numbers—indicator plus consumer GTIN body without check—and must append the official GTIN-14 check digit before printing ITF-14 or GS1-128 labels for pallets and outer cartons. Receiving apps validate fourteen-digit codes at the dock so a single transposition does not create a phantom case SKU and a stock mismatch against the ASN. Data-quality jobs walk every GTIN-14 column in a catalog or EDI export, call validate mode, and quarantine rows where valid is false—catching both human edits and off-by-one bugs in generators that padded GTIN-13 incorrectly. E-commerce and marketplace onboarding forms can recompute expected_check_digit and show a friendly correction when a seller pastes a case GTIN with a mistyped last digit. Do not treat a passing GTIN-14 check as proof of brand ownership, packaging hierarchy correctness, or GS1 registration; it only proves the mod-10 digit is consistent with the thirteen-digit payload under standard GS1 weights.
Integration use cases
Complete a 13-digit case number for logistics labels
Call compute mode with the thirteen-digit payload (indicator plus base), store with_check, and feed the fourteen-digit GTIN-14 into your ITF-14 or GS1-128 label printer.
Validate scanned or typed GTIN-14 at receiving
When a scanner or ASN form submits fourteen digits, call validate mode and block put-away when valid is false, showing expected_check_digit to help correct a single mistype.
Technical questions
How do I compute a GTIN-14 check digit with this API?
POST with number set to exactly thirteen digits and mode compute (or omit mode). The response includes check_digit and with_check (the full fourteen-digit GTIN-14).
How do I validate a full fourteen-digit GTIN-14?
POST with the fourteen-digit string and mode validate. The response includes valid, check_digit, expected_check_digit, and payload (digits without the last one).
What happens with wrong length, letters, or hyphens?
Non-numeric input and lengths other than thirteen (compute) or fourteen (validate) are rejected with invalid_input. Failed validation tasks are not billed.