Barcode Generator: 1D and Data Matrix
Pick a symbology, enter your data, and download a sharp-edged barcode ready for print — as a PNG or a scalable SVG.
- Input
- Data · 9 symbologies
- Output
- PNG · SVG
- Processing
- In your browser
- Cost
- Free · no sign-up
Choose a symbology
1D codes are the striped barcodes printed on product packaging. 2D codes are square and hold more data in less space — this includes Data Matrix. Need a QR code? That is a different symbology with its own tool: QR Code Generator.
Letters, numbers and punctuation. The usual choice for internal codes and warehouse labels.
How many pixels each module gets. A higher scale produces a larger, sharper image for printing; module edges stay crisp because the multiplier is always a whole number.
Bar height changes the vertical size of 1D barcode bars without changing the encoded data. Tall is recommended for printed vouchers and general scanning; a compact strip still scans and suits a small label.
Between 5 and 60 mm. Values outside that range are brought back inside it.
The human-readable line lets a person read out or key in the code when a scanner fails. Turn it off when your label template already sets the text itself, so it does not print twice. It has no effect on what scanners read.
The blank margin around the symbol, measured in modules. Each standard sets its own minimum and this control will not go below it — too little white space is the most common reason a printed barcode will not scan, and it looks fine on screen. You can always add more.
Turned as the symbol is drawn, not afterwards, so a sideways code stays as sharp as an upright one. Useful for a spine label or a narrow shelf edge.
Result
PNG · SVGDownload complete
Your barcode has been saved to this device.
- CODE128
- CODE39
- EAN-13
- EAN-8
- UPC-A
- ITF-14
- Data Matrix
- Aztec
- PDF417
Your data is processed locally in your browser and is never sent to Nekhen.
About this tool
Two families of barcode are in everyday use. 1D barcodes are the vertical line patterns you see on price labels and packaging — CODE128 for internal codes, EAN-13 and UPC-A for retail products. 2D barcodes store data in a grid of small squares (modules) and hold far more information in the same space.
Data Matrix is a square 2D symbology used for part marking, medical devices and logistics labels. It looks similar to a QR code, but they are different standards and are not interchangeable. If you need a QR code, use the separate QR Code Generator.
Everything that affects how the symbol *looks* rather than what it says is a separate control: the human-readable line under the bars, the width of the quiet zone, and a quarter-turn rotation for a spine or shelf-edge label. The quiet zone is easy to overlook: too little white space around a barcode can make a printed label fail even when it looks fine on screen. This tool lets you widen it and does not allow a setting below the minimum it supports for the selected standard.
Steps
How to use it
- Choose the code typeStart with 1D (lines) or 2D (squares), then pick the symbology.
- Enter your dataEach symbology has its own rules. EAN-13 needs 12–13 digits; CODE128 and Data Matrix accept letters and numbers.
- Set scale, height and marginScale sets the width of one module; a larger scale prints more sharply. Bar height and the quiet-zone margin are separate controls, and the margin will not go below the minimum its standard requires.
- Download a PNG or an SVGBoth carry the same symbol and the same quiet zone. Choose SVG for print — its bars stay exact at any size — and PNG for anything on screen.
Real situations
Common uses
- Warehouse and inventory labels with CODE128
- Retail product barcodes with EAN-13 or UPC-A
- Small part marking with Data Matrix
- Data-dense shipping documents with PDF417
Privacy
Files are processed locally in your browser and are never uploaded to Nekhen. More detail on the privacy page.
Common questions
Frequently asked
Should I download the PNG or the SVG?
SVG for anything that will be printed. It is a vector, so the bars stay mathematically exact at whatever size the printer lays them down at, and a scanner measures bar widths. PNG for screens, or when the thing you are pasting into will not take an SVG. Both come out of the same encoder with the same settings, so they always carry the same data.
Why is there no JPG option?
Because it would make the barcode worse. JPEG compression produces ringing artefacts around hard edges, and a barcode is nothing but hard edges — the bar boundaries a scanner measures are exactly where the damage lands. If you need a JPG for a system that insists on one, download the PNG and convert it with the Image Converter, at maximum quality.
Why will the quiet zone not go any narrower?
Each symbology defines a minimum blank margin, and the slider stops there. A quiet zone below that minimum can make a printed barcode fail even though it looks normal on screen. Make the margin wider when the label layout allows it, then test a printed sample with the reader that will be used.
Can I turn off the number printed under the bars?
Yes, for the 1D symbologies. That line is the human-readable text, and it exists so a person can read out or key in the code when a scanner fails; leave it on unless your label template sets the text itself, in which case it would print twice. It has no effect on what scanners read. 2D symbologies have no such line, so the control disappears when you pick one.
What is the difference between Data Matrix and QR Code?
Both are square 2D barcodes, but they are separate standards with different finder patterns. Data Matrix uses a solid "L" along two edges and is more space-efficient for short data, which is why it is common for marking small parts. QR Code uses three corner squares and is the one phone cameras normally scan. Nekhen offers them as separate tools because they genuinely are not the same thing.
Which symbologies are available?
1D: CODE128, CODE39, EAN-13, EAN-8, UPC-A and ITF-14. 2D: Data Matrix, Aztec and PDF417. All of them are produced by the BWIPP engine through bwip-js, not by a hand-rolled encoder.
Why was my data rejected?
Each symbology has its own character rules. EAN-13 accepts digits only and must be 12 or 13 characters (the last one is the check digit, calculated for you). CODE39 accepts uppercase letters, digits and a few punctuation marks. The message under the input field explains the rule that applies.
Is the output sharp enough to print?
The code is re-rendered at your chosen scale. For print, prefer SVG or export a PNG large enough for the intended dimensions without resampling it. No scale setting guarantees a successful scan: test a printed label with the intended reader.
Is my barcode data sent to a server?
No. Everything runs in your browser and no data is sent to Nekhen.
More tools
You might also need
Practical guide