GS1 DATA TOOL
GLN validator
Check the number’s length, numeric syntax and Modulo-10 digit before placing it in master data or a barcode.
Inputs
Results
Run the sample to see decoded fields and checks.
ON THIS DEVICE
Recent history
RULES USED
Method and formulas
GLN uses the same GS1 Modulo-10 check-digit calculation as GTIN and SSCC.
A checksum-valid GLN is not necessarily licensed, current or assigned to the location you expect.
GUIDE
Purpose of the GLN Validator
The GLN validator processes 13-digit Global Location Numbers used in the GS1 system to identify physical locations such as warehouses, factories, or retail stores. It accepts either a complete 13-digit string for full validation or a 12-digit prefix to compute the required check digit. This supports accurate data entry in supply-chain databases where GLNs link shipments, invoices, and master data records.
Users apply the tool when importing location lists from trading partners or when generating new identifiers before submission to a GS1 member organization. The underlying algorithm follows the identical modulo-10 procedure defined for GTIN-13 and SSCC identifiers, ensuring consistent check-digit logic across GS1 keys. Integration into enterprise resource planning systems reduces transcription errors and supports automated reconciliation of trading-partner master files.
Worked Example Using Realistic Digits
Consider the 12-digit prefix 950600013435. The validator first confirms length, then applies alternating weights starting from the rightmost digit of the prefix. The calculation yields a check digit of 2, producing the complete GLN 9506000134352.
| Position from right (prefix) | Digit | Weight | Product |
|---|---|---|---|
| 1 | 5 | 3 | 15 |
| 2 | 3 | 1 | 3 |
| 3 | 4 | 3 | 12 |
| 4 | 3 | 1 | 3 |
| 5 | 1 | 3 | 3 |
| 6 | 0 | 1 | 0 |
| 7 | 0 | 3 | 0 |
| 8 | 0 | 1 | 0 |
| 9 | 6 | 3 | 18 |
| 10 | 0 | 1 | 0 |
| 11 | 5 | 3 | 15 |
| 12 | 9 | 1 | 9 |
Sum of products equals 78. The remainder when divided by 10 is 8. Subtracting from 10 produces the check digit 2. The validator then confirms that the full 13-digit string 9506000134352 satisfies the modulo-10 condition.
Second Worked Example
Now examine the 12-digit prefix 950123456789. After length verification the validator applies the same alternating weights from the right. The weighted products total 119. Division by 10 leaves remainder 9, so the check digit is 1 and the complete GLN is 9501234567891.
| Position from right (prefix) | Digit | Weight | Product |
|---|---|---|---|
| 1 | 9 | 3 | 27 |
| 2 | 8 | 1 | 8 |
| 3 | 7 | 3 | 21 |
| 4 | 6 | 1 | 6 |
| 5 | 5 | 3 | 15 |
| 6 | 4 | 1 | 4 |
| 7 | 3 | 3 | 9 |
| 8 | 2 | 1 | 2 |
| 9 | 1 | 3 | 3 |
| 10 | 0 | 1 | 0 |
| 11 | 5 | 3 | 15 |
| 12 | 9 | 1 | 9 |
The validator verifies that 9501234567891 produces a weighted sum divisible by 10, confirming validity.
Formula and Method Table
| Input | Operation | Output |
|---|---|---|
| 12-digit prefix | Apply weights 3,1,3,1... from right; sum products; compute 10 minus (sum mod 10) | Check digit (0-9) |
| 13-digit GLN | Apply same weights across all digits including final position; verify total sum mod 10 equals 0 | Pass or fail result |
Units and Conversions Notes
GLN values contain no decimal places or unit suffixes; they remain strictly numeric strings of exactly 13 digits. Leading zeros are significant and must be preserved during data transfer between systems. No conversion between measurement units occurs because the identifier itself carries no quantity information, only location reference data.
| Format Aspect | Rule | Example |
|---|---|---|
| Length | Exactly 13 digits | 9506000134352 |
| Leading zeros | Preserve all zeros | 0034000123456 |
| Check digit position | Rightmost digit | Position 13 |
| Character set | Digits 0-9 only | No letters or symbols |
| Storage type | String, never integer | Avoid scientific notation |
When exchanging GLNs with external parties, confirm that the same 13-digit format is used; some legacy systems may strip leading zeros or store the value as an integer, which corrupts the check digit. The validator accepts only integer digit sequences and rejects any input containing letters, spaces, or punctuation.
Limitations
A positive validation result confirms only that the check digit matches the preceding digits according to the GS1 modulo-10 rule. It does not verify whether the GLN has been officially allocated by a GS1 member organization, remains active, or corresponds to the expected physical site. Production systems must still perform lookup against the authoritative GLN registry or internal master data before using the identifier in transactions.
The tool processes input locally within the browser and does not transmit data to external servers. It handles only the standard 13-digit length; extensions such as GLN extension digits used in some EDI messages fall outside its scope. The validator cannot detect duplicate GLNs across organizations or confirm geographic accuracy of the encoded location. It also ignores any application identifiers that may prefix the GLN in GS1-128 barcodes.
Common Mistakes
- Entering a full 13-digit GLN when the intent is to calculate a new check digit from a 12-digit prefix.
- Supplying only 12 digits during full validation instead of requesting check-digit computation.
- Reversing the weight sequence so that position 1 receives weight 1 instead of 3.
- Assuming a GLN beginning with 950 or 951 automatically identifies a specific company without registry lookup.
- Copying values from spreadsheets that introduce hidden characters, line breaks, or convert the string to scientific notation.
- Omitting leading zeros when the GLN is stored temporarily as a numeric value in intermediate software.
- Neglecting to re-validate after manual edits that may have altered a single digit without updating the check digit.
COMMON QUESTIONS
Frequently asked questions
What length must the input have when calculating a new GLN check digit?
Exactly twelve digits are required. The validator rejects any other length and returns an error before attempting the modulo-10 calculation.
Does a valid checksum guarantee the GLN is registered with GS1?
No. The check digit only confirms mathematical correctness. Separate verification against the GS1 registry or internal master data is required to confirm allocation and current status.
How does the tool treat a leading zero in the first position of a 13-digit GLN?
Leading zeros are preserved and weighted normally during validation. Removing them changes the identifier and will cause the check digit to fail.
Can the validator process GLN extension digits used in some EDI messages?
No. Only the core 13-digit GLN is supported. Extension digits must be handled by separate application logic after the base GLN passes validation.
What happens if non-numeric characters appear in the input field?
The validator immediately reports an invalid format. Only the digits 0-9 are accepted; any other character stops processing before the check-digit routine runs.
Is the same modulo-10 routine used for both GLN validation and GTIN-13 validation?
Yes. The weighting pattern and final modulo-10 step are identical, allowing the same routine to service multiple GS1 key types without modification.
What is the expected output when a 13-digit GLN ends with an incorrect check digit?
The validator returns a failure result and indicates the correct check digit that would make the string valid, allowing quick correction of transcription errors.
Does browser-local processing affect the accuracy of the check-digit result?
Accuracy remains identical to server-side implementations because the algorithm uses only integer arithmetic on the supplied digits with no external data dependencies.