Máy tính chữ số kiểm tra

Tính toán và xác minh chữ số kiểm tra cho EAN-13, UPC-A, ISBN và nhiều hơn nữa. Xem tính toán Modulo 10 từng bước.

How to Use

  1. 1
    Enter your barcode digits

    Type the barcode number into the input field, omitting the final check digit. For EAN-13, enter the first 12 digits; for UPC-A, enter the first 11.

  2. 2
    Select the barcode standard

    Choose the correct symbology — EAN-13, UPC-A, ISBN-13, or ISBN-10 — to apply the right calculation algorithm. Each standard uses its own weighting pattern.

  3. 3
    Verify or generate the result

    The calculator displays the computed check digit. Paste it at the end of your barcode to complete the number, or enter a full barcode to confirm the existing check digit is correct.

About

Check digits are the final safeguard in any barcode numbering system, providing a mathematical guarantee that the digits preceding them form a valid, consistent sequence. The most widely used algorithm in retail and logistics is Modulo 10, standardized by GS1 and described in ISO/IEC 15420. Each digit in the barcode payload is multiplied by an alternating weight — typically 1 and 3 for EAN and UPC symbols — and the results are summed. The check digit is whichever value, when added to this sum, brings the total to the next multiple of 10. Scanners perform this calculation on every decode, rejecting barcodes whose check digit does not match.

Different standards adopt different algorithms suited to their error profiles. ISBN-10 uses Modulo 11 with descending weights from 10 to 1, allowing the character 'X' to represent a check value of 10. This scheme was chosen because it detects all single-digit errors and all adjacent transpositions — two of the most common human transcription mistakes. When ISBN-13 was introduced to unify book identification with the EAN retail system, the Modulo 10 algorithm was adopted instead, sacrificing the transposition-detection guarantee of Modulo 11 in exchange for full compatibility with GS1-compliant scanners worldwide.

Understanding check-digit arithmetic is essential for anyone generating, printing, or validating barcodes programmatically. Systems that bypass check-digit validation risk writing incorrect GTINs, ISBNs, or ISSNs into databases, leading to misidentification at point of sale, in library catalogs, or across supply chains. GS1 publishes the authoritative specification for EAN/UPC check-digit calculation, while the International ISBN Agency governs the ISBN-10 and ISBN-13 standards.

FAQ

How is the EAN-13 check digit calculated?
EAN-13 uses the Modulo 10 (Luhn-variant) algorithm defined in ISO/IEC 15420. Each digit in positions 1–12 is multiplied alternately by 1 and 3 starting from the left. The sum of these products is subtracted from the next multiple of 10 to give the check digit. If the sum is already a multiple of 10, the check digit is 0. GS1 mandates this algorithm for all EAN and UPC symbols distributed in retail.
Why does ISBN-10 use a different check algorithm than ISBN-13?
ISBN-10, standardized by ISO 2108, uses a Modulo 11 algorithm where digits are weighted 10, 9, 8 … down to 1. Because Modulo 11 can produce a remainder of 10, the Roman numeral 'X' is used as a valid check character. ISBN-13 was introduced to align book identification with the EAN-13 retail barcode system, so it adopts the same Modulo 10 algorithm as EAN-13. Publishers migrated in 2007 by prefixing existing ISBN-10s with '978'.
What happens if a barcode has a wrong check digit?
A scanner that detects a check-digit mismatch will reject the decode and typically attempt a re-scan. This error-detection mechanism catches the most common scanning errors — single digit substitutions and transpositions — with very high reliability. In a retail or logistics context, a failed check causes the scan to return no data, preventing incorrect product or shipment records. The Modulo 10 algorithm detects all single-digit errors and most adjacent transpositions.
Does the check digit protect against all errors?
No. The Modulo 10 check digit is designed to catch single-digit substitution errors and most adjacent digit transpositions, but it cannot detect all possible error combinations. Swapping two non-adjacent digits of equal weighted sum, for example, can go undetected. Higher-security applications use additional error-correction schemes — such as Reed-Solomon coding in 2D symbols like QR Code and Data Matrix — which can both detect and correct multiple errors within the same symbol.
Can I use this calculator for GS1-128 or Code 128 barcodes?
GS1-128 (formerly EAN-128) encodes data using Application Identifiers and inherits the check-digit rules of the underlying GS1 data structure, not from Code 128's own symbol check character. For example, a GTIN-14 encoded in GS1-128 still uses the EAN/UPC Modulo 10 check digit on the 14-digit number. The Code 128 symbol itself appends its own internal check character automatically during encoding, but that is separate from any data-level check digit you calculate here.