Barcode Generator

Generate a Code 39 barcode from text or a number. It redraws as you type and downloads as an SVG that scales to any print size. Your browser encodes the uppercase letters, digits and few symbols that Code 39 allows.

Utility ToolsTrending● Free No upload Instant

Loading Barcode Generator…

Your browser is preparing the tool. It runs 100% locally.

Quick answer

Type a line of text and the tool draws a Code 39 barcode (the widely supported 1-D symbology also called Code 3 of 9) and lets you download it as an SVG. Code 39 carries the digits 0 to 9, uppercase A to Z and the symbols hyphen, period, space, dollar, slash, plus and percent, wrapping your text in the * start and stop characters. The output is vector, so it stays sharp at any size.

What the Barcode Generator does

Enter a part number, asset tag or label text and the barcode redraws instantly underneath, with the human-readable text printed below the bars. Lowercase is converted to uppercase and any unsupported character is dropped, because standard Code 39 only carries 43 symbols. Download gives you an SVG file.

Code 39 is 'discrete' and 'self-checking': every character is encoded on its own from five bars and four spaces, three of which are wide. Even basic scanners read that structure easily, which is why Code 39 has been used for asset tags, ID badges and warehouse labels for decades.

How it works

Each character maps to a fixed nine-element pattern of five bars and four spaces, with exactly three of the nine wide (hence '3 of 9'). The tool draws narrow elements two pixels wide and wide elements three times that, a 3:1 ratio at the top of the 2:1 to 3:1 range the standard allows, which makes scanning more forgiving.

Your text is framed with the * start and stop characters, characters are separated by a one-unit gap, and the whole symbol is emitted as inline SVG. Because SVG is vector, you can drop the file into a label template and scale it without the bars turning fuzzy.

Generation algorithm

  1. Clean the input. Convert to uppercase and drop anything outside Code 39's 43-character set: 0 to 9, A to Z, space, and hyphen, period, dollar, slash, plus and percent.
  2. Frame the data. Wrap the text in the * start and stop characters that every Code 39 reader looks for.
  3. Map each character. Look up each character's nine-element pattern: five bars and four spaces, three of them wide.
  4. Size the elements. Draw narrow bars at 2 px and wide bars at 6 px (a 3:1 ratio), with a one-unit gap between characters.
  5. Emit SVG. Render the bars plus the human-readable text as vector SVG and offer it for download.

Technical details

SymbologyCode 39 (Code 3 of 9), ISO/IEC 16388
Character set0 to 9, A to Z, space, hyphen . dollar / plus % (43 symbols)
Start/stop* (added automatically)
Structure9 elements per character: 5 bars, 4 spaces, 3 wide
Bar ratio3:1 wide-to-narrow (narrow bar 2 px)
Bar height80 px
Check digitNone (the optional mod-43 check is not added)
OutputSVG (vector), with human-readable text below
Where it runsIn your browser, nothing uploaded

Standards & references

  • ISO/IEC 16388: the international standard for Code 39, covering character patterns, bar ratios and the optional check digit.
  • Code 39 character set: 43 symbols, made up of digits, uppercase letters and a handful of punctuation marks. Lowercase and full ASCII need the non-standard Full ASCII extension.
  • Mod-43 check digit: an optional self-check character that some systems such as LOGMARS and HIBC require; this tool does not add one.

Accuracy and limits

No check digit is added. Code 39 is self-checking at the character level, so many systems do not need one. If your scanner or standard (LOGMARS, HIBC) expects the mod-43 check character, though, this output will not include it.

Uppercase only. Type lowercase and it is converted; characters outside the 43-symbol set are silently dropped. Lowercase or the full ASCII range needs the Full ASCII extension, which this tool does not implement.

Code 39 is low-density. Each character takes a fair amount of width, so long values produce wide barcodes. For more data in less space, Code 128 or numeric EAN/UPC pack tighter; this tool only makes Code 39.

Leave a quiet zone (a clear margin of at least ten narrow-bar widths) on each side, and do not shrink the height too far, or scanners may miss it. The SVG is just the symbol plus its text.

It encodes exactly what you type; it does not look a value up or check it against any database. A barcode is a label, not proof that the code is registered anywhere.

Where people use it

Asset and inventory tags

Label equipment, shelves or files with a code the scanners you already own understand.

ID and access badges

Print a Code 39 stripe on staff or visitor badges for quick, reliable scanning.

Internal part numbers

Turn SKUs or part numbers into scannable labels without registering them anywhere.

Forms and documents

Add a scannable reference to a printed form so it can be filed or routed by machine.

When it fits, and when it doesn't

Good for

  • Internal asset, inventory and badge labels
  • Uppercase-and-digit codes your scanners already read
  • Labels you need as scalable vector (SVG)
  • Quick codes with no account or sign-up

Not the best choice for

  • Retail products sold in shops, which use EAN or UPC
  • Lowercase text or the full ASCII range
  • Packing long data into a small footprint

Selling at retail? Those barcodes are EAN-13 or UPC, issued through GS1. Need more data in less width, or lowercase? Code 128 is denser. Want a 2-D code for a URL? Use the QR code generator.

Frequently asked questions

What is Code 39?
It is the 1-D barcode also called Code 3 of 9. It encodes the digits 0 to 9, uppercase A to Z and a few symbols, is read by almost every scanner, and is standardised as ISO/IEC 16388. It has been used for asset and inventory labels since the 1970s.
Why are there asterisks around my barcode?
The * is Code 39's start and stop character. The tool adds one at each end so a scanner knows where the code begins and finishes. It frames the bars but is not part of the value you typed, and it is not shown in the readable text.
Does it add a check digit?
No. Code 39's mod-43 check digit is optional and this tool omits it. If your system requires the check character, as some LOGMARS or HIBC setups do, this output will not satisfy it.
Can I use lowercase letters?
Standard Code 39 is uppercase only, so lowercase is converted to uppercase. Lowercase and extra symbols need the Full ASCII extension, which this tool does not implement.
Which characters are allowed?
The digits 0 to 9, uppercase A to Z, space, and hyphen, period, dollar, slash, plus and percent: 43 symbols in all. Anything else you type is dropped.
Why is my barcode so wide?
Code 39 is low-density: each character needs several bar-widths. Shorten the value, or switch to a denser symbology such as Code 128 if width is a problem (this tool only makes Code 39).
Is this a retail or UPC barcode?
No. Retail products use EAN or UPC codes issued by GS1 and tied to a product database. Code 39 is for internal and asset use and is not registered to any product.
Do I get an SVG or a PNG?
An SVG. It's vector, so it scales to any label size without pixelation. Open it in a browser or design app, or convert it to PNG if a system needs a raster image.
Will any scanner read it?
Code 39 is one of the most broadly supported symbologies, so most laser and camera scanners read it without any special configuration.
Do I need a quiet zone?
Yes. Leave a clear margin of about ten narrow-bar widths on each side and keep the bars tall enough, or scanning gets unreliable.
Is my data sent anywhere?
No. The barcode is generated entirely in your browser; nothing you type is uploaded.
Can I change the bar height or ratio?
Not in this tool. It fixes an 80-pixel height and a 3:1 wide-to-narrow ratio, both within spec for reliable scanning.

References

Encodes standard Code 39 per ISO/IEC 16388 (uppercase, the 43-character set, no check digit) as vector SVG, generated in your browser.

PopularHot

QR Code Generator

Text or a link in, a QR code PNG out.

UtilityOpen
Popular

Stopwatch and Timer

Count up with laps or count down from any number of minutes.

UtilityOpen
Popular

Online Notepad

Notes that auto-save on this device, with a .txt download.

UtilityOpen
Popular

Unit Converter

Length, weight and volume, converted as you type.

UtilityOpen
Trending

Random Name Picker

Paste a list of names and draw a winner at random.

UtilityOpen
Trending

Pomodoro Timer

Use the countdown timer for work and break blocks.

UtilityOpen

Back to the Barcode Generator

It's free, it needs no account, and it runs on this device.