eudaflow

HomeGuides

Free UDI check character calculator: GTIN, Basic UDI-DI (GMN), HIBC and EUDAMED DI

By the eudaflow team · Published:

Check or calculate GTIN, GS1 Basic UDI-DI and HIBC check characters, and the EUDAMED DI and ID of a legacy device. Runs in your browser.

Device identifiers in EUDAMED end with check characters calculated from the rest of the code: the GTIN (the UDI-DI when GS1 issues it), the Basic UDI-DI from GS1 (a Global Model Number, GMN), HIBC codes from HIBCC, and the EUDAMED DI of a legacy device. One mistyped character changes them. This tool checks or calculates all four. Nothing you type leaves your browser.

This tool needs JavaScript. Everything it calculates stays in your browser.

How the GTIN check digit works

The last digit of a GTIN is calculated from the others, using the GS1 modulo 10 method:

  1. Number the digits from the right, starting with the digit just before the check digit.
  2. Multiply the digits in odd positions by 3 and those in even positions by 1.
  3. Add the results. The check digit is the number that brings the sum up to the next multiple of 10.

GS1's own example: for 629104150021 the sum is 57, so the check digit is 3 and the GTIN is 6291041500213.

A 14-digit GTIN that starts with 0 still passes the check digit when Excel has removed that 0, because a leading zero adds nothing to the sum. The check digit cannot catch that mistake. Keep identifiers as text in Excel and compare them with the code on the label.

How the Basic UDI-DI check characters work

When GS1 issues the Basic UDI-DI, it is a Global Model Number (GMN): up to 25 characters, the last two of which are check characters. They are calculated like this:

  1. Every character before the check characters is given its position number in GS1's character set 82 (digits, upper- and lower-case letters and 20 symbols).
  2. Each value is multiplied by a prime number: 2 for the character on the right, then 3, 5, 7, 11 and so on towards the left.
  3. The sum is divided by 1021 and the remainder is split into two numbers from 0 to 31.
  4. Each of the two numbers is turned into a character from a set of 32 that leaves out 0, O, 1 and I, so the check characters cannot be misread.

The example in the GS1 General Specifications is 1987654Ad4X4bL5ttr2310c: the weighted sum is 24521, the remainder 17, and the check characters are 2K. Try it in the tool above. GS1 check characters are case sensitive: a and A are different characters.

How the HIBC check character works

A HIBC code starts with +, followed by the labeler identification code (4 characters, the first a letter), the product or catalogue number, a unit of measure digit and one check character; at most 25 characters. The check character is the sum of the values of all the characters before it, modulo 43, using HIBC's 43 characters: 0 to 9 are worth 0 to 9, A to Z 10 to 35, then - 36, . 37, space 38, $ 39, / 40, + 41 and % 42.

The example in the HIBCC standard: +A123BJC5D6E71 adds up to 145, which leaves 16 after division by 43, so the check character is G: +A123BJC5D6E71G. The check character can also be one of the symbols, for example $ or /.

EUDAMED DI and EUDAMED ID of legacy devices

Legacy devices (under the MDD, AIMDD or IVDD) are registered with an EUDAMED DI in place of the Basic UDI-DI (business rules BR-UDID-640 to 644):

  • The device already has a UDI-DI: the EUDAMED DI is B- followed by that UDI-DI, and the device keeps its UDI-DI.
  • The device has no UDI-DI: the manufacturer provides the EUDAMED DI: B-, a reference of up to 21 characters, then two check characters. The EUDAMED ID, which takes the place of the UDI-DI, is the same code with D- instead of B-.
  • EUDAMED is the issuing entity of both, and it refuses a second legacy device with the same EUDAMED DI.

The Commission recommends starting the reference with the manufacturer's SRN, without its hyphens, because two manufacturers could otherwise pick the same code. Its worked example: SRN BE-MF-000000106 and reference CR023335 give B-BEMF000000106CR023335WE and D-BEMF000000106CR023335WE. The check characters use the same method as the GS1 GMN above: the same character set, the same prime weights and modulo 1021. The B- prefix is left out of the calculation.

The EUDAMED XML samples use EUDAMED DIs such as B-meer344CK and B-MTY_TST_110NP. Their check characters do not follow the algorithm in the Commission's format document (the tool gives 8K and A4), while the document's own worked examples do. Take the check characters from the calculation, not from a sample file.

What this tool does not check

  • Whether the GS1 Company Prefix belongs to you. GS1 keeps that register; your GS1 member organisation can confirm it.
  • Whether a code is already registered in EUDAMED, or registered to another manufacturer.
  • Anything else in your file: the Basic UDI-DI and UDI-DI links, risk class rules, certificates, EMDN codes and the rest. The Playground test report lists what EUDAMED rejected in our tests.

Sources

The calculations in this tool are the same as in the code eudaflow uses to check files before it writes XML. An automated test compares the two on thousands of random codes and checks the GS1, HIBCC and Commission examples on this page.