公众号二维码 F
o
l
l
o
w
15219461683
News
条形码
条码最后 1 位,是前面 12 位"算"出来的|柏斯特
Time: 2026-09-24 Click count: 617

条码后 1 位,是前面 12 位"算"出来的|柏斯特

有人问过我们一个有趣的问题:"我随便编 12 位数字做成条码,为什么扫码枪死活不响?"

不是枪的问题。因为你编的 12 位,配不上它的第 13 位。

EAN-13 的后一位数字,叫校验位。它不是谁分配的,而是用前面 12 位按固定算法算出来的。今天把这个算法完整教给你——顺便送一条 Excel 公式,让你批量校验手上所有条码。

本篇结构一览(示意图)

01

、算法规则:模 10 加权

规则只有一句话:前 12 位,从左往右,奇数位乘 1,偶数位乘 3,全部加起来,取"补到下一个整十"的数,就是校验位。

02

、拿真实条码演算一遍

以 690123456789 为例(就是上一条推文里拆过的那条码,去掉末位):

[敏感词]步:奇数位(第 1、3、5、7、9、11 位)

> 6、0、2、4、6、8 → 相加 = 26

第二步:偶数位(第 2、4、6、8、10、12 位)乘 3

> 9、1、3、5、7、9 → 相加 = 34,再 ×3 = 102

第三步:合计,取补

> 26 + 102 = 128

> 128 的个位是 8,补到下一个整十需要 2

> 所以校验位 = 2

完整条码:6901234567892。对上了——这就是印刷在条码下的第 13 位。

你随机编 12 位数字,算出正确校验位的概率只有十分之一;而绝大多数随手编的码,[敏感词]次扫描就被这道工序拦下来了。

03

、这套算法是通用的

· UPC-A:同样规则,只是参与计算的是前 11 位;

· ITF-14(箱码):前 13 位算第 14 位;

· EAN-8:前 7 位算第 8 位。

一家通吃。学会这一套,全球主流商品条码的校验位你都会算。

04

、Excel 批量校验公式(直接抄)

假设 A2 单元格放着 12 位数字(不含校验位),在旁边单元格输入:

```

=MOD(10-MOD(SUMPRODUCT(--MID(A2,{1;3;5;7;9;11},1))*1+SUMPRODUCT(--MID(A2,{2;4;6;8;10;12},1))*3,10),10)

```

回车,公式返回应有的校验位。把它和条码实际末位比对:一致 → 码本身没编错;不一致 → 要么抄错了,要么这条码是编造的。

几万个 SKU 拖一下填充柄,全部秒检。

05

、后必须说清的一件事

校验位挡得住手滑,挡不住造假。

它的设计目标是"防呆"——防抄错、防输错、防串号;但一个存心造假的人,完全可以把校验位算对了再卖给你。校验位验的是"数对不对",不是"码真不真"。 要验真,得查 GS1 数据库里的归属主体。

一句话记住分工:校验位防呆,官方数据库防假。

后台回复"校验位",领取我们做好的批量校验 Excel 模板(含公式版和说明),拿来就能用。

EAN-13 校验位 = 前 12 位按"奇位乘 1、偶位乘 3、求和取补到整十"算出,UPC-A/ITF-14/EAN-8 同规则通用

校验位防的是输入错误,不防造假,验真须查官方数据库归属

END

#校验位 #条形码 #EAN13 #Excel技巧 #硬核干货

数据说明:模 10 加权校验算法依据 GS1 通用规范(GS1 General Specifications)校验位计算标准;演算示例 6901234567892 经算法复核无误。

柏斯特|10 年涉外知产与跨境商事服务

香港 + 英国双主体,全球商标/专利/版权 / TRO 诉讼 / 离岸公司 / 条码一站式

已服务 50000+ 出海企业

为什么选择柏斯特:

· 全球化服务网络:香港 + 英国本土主体,多法域落地能力
· 专家型团队:前审查员 + 资深代理人 + 涉外律师三重把关
· 全链条闭环:从注册、年费、异议无效到 TRO 诉讼、平台申诉一气呵成
· 懂出海场景:深度服务主流跨境电商平台,理解卖家真实痛点

长按识别二维码,关注公众号

Our Advantages
Globalised IP Service System
We provide professional and all-round intellectual property strategy solutions for domestic and international corporate clients, including infringement complaints, global certification services and domestic and international trademarks.
Unique international advantages
With rich experience in international agency; with a large number of international cooperation resources; with professional international agents; to provide customers with multi-language (English, German, Japanese, Korean, etc.) global direct service, and currently with more than 150 countries of the world's leading law firms have business cooperation.
Advanced automated case management
The e-submission rate of cases has reached 100%, and the contents of all applications and defence cases are prepared directly by the lawyers. Our attorneys communicate directly with examiners and other department officials by phone or email, allowing us to effectively control and resolve issues and effectively control the progress of the case.
Effective control of the various aspects of the case
The professionalism and experience of our attorneys, who are familiar with local patent laws and fluent in the local language, increases the chances of a one-time examination. We endeavour to gain an in-depth understanding of each case and build a strategy to deal with it on a case-by-case basis.
Effective cost control
Timely and accurate communication with customers, eliminating intermediate links. The application process is clear and transparent, and the client's budget is protected. Most lawyers charge hourly rates, so you can communicate directly with your clients to understand the key points.
Combining the best firms from around the world
We have longstanding relationships with outstanding firms around the world, and when selecting firms to work with in countries other than the United States and Europe, we look for good professional teams and solid operational and management capabilities.
Contact us
  • Tel : +86-15219461683
  • E-mail : monica@yfzcip.com
  • Add : 1301A, Block A, Fenzhigu Mansion, No. 60, Tiezai Road, Bao'an District, Shenzhen, China
Copyright © 2024 Bosite (Shenzhen) International Intellectual Property Service Co., Ltd. All rights reserved.