Home › Developer Tools › Barcode Generator

Barcode Generator

Type a number or text, pick a barcode type and download a crisp PNG or SVG. Check digits are calculated for you, and bulk mode turns a whole list into a ZIP of barcodes.

Last updated:

Appearance

Advertisement
Advertisement

How to use the Barcode Generator

  1. Choose a barcode type. Use EAN-13 or UPC-A for retail products, Code 128 for text and internal labels, ITF-14 for shipping cartons.
  2. Enter the value. For EAN and UPC you can leave out the last digit: the check digit is added automatically.
  3. Adjust the look: bar width, height, text, margins and colors. The preview updates instantly.
  4. Download PNG or SVG. SVG is best for print and design tools because it scales without blurring.
  5. Need many barcodes? Switch to Bulk, paste one value per line and download them all as a ZIP.

Barcode types compared

TypeCharactersLengthCheck digitTypical use
Code 128All 128 ASCII charactersVariableMod 103 (built in, always added)Shipping labels, inventory, asset tags, GS1-128
EAN-13Digits13Mod 10 (weights 1, 3)Retail products worldwide, books (ISBN 978/979)
UPC-ADigits12Mod 10 (weights 3, 1)Retail products in the USA and Canada
EAN-8Digits8Mod 10Small packages where EAN-13 does not fit
Code 39A–Z, 0–9, space, - . $ / + %VariableOptional mod 43Automotive (AIAG), defense, ID badges, older systems
ITF-14Digits14Mod 10 (GTIN-14)Cartons and cases in the supply chain

How the GS1 check digit is calculated

EAN-13, UPC-A, EAN-8 and ITF-14 all use the same mod 10 rule. Starting from the digit just left of the check digit and moving left, multiply the digits alternately by 3 and 1, add the products, and take the amount needed to reach the next multiple of 10.

Example for EAN-13 590123412345?: from the right, 5×3 + 4×1 + 3×3 + 2×1 + 1×3 + 4×1 + 3×3 + 2×1 + 1×3 + 0×1 + 9×3 + 5×1 = 15 + 4 + 9 + 2 + 3 + 4 + 9 + 2 + 3 + 0 + 27 + 5 = 83. The next multiple of 10 is 90, so the check digit is 7 and the full number is 5901234123457.

Code 128 uses a different checksum that is always added automatically and never printed: the start code plus each symbol value times its position, modulo 103.

Printing tips for barcodes that scan

  • Keep the quiet zone. Leave white space on both sides of at least 10 times the narrowest bar (EAN/UPC: about 11 modules on the left and 7 on the right). The margin setting controls this.
  • Use dark bars on a light background. Black on white is best. Red bars are invisible to most laser scanners, and inverted (light on dark) codes often fail.
  • Do not squash the barcode. Scale width and height together. For print, download SVG or a 3x/4x PNG so the bar edges stay sharp.
  • Test before mass printing. Scan a printed sample with a phone app or a handheld scanner, especially on curved or glossy packaging.

Frequently asked questions

Which barcode type should I use?

Retail products sold in stores use EAN-13 (worldwide) or UPC-A (USA and Canada), with numbers issued by GS1. Code 128 is the most compact general-purpose barcode for letters and numbers, used for shipping labels, inventory and asset tags. Code 39 is older and larger but still required by some industries. ITF-14 marks outer shipping cartons.

Can I make a real UPC or EAN for my product here?

You can generate the barcode image for any number, but to sell in stores the number itself must be licensed from GS1 (or your retailer's approved source). The generator draws the barcode; it does not issue product numbers.

How is the check digit calculated?

For EAN-13, UPC-A, EAN-8 and ITF-14, multiply the digits alternately by 3 and 1 starting from the rightmost digit before the check digit, add the results, and the check digit is the amount needed to reach the next multiple of 10. For example 590123412345 gives a sum of 83, so the check digit is 7.

PNG or SVG: which should I download?

SVG is a vector file that stays perfectly sharp at any size, ideal for print, labels and design software. PNG is a pixel image that works everywhere; choose 2x or 4x for printing so the bars stay crisp.

What size should a printed barcode be?

For EAN-13 and UPC-A the nominal size is about 37.3 × 25.9 mm (UPC-A) and 37.3 × 26.3 mm (EAN-13), and they can be scaled from 80% to 200%. Keep the white quiet zone on both sides and use dark bars on a light background for reliable scanning.

Why will my barcode not scan?

Common causes are a missing quiet zone (margin), low contrast (for example red bars or a dark background), bars printed too small or blurred, and a wrong check digit. Test the printed result with a phone scanner before printing large batches.

Is the generator free for commercial use?

Yes. The barcodes you create are yours to use on products, labels and documents without attribution.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

QR Code GeneratorMake QR codes for links, Wi-Fi, email and more.QR Code ScannerScan QR codes with your camera or from an image and safely read the link or text.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Inventory Turnover CalculatorInventory turnover ratio and days inventory outstanding from COGS or sales and average stock.ACoS CalculatorCalculate ACoS, ROAS, break-even ACoS and target ACoS from ad spend, sales and margin.ISBN Barcode GeneratorTurn an ISBN-10 or ISBN-13 into a print-ready EAN-13 book barcode with price add-on. SVG/PNG/PDF.Luhn Algorithm CheckerValidate numbers with the Luhn mod 10 check or calculate the missing check digit, step by step.Mercari Fee CalculatorMercari selling and processing fees, earnings and profit, with editable rates.UUID GeneratorGenerate UUID v4 and v7 / GUIDs in bulk and copy or download them.Schema Markup Generator (JSON-LD)Create JSON-LD structured data for FAQ, Product, Article and more.Htaccess & Nginx Redirect GeneratorBuild 301 redirects for .htaccess, Nginx and Netlify or Cloudflare _redirects.Fake Data GeneratorGenerate mock data as JSON, CSV or SQL.Random String GeneratorGenerate secure random strings and tokens in bulk with any length and character set.API Key GeneratorCreate secure API keys and secrets with prefixes, checksums and SHA-256 hashes for storage.MIME Type LookupFind the MIME type for any file extension, or the extensions for a MIME type, in 400+ entries.Cron Expression GeneratorBuild crontab schedules visually, read them in plain English and see the next run times.URL Slug GeneratorTurn titles into clean, SEO-friendly URL slugs: accents, stop words, separators and bulk lines.JSON Schema GeneratorTurn sample JSON into a draft 2020-12 JSON Schema with types, required fields and formats.Gitignore GeneratorBuild a .gitignore from 50+ templates for languages, frameworks, IDEs and OS, merged and deduped.License GeneratorCreate a LICENSE file for MIT, Apache, GPL, BSD, ISC, MPL or Unlicense with your name and year.ULID GeneratorGenerate sortable ULIDs and UUID v7 in bulk, monotonic option, and decode their timestamps.Htpasswd GeneratorCreate .htpasswd entries with bcrypt, APR1-MD5 or SHA-1 for Apache and Nginx basic auth.Placeholder Image GeneratorCreate placeholder images in any size, color and text as PNG, JPG, WebP, SVG or data URI.Ads.txt GeneratorCreate or validate ads.txt and app-ads.txt files: seller lines, cert IDs and variables.Docker Run to Compose ConverterConvert docker run commands to docker-compose.yml, or a compose file back to docker run.Dockerfile GeneratorGenerate a production Dockerfile and .dockerignore for Node, Python, Go or a static nginx site.HTML Boilerplate GeneratorTick the options you need and get a clean HTML5 starter template with meta, OG tags and CSS reset.JSON to Zod SchemaInfer a Zod (or Yup) schema from sample JSON with optional, nullable and z.infer types.Linux Commands Cheat SheetSearchable Linux and bash command reference with flags explained, examples and copy buttons.LLMs.txt GeneratorBuild an llms.txt file for AI crawlers: summary and link sections, import from your sitemap.Nano ID GeneratorGenerate secure Nano IDs with custom alphabet, length and count, plus a collision calculator.Nginx Config GeneratorBuild an nginx server block: static site, SPA, reverse proxy or PHP, with SSL, gzip and redirects.OpenAPI / Swagger ViewerView OpenAPI 2/3 JSON or YAML as interactive API docs with validation and an endpoint list.package.json GeneratorFill a form and get a valid, npm-ready package.json with scripts, dependencies and checks.PKCE Code Challenge GeneratorGenerate an OAuth 2.0 PKCE code_verifier and S256 code_challenge, build auth URLs, verify pairs.README GeneratorFill in a form and get a polished README.md with badges, install, usage and license, live preview.Regex GeneratorBuild regular expressions visually from blocks or presets (email, date, phone) and test them live.Commit Message GeneratorBuild Conventional Commit messages with type, scope, body, breaking change and issue refs.TypeScript PlaygroundWrite TypeScript with live type checking, see the compiled JavaScript and run it in your browser.Article Schema GeneratorCreate Article, BlogPosting or NewsArticle JSON-LD with headline, authors, dates and images.Event Schema GeneratorCreate Event JSON-LD with dates, venue or online location, tickets, organizer and performers.Google Search Query BuilderBuild advanced Google searches with site:, filetype:, intitle:, exact phrases and date operators.HowTo Schema GeneratorCreate HowTo JSON-LD with steps, tools, supplies, total time and cost, then copy it.Htaccess GeneratorBuild an Apache .htaccess file: HTTPS, www, gzip, caching, error pages, IP blocks, hotlinks.HTML Email Template BuilderDrag and drop blocks to build a responsive, table-based HTML email with inline styles.Organization Schema GeneratorCreate Organization JSON-LD with logo, URL, contact points, address and social profiles.PIN GeneratorGenerate random 4, 6 or 8-digit PINs that avoid sequences, repeats, dates and common PINs.Question Keyword GeneratorFind the questions people ask about a topic, grouped by who, what, why, how, can and more.Recipe Schema GeneratorCreate Recipe JSON-LD with ingredients, steps, prep and cook times, nutrition and ratings.Security Headers GeneratorPick HSTS, CSP, frame, referrer and permissions options and get Apache, Nginx, Netlify or Cloudflare config.SKU GeneratorBuild consistent SKUs from brand, category, size and color, then export every variant as CSV.Typography Scale GeneratorBuild a modular type scale from a base size and ratio, then copy CSS variables or a Tailwind config.WordPress Salt GeneratorGenerate fresh WordPress security keys and salts for wp-config.php, .env or Docker in one click.ANSI Color Code GeneratorStyle terminal text with 16, 256 or RGB colors and get escape codes for bash, Python, JS and C.Apache Virtual Host GeneratorCreate an Apache VirtualHost config with SSL, redirects, reverse proxy or PHP-FPM in seconds.Bash Prompt GeneratorDrag and drop a custom PS1 prompt for bash or zsh with colors, git branch and a live preview.Changelog GeneratorTurn Conventional Commit messages into a grouped Keep a Changelog Markdown file per version.cURL Command BuilderBuild curl commands from a form: method, headers, query, JSON or form body, auth and flags.Docker Compose to KubernetesConvert docker-compose.yml into Kubernetes Deployment, Service, ConfigMap and PVC manifests.Docker Compose ValidatorCheck a docker-compose.yml for YAML errors, schema mistakes, broken references and deprecated keys.Dockerfile LinterLint a Dockerfile for best practices: pinned tags, apt cleanup, non-root USER and layer count.Dockerignore GeneratorBuild a .dockerignore from Node, Python, Go and Java templates, plus your own entries.ESLint Config GeneratorGenerate a flat eslint.config.js for JavaScript, TypeScript, React or Node with rule presets.Git Branch Name GeneratorTurn a ticket ID and title into a clean, valid git branch name like feature/PROJ-12-add-login.GitLab CI Config GeneratorGenerate a .gitlab-ci.yml with stages, jobs, images, cache, artifacts and rules from templates.Jinja2 Template TesterRender Jinja2 templates with YAML or JSON variables using real Jinja2, with clear error lines.JSON Schema Mock Data GeneratorGenerate realistic sample JSON from a JSON Schema: formats, patterns, $ref, seeds and counts.Kubernetes Secret GeneratorCreate Kubernetes Secret YAML from key/value pairs or .env with auto base64, or decode one.
See all 85 Code Generators & Builders →