How the UIC check digit works
The check digit is the twelfth digit, computed by the Luhn algorithm over the first eleven digits. Reading from the right, digits are weighted 2, 1, 2, 1 and so on; any product of ten or more has its two digits added together; the products are summed; and the check digit is (10 − sum mod 10) mod 10.
Worked example — the first eleven digits 21 81 2471 217 give a Luhn check digit of 3, so the complete number ends 217-3. Open a UIC example in the checker.
How it differs from a container number
A container number uses a mod-11 check over four letters and six digits; a UIC wagon number uses Luhn mod-10 over eleven digits. The two are never cross-applied. A bare twelve-digit run is also not self-identifying, so Checkdigit only treats it as a UIC number where the context (a rail-vehicle field, or the UIC option in the calculator) says so.
A note on other rail schemes
North American railcar reporting marks are a different identification scheme with their own rules and are not handled here.