▥

Barcode Generator

Generate downloadable CODE39, EAN-13, or UPC barcodes

Barcode Generator — what it does

This generator draws CODE39, EAN-13 and UPC-A barcodes from a value you type, with adjustable bar width, bar height and an optional human-readable caption. The result can be downloaded as a vector SVG for print or a PNG for screens, and the check digit required by EAN and UPC is calculated for you.

Worked example

Four values run with the default bar width 2, bar height 90 and “Show readable text” ticked. Sizes are the SVG viewBox, which is also the PNG pixel size.

ValueFormatResultCaption · size
OFFICE-2026CODE39generated; barcode.svg (7.1 KB) and barcode.pngOFFICE-2026 · 448 × 150 px
471234567890EAN-13generated; check digit 0 computed and encoded in the bars4712345678900 · 222 × 150 px
04210000526UPCgenerated; 11 digits in, check digit 4 added042100005264 · 222 × 150 px
4712345678901EAN-13error: EAN-13 check digit should be 0, not 1.previous barcode stays on screen

The caption shows the number that is actually encoded: for 12-digit EAN-13 and 11-digit UPC input it includes the computed check digit. CODE39 captions are uppercase, so office-2026 is printed as OFFICE-2026; a character outside CODE39, such as the parentheses in office-2026 (q4), stops with "Unsupported CODE39 character: (".

When this tool helps

  • Labelling internal stock, equipment or archive boxes so a handheld scanner can log them instantly.
  • Producing a print-ready product barcode from a GTIN your supplier or GS1 registration already assigned.
  • Generating test barcodes while developing or configuring point-of-sale and warehouse scanning software.

How to use it

  1. Type the value to encode into the barcode value field.
  2. Choose the symbology: CODE39, EAN-13 or UPC.
  3. Adjust bar width, height and the readable-text option.
  4. Download the SVG for printing or the PNG for screen use.

Accuracy, limits, and good practice

  • EAN-13 needs 12 or 13 digits and UPC-A needs 11 or 12; CODE39 accepts letters, digits and a few symbols but no lowercase.
  • Print from the SVG whenever you can. Scaling a PNG up thickens bar edges and is the usual reason a printed label will not scan.
  • Keep the quiet zone — the blank margin on both sides — intact. Cropping tight against the bars breaks scanning far more often than low resolution does.

Frequently asked questions

Does generating a barcode register the product anywhere?

No. A barcode is only a visual encoding of a number. Retail GTINs must be licensed from GS1; this tool draws whatever number you already own.

Why was my 12-digit EAN rejected?

EAN-13 carries twelve data digits plus one check digit. Enter the twelve and the check digit is appended, or enter all thirteen and it is verified.

Can I scan the result from my screen?

Usually yes, at a decent bar width and full brightness, though laser scanners read printed labels far more reliably than glass screens.

Does the tool check a check digit I typed myself?

Yes. With 12 digits for EAN-13 (or 11 for UPC) it calculates the check digit and adds it; with all 13 (or 12) digits it verifies the last one and refuses a wrong value instead of drawing a label a scanner would reject. 4712345678901 gave "EAN-13 check digit should be 0, not 1." and 042100005265 gave "UPC check digit should be 4, not 5.", while 4712345678900 and 042100005264 were accepted. The previous barcode stays on screen after an error.

How are the image dimensions worked out, and what does turning the caption off change?

Width is the number of modules times the bar width plus a 16-pixel margin on each side (95 × 2 + 32 = 222 px for EAN-13 and UPC); height is the bar height plus 32, plus 28 more for the caption. OFFICE-2026 in CODE39 came out 448 × 150 px, and unticking the caption made it 448 × 122. The PNG is rendered at exactly those pixel sizes, so increase the bar width rather than scaling the PNG if you need a larger print.

Related tools on this site

Everything above runs inside this page. Barcode Generator needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

條碼生成器能做什麼

這個工具會依你輸入的內容繪製 CODE39、EAN-13 與 UPC-A 條碼,可調整線寬、條碼高度,並選擇是否顯示可讀文字。結果能下載為向量 SVG 供印刷,或 PNG 供螢幕使用;EAN 與 UPC 所需的檢查碼也會自動計算。

實際範例

四個值都以預設的條寬 2、條高 90 並勾選「顯示可讀文字」產生。尺寸是 SVG 的 viewBox,也就是 PNG 的像素大小。

值格式結果文字 · 尺寸
OFFICE-2026CODE39已產生;barcode.svg(7.1 KB)與 barcode.pngOFFICE-2026 · 448 × 150 px
471234567890EAN-13已產生;算出檢核碼 0 並編進條碼4712345678900 · 222 × 150 px
04210000526UPC已產生;輸入 11 位,補上檢核碼 4042100005264 · 222 × 150 px
4712345678901EAN-13錯誤:EAN-13 check digit should be 0, not 1.畫面上仍是前一個條碼

條碼下方的文字就是實際編碼的內容:EAN-13 輸入 12 位、UPC 輸入 11 位時,會連同算出的檢核碼一起顯示。CODE39 的文字一律是大寫,office-2026 會印成 OFFICE-2026;CODE39 不支援的字元(例如 office-2026 (q4) 裡的括號)會停在「Unsupported CODE39 character: (」。

什麼時候用得上

  • 為內部庫存、設備或檔案箱貼標,讓手持掃描器可以即時登錄。
  • 依供應商或 GS1 註冊已配發的 GTIN,產出可直接印刷的商品條碼。
  • 在開發或設定 POS、倉儲掃描系統時產生測試用條碼。

使用步驟

  1. 在條碼內容欄位輸入要編碼的數值。
  2. 選擇條碼格式:CODE39、EAN-13 或 UPC。
  3. 調整線寬、高度與是否顯示可讀文字。
  4. 下載 SVG 供印刷,或 PNG 供螢幕使用。

精確度、限制與實務建議

  • EAN-13 需 12 或 13 位數字,UPC-A 需 11 或 12 位;CODE39 可含英數與少數符號,但不接受小寫。
  • 能用 SVG 印就用 SVG。把 PNG 放大會讓線條邊緣糊掉,這是印出來掃不到的常見原因。
  • 務必保留兩側的空白靜區。緊貼線條裁切導致掃描失敗的機率,遠高於解析度不足。

常見問題

產生條碼等於把商品註冊了嗎?

不是。條碼只是把數字視覺化編碼。零售用 GTIN 必須向 GS1 申請,本工具只負責把你已擁有的號碼畫出來。

為什麼我的 12 位 EAN 被退回?

EAN-13 是十二位資料碼加一位檢查碼。輸入十二位會自動補上檢查碼,輸入十三位則會驗證檢查碼是否正確。

可以直接掃螢幕上的條碼嗎?

線寬夠、亮度足時通常可以,但雷射掃描器讀印刷標籤的穩定度仍遠高於玻璃螢幕。

自己輸入的檢核碼工具會驗證嗎?

會。EAN-13 輸入 12 位(UPC 輸入 11 位)時,工具會算出檢核碼並補上;輸入完整的 13(或 12)位時,會核對最後一位,錯誤就拒絕產生,避免印出掃描器讀不了的標籤。4712345678901 顯示「EAN-13 check digit should be 0, not 1.」,042100005265 顯示「UPC check digit should be 4, not 5.」,而 4712345678900 與 042100005264 都能正常產生。出錯後畫面上仍保留前一個條碼。

圖片尺寸怎麼算?關掉可讀文字會怎樣?

寬度是模組數乘以條寬、再加兩側各 16 像素的留白(EAN-13 與 UPC 是 95 × 2 + 32 = 222 px);高度是條高加 32,有文字時再加 28。OFFICE-2026 以 CODE39 產生是 448 × 150 px,取消勾選文字後是 448 × 122。PNG 就是以這個像素尺寸繪製,需要較大的列印尺寸時請調大條寬,而不是把 PNG 放大。

本站相關工具

以上步驟全部在這個頁面內完成,條碼生成器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。