How the barcode generator works
This tool encodes your text as a Code 39 barcode, one of the oldest and most broadly supported linear (1D) barcode symbologies. Everything happens in your browser: type a value, and the generator draws a scannable barcode as an SVG you can download.
Code 39 got its name because each character is built from 9 elements (5 bars and 4 spaces), of which exactly 3 are wide. Every element is either narrow or wide, and a scanner reads the pattern of widths rather than exact measurements. That width-ratio design is what makes Code 39 forgiving about printing size.
The character set
Code 39 can encode 43 characters:
- Letters: A to Z (uppercase only, so this tool auto-uppercases your input).
- Digits: 0 to 9.
- Symbols: space, and
-.$/+%.
If you enter anything outside that set (for example #, @, or a lowercase-only accent), the generator skips it, encodes the valid part, and tells you which characters it dropped. So ITEM#7 becomes ITEM7.
Start and stop guards
Every Code 39 barcode is wrapped in a special guard character, the asterisk *, at both ends. So the value HELLO is actually encoded as *HELLO*. The scanner uses these guards to detect where the code begins and ends and which direction it is being read. The * is a delimiter, not data, so you never type it yourself and it cannot appear inside your text.
For example, encoding A1:
- Add the guards:
* A 1 *. - Look up each character’s 9-element pattern from the Code 39 table.
- Separate every character with a single narrow space (the inter-character gap).
- Add quiet zones (blank margins) before the first bar and after the last.
Quiet zones matter
A quiet zone is the plain white margin on each side of the barcode. Scanners need it to isolate the barcode from surrounding text or artwork. The Code 39 rule of thumb is a quiet zone at least 10 times the width of the narrowest bar. This tool adds that margin automatically, so do not crop tight against the bars when you place the image.
Sizing and downloads
Two controls affect the output:
- Narrow bar width sets the pixel width of the thinnest bar. Everything else (wide bars, spaces, the total width) scales from it, keeping the width ratio correct.
- Bar height is purely visual. Taller bars are easier to scan at an angle but do not change the data.
Download the result as SVG (sharp at any size, best for print) or PNG (a raster image at 2x scale, handy for the web). You can also copy the exact encoded value, including the * guards, to your clipboard.
Why Code 39 and not a retail barcode
People often reach for a “barcode maker” expecting a supermarket UPC or EAN code. Those are the wrong tool for custom text:
- UPC-A is exactly 12 digits with a required check digit.
- EAN-13 is exactly 13 digits, also with a check digit.
- The leading digits are assigned by GS1 and identify a registered company and product.
You cannot turn arbitrary words like WAREHOUSE-3 into a valid UPC, and printing a fake one would collide with a real product. Code 39 has no fixed length, needs no checksum, and encodes letters as well as numbers, which is exactly why it is the standard for asset tags, ID badges, library and warehouse labels, and internal tracking. That is why this generator produces Code 39.
A note on scanning reliability
The barcode this tool produces follows the standard Code 39 patterns and will scan on hardware and phone apps set to read Code 39. Practical tips: keep the quiet zones intact, print at a size where the narrowest bar stays crisp (avoid shrinking below roughly a few thousandths of an inch), and prefer high contrast (black bars on a white background). For very long values, Code 39 barcodes get wide quickly, so keep labels reasonably short.