Tool 023 / dev / free / runs locally
Barcode Generator
Type a SKU, product code, or short identifier and get a scannable Code 39 linear barcode you can download as a PNG. Code 39 is one of the most widely supported barcode formats for retail, inventory, and ID badges, and needs no special license. Encoding runs entirely through the Canvas API in your browser, so codes never leave your device.
A-Z, 0-9, space, and - . $ / + % only. Lowercase is auto-uppercased.
How it works
This generates a Code 39 barcode, the format sometimes called 3 of 9 because each character is drawn as nine elements, three of which are wide. It is the workhorse of internal labelling: asset tags, shelf locations, work orders, and lab samples, where you control both the printer and the scanner and do not need a retail registration.
The pattern table, the start and stop asterisks, and the mod-43 check character are all implemented here in JavaScript and drawn straight onto a canvas element. Narrow elements are 2 pixels, wide elements 5 pixels, bars are 100 pixels tall, and a 20 pixel quiet zone is added on each side because scanners need that blank margin to find the code at all. The human-readable text is printed underneath.
Because the drawing happens in your tab, an asset ID or a batch number never leaves the device, and the PNG download is generated from the canvas in memory.
How to use it
- Type the value you want to encode. Lowercase letters are uppercased automatically.
- Tick the checksum box if your scanner or label spec expects the mod-43 check character.
- Check the rendered barcode and the human-readable line under it.
- Click Download PNG and print at a size where the narrow bars stay crisp.
Worked examples
Input: abc-1234
Output: A barcode encoding *ABC-1234* with start and stop characters added automatically
Input is uppercased, and the asterisk delimiters required by Code 39 are added for you.
Input: ABC-1234 with the checksum box ticked
Output: A barcode encoding *ABC-1234H* where H is the mod-43 check character
The check character is appended to the data and shown in the human-readable line so you can verify a scan.
Edge cases and limits
- Code 39 only. It does not produce Code 128, EAN-13, UPC-A, ITF-14, or any 2D format. For a 2D code, use the QR code generator instead.
- The character set is A to Z, 0 to 9, space, and the six symbols - . $ / + %. Anything else, including lowercase punctuation and accented letters, is rejected.
- The asterisk cannot appear in your data because it is reserved as the start and stop delimiter.
- Full ASCII Code 39, which encodes lowercase and control characters as two-character pairs, is not implemented.
- Output is a fixed-scale PNG with a 2.5 to 1 wide-to-narrow ratio. There is no SVG export, no rotation, and no adjustable bar height or DPI.
- Code 39 is not dense. A long value produces a very wide barcode, which is a physical constraint of the symbology rather than of this tool.
Common mistakes
- Trying to generate a retail barcode. Products scanned at a till need a UPC or EAN number assigned by GS1, which no generator can invent for you.
- Printing a screenshot instead of the downloaded PNG. Rescaling blurs the bar edges and scanners start failing.
- Omitting the check character when the receiving system expects one, or adding it when the system does not, which shows up as a trailing junk character in the scanned value.
- Shrinking the label until the narrow bars are thinner than the scanner can resolve. Keep the quiet zone and print larger if scans fail.
Frequently asked questions
How is a barcode different from a QR code?+
A barcode like Code 39 is a single line of parallel bars encoding a linear sequence of characters, read by handheld and fixed laser or camera scanners at retail counters and warehouses. A QR code is a 2D square grid that holds more data, including full URLs, and is read by phone cameras. Use a barcode for SKUs and serial numbers in inventory systems; use the QR Code Generator for URLs and Wi-Fi credentials.
What characters can Code 39 encode?+
Uppercase letters A-Z, digits 0-9, space, and the symbols - . $ / + %. Lowercase letters are automatically uppercased. Characters outside this set (accented letters, punctuation like commas or slashes other than those listed, emoji) cannot be encoded and will show an error, since Code 39 has a fixed 43-character set by design.
Do I need the optional checksum character?+
Most retail and shipping scanners read Code 39 without it, since the format already has decent self-checking built into its bar patterns. Enable the mod-43 checksum only if a specific system or scanner you're integrating with requires it; leave it off otherwise so the printed code matches what most scanners expect by default.
What is the mod-43 checksum in Code 39 and do I need it?+
It is a single extra character computed by summing the position value of every data character and taking the remainder modulo 43. It lets a scanner detect a misread. Plain Code 39 is valid without it, so only enable it when your label specification or scanner configuration asks for it.
Why does my barcode have asterisks around the text?+
Code 39 requires an asterisk as both start and stop delimiter. This tool adds them to the encoded bars automatically. Most scanners strip them before sending the value, so the text you get back is just your data.
Related tools
More Developer tools that run entirely in your browser.