# Barcode types and rules

> Reference for the barcode types you can choose in a barcode template: length, characters, prefix and suffix rules, check digits and typical use.

Source: https://docs.vestislabs.com/barcode/barcode-types-reference/

When you create a barcode template, the **Barcode Type** you choose decides how long a barcode can be, which characters it may contain and whether you can add a prefix or suffix. This page lists the rules for each type.

**Where to find it:** Barcode → Manage Templates
**Requires:** permission `VIEW_BARCODE`

The same rules appear on the template page, in the card below the **Barcode Type** list.

## Barcode types at a glance

| Type | Length | Characters | Prefix / suffix | Check digit |
|---|---|---|---|---|
| **EAN-13** | Exactly 13 digits | Numbers only (0-9) | Not allowed. The GS1 prefix is part of the 13 digits | Calculated automatically |
| **UPC-A** | Exactly 12 digits | Numbers only (0-9) | Not allowed. The GS1 prefix is part of the 12 digits | Calculated automatically |
| **GTIN-14 (ITF-14)** | Exactly 14 digits | Numbers only (0-9) | Not allowed | Calculated automatically |
| **Code 128** | 1-80 characters (practical scan limit) | Printable ASCII characters | Allowed | Handled by the encoder, not stored |
| **Code 39** | 1-43 characters (practical limit) | 0-9, A-Z (uppercase), space and - . $ / + % | Allowed | Optional, not enforced |

## What each type is for

- **EAN-13** - Global retail product identifier, scanned at the point of sale. Example: 0000000000017.
- **UPC-A** - North American retail identifier, used on retail product labels in the US and Canada. Example: 000000000017.
- **GTIN-14 (ITF-14)** - Global Trade Item Number for cases, cartons and pallets. Used for master carton, inner pack and pallet labelling in logistics. Example: 10000000000017.
- **Code 128** - High-density barcode for letters and numbers. Used for internal SKU codes, shipping labels and asset tracking. Example: PRD-0001.
- **Code 39** - Self-checking letters-and-numbers barcode (also known as 3 of 9). Used for internal codes, healthcare, automotive and government. Example: SAMPLE-100.

## EAN-13, UPC-A and GTIN-14 need a GS1 company prefix

These three types are GS1 types. They require a company prefix that GS1 assigns to your organisation. When you choose one of them with the **Sequential** method, the range is entered as:

- **GS1 Company Prefix** - For EAN-13, your GS1-assigned company prefix (5-10 digits). For UPC-A, the prefix including the leading number system digit (5-9 digits). For GTIN-14, the packaging indicator (1 digit, 1-8) followed by your GS1 company prefix.
- **Product Code Start** and **Product Code End** - The first and last product code in the range. Their length is whatever remains after the prefix and the check digit.

The template page shows the full number, including the automatically calculated check digit, under each product code field, and how many barcodes the range can hold.

> [!NOTE]
> Selecting EAN-13, UPC-A or GTIN-14 sets the **Barcode Length** to 13, 12 or 14 digits and clears any prefix or suffix.

## Generation methods

- **Sequential** - Barcodes are numbered automatically between the start and end number. **Test Generate** previews up to 50 numbers without saving anything.
- **Manual** - You type the barcode number for each SKU when you [generate barcodes](https://docs.vestislabs.com/barcode/generate-your-barcode/). The number is checked against the template's barcode type and check digit.

## When you edit a barcode number

When you correct a barcode number from the print list, the page checks the new value against the template. It warns you when:

- the number does not pass the type's rules, for example a wrong last digit on a GS1 type
- the number does not start or end with the template's prefix or suffix
- the number has a different length from the template's barcodes
- the number falls inside the range the template numbers from, so it will be skipped when that number comes up

The number must also be unique within your brand.
