Barcode Generator

Generate standard 1D barcodes — Code 128, EAN-13, UPC, Code 39 and more — with a live preview, and download them as PNG or SVG, all in your browser.

FreeNo sign-upPrivate — runs in your browser, nothing is uploaded

Generates standard 1D barcodes (Code 128, EAN, UPC, and more). Runs entirely in your browser — your data is never uploaded.

Quick answer

A barcode generator turns text or numbers into a scannable 1D barcode. Pick a symbology — Code 128 for any text, EAN-13 or UPC for retail products, Code 39 for simple alphanumerics — type your data, and download the result as a PNG or scalable SVG. It validates your input against each format's rules and runs entirely in your browser, so nothing is uploaded.

Formula & method

The tool encodes your data using the chosen barcode symbology's bar-and-space pattern and draws it to a canvas (for PNG) or an SVG (for vector output). Numeric formats like EAN-13 and UPC require a specific number of digits and add a check digit; the tool validates the input and reports when it doesn't fit the format's rules.

Examples

Example 1: Code 128
Input
HiFreeTools
Result
A scannable Code 128 barcode
Why
Code 128 encodes any ASCII text, ideal for internal labels.
Example 2: Retail EAN-13
Input
12-digit product number
Result
EAN-13 with check digit
Why
The 13th digit is calculated automatically.
Example 3: Vector export
Input
Download SVG
Result
A scalable .svg barcode
Why
SVG stays crisp at any print size.

When to use this tool

  • Making product labels (EAN/UPC) or internal asset tags (Code 128/Code 39).
  • Generating a barcode for inventory, shipping, or events.
  • Creating a scalable SVG barcode for print materials.

Common mistakes

  • Using the wrong number of digits for EAN/UPC — those formats require an exact length and reject anything else.
  • Putting letters into a numbers-only format like EAN-13.
  • Exporting a tiny PNG for print; use the SVG for labels and packaging so it scales without blurring.

Frequently asked questions

Which barcode type should I use?

Code 128 is the best general choice for text and numbers. Use EAN-13 or UPC for retail products, and Code 39 for simple alphanumeric labels that older scanners must read.

Can I download a vector barcode?

Yes. Export as SVG for a resolution-independent barcode that stays sharp at any size, or PNG for a quick raster image.

Why does it say my input is invalid?

Numeric formats like EAN-13 and UPC need an exact digit count and only digits. The tool tells you when your data doesn't match the format's rules.

Is my data uploaded?

No. The barcode is generated locally in your browser; your data never leaves your device.

Do I need to add the check digit?

No. For EAN/UPC, the check digit is calculated and appended automatically.

Will these scan reliably?

Yes, with adequate size and contrast. Keep a quiet zone (margin) around the barcode and use black bars on a white background.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the barcode generator to appear: