Embed this tool on your site
About this tool
The Sample Barcode Generator renders test barcodes in seven linear formats: Code 128, EAN-13, EAN-8, UPC-A, Code 39, ITF-14 and MSI. Pick a format and the Value field fills with a sample (for example 9780201379624 for EAN-13), or type your own and click Generate. Rendering uses the JsBarcode library, loaded from a CDN the first time; for EAN-13, EAN-8, UPC-A and ITF-14 you can enter the digits without the last one and the check digit is appended, while a full-length value must already carry a correct check digit. Adjust bar width and height, show or hide the text under the bars, and download the result as an SVG. The Random value button fills a random number of the right length for EAN-13 and EAN-8, a SAMPLE-prefixed value for Code 39, and a 12-digit number for the other formats. It is useful for testing scanner integrations, sample product labels and demo inventory screens.
Why use it
Seven linear formats in one place: Code 128, EAN-13, EAN-8, UPC-A, Code 39, ITF-14 and MSI.
Check digits are appended for EAN-13, EAN-8, UPC-A and ITF-14 when you leave the last digit off.
Vector SVG download stays sharp at any print size.
Built-in sample values for every format, plus a Random value button for quick test data.
How to use
- Choose a format from the Format dropdown; the Value field fills with a valid sample for that format and the barcode renders.
- Type your own value, or click Random value to fill a random one and render it.
- Set Width (bar width, 1-5) and Height (20-200 px), then click Generate to redraw; untick Show text label to hide the digits under the bars.
- Click Download SVG to save the barcode as a vector file named barcode-FORMAT.svg.
When it helps
- Testing barcode scanner hardware or software integrations during development or QA.
- Creating sample product barcodes for demo inventory systems, POS prototypes, or design reviews.
- Generating test labels for retail or logistics software.
- Building barcode examples for documentation or presentations.
Examples
InputFormat: EAN13, Value: 590123412345 (12 digits, check digit auto)
Expected result5901234123457 (13 digits — last digit is computed check digit)
InputFormat: UPC, Value: 03600029145 (11 digits)
Expected result036000291452 (12 digits — last digit is computed check digit)
03Code 128 shipping label
InputFormat: CODE128, Value: TEST-PKG-12345
Expected resultCode 128 barcode encoding TEST-PKG-12345, downloadable as barcode-CODE128.svg
InputFormat: CODE39, click Random value
Expected resultA Code 39 barcode for a value like SAMPLE482, with the text label underneath
Tips
- For retail testing, prefer EAN-13 or UPC-A — these are the formats real-world POS systems handle most often.
- For shipping or logistics tests, use Code 128 — it encodes both letters and digits at high density and is the de facto standard on shipping labels.
- When printing, use the SVG download and let your printer rasterize it at native DPI so the bars stay crisp.
- Always include a quiet zone (white space) of at least 10× the narrow-bar width on each side, or scanners may fail to read.
- If a sample barcode won't scan, increase the bar width or height and click Generate again.
- Mark sample barcodes clearly in any printed label preview as TEST or SAMPLE to prevent accidental shelf placement on real products.
- Width and height changes apply when you click Generate; format changes, Random value and the label toggle redraw immediately.
Frequently Asked Questions
What is EAN-13?⌄
EAN-13 (International Article Number) is a 13-digit barcode standard used globally for product identification. It is the most common retail barcode format outside North America.
What is the difference between EAN-13 and UPC-A?⌄
UPC-A is a 12-digit US/Canadian standard. EAN-13 is a superset: a UPC-A with a leading 0 is a valid EAN-13. Most scanners read both formats.
Are generated barcodes scannable?⌄
Yes. The rendered barcodes are graphically valid and scannable with a barcode reader, but the encoded number is sample data — it does not correspond to a real registered product.
What is Code 128?⌄
Code 128 is a high-density linear barcode that encodes the full ASCII character set (128 characters). It is widely used in shipping labels, healthcare, and logistics.
How is the EAN-13 check digit calculated?⌄
The check digit is computed by summing the digits with alternating weights of 1 and 3, then subtracting the result mod 10 from 10. The 13th digit makes the entire barcode sum to a multiple of 10.
Can it make QR codes or PNG files?⌄
No. This tool renders linear (1D) barcodes only and downloads SVG. For QR codes and PNG export, use the Barcode Generator.
Why does Random value sometimes show an error?⌄
For UPC-A and ITF-14 the Random value button fills a 12-digit number. UPC-A then needs a matching check digit and ITF-14 needs 13 or 14 digits, so the value is often rejected. Type 11 digits for UPC-A or 13 digits for ITF-14 and the check digit is added for you.
Glossary
- EAN-13
- European Article Number — a 13-digit barcode standard used globally for retail product identification, with a single mod-10 check digit at position 13. The most common retail barcode worldwide.
- UPC-A
- Universal Product Code, version A — a 12-digit barcode standard used in the US and Canada for retail products. A UPC-A with a leading 0 is a valid EAN-13.
- Code 128
- A high-density linear barcode that encodes the full ASCII character set (128 characters). Three subsets (A, B, C) optimize encoding length. Used heavily in shipping, healthcare, and logistics.
- Code 39
- An older alphanumeric barcode encoding 0-9, A-Z, hyphen, period, space, and seven symbols. No check digit by default. Common in industrial and inventory tags.
- QR Code
- Quick Response Code — a 2D matrix barcode that encodes URLs, text, or binary data. Includes Reed-Solomon error correction so codes scan even when partially damaged.
- Check digit (mod 10)
- The trailing digit of a numeric barcode, computed by summing odd-position digits, multiplying even-position digits by 3, summing both, and choosing the digit that makes the total divisible by 10.
- Quiet zone
- The blank margin on either side of a barcode (typically 10× narrow-bar width) that lets the scanner detect the start and stop of the bar pattern. Insufficient quiet zone is a leading cause of unreadable barcodes.
- GS1
- GS1 is the global standards organization that issues real GTIN/UPC/EAN prefixes to manufacturers. Sample barcodes generated by this tool are NOT registered with GS1.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.
Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.
✳
✳
✓ Free to use✓ No sign-up✓ 500+ possibilities