Code 32 (Italian Pharmacode) Barcode Scanner SDK

Code 32, also called Italian Pharmacode, is the Code 39 variant that carries the 9-digit AIC number of medicines sold in Italy, converted to six base-32 characters. barKoder reads Code 32 on medicine packs with the phone and tablet cameras in your iOS, Android and web apps.

Code 32

Code 32 at a glance

Code 32 (Italian Pharmacode) key facts
Type1D linear barcode. A variant of Code 39 with the same bars, start and stop characters.
Character setData: digits only (the AIC number). Printed as base-32 characters: the digits 0 to 9 and the letters B to Z except E, I and O.
CapacityFixed: one 9-digit AIC number, encoded as six base-32 characters
Check digitThe ninth AIC digit, a mod 10 check digit calculated from the first eight
StandardNo ISO/IEC standard of its own. The bars follow Code 39 (ISO/IEC 16388). The AIC number is assigned by the Italian Medicines Agency (AIFA).
Typical usesPacks of medicines for human use sold in Italy: dispensing, pharmacy stock and pharmaceutical distribution

What a Code 32 barcode is and how it is built

Every medicine authorized for sale in Italy has an AIC number (Autorizzazione all'Immissione in Commercio), assigned by AIFA with the marketing authorization. The AIC is 9 digits long: the first is always 0 and the last is a check digit. Code 32 is the barcode that carries this number on the pack, on the bollino label that manufacturers apply to the outer packaging.

Code 32 is not a separate bar pattern. It is Code 39 with a different way of writing the data:

A reader that only knows Code 39 returns the six base-32 characters. A Code 32 decoder converts them back to the AIC number and can verify the check digit. barKoder's Code 32 decoder returns the AIC number.

From AIC number to Code 32 barcode

Encoding the example AIC number 012345676
StepResult
First eight digits01234567
Check digit0 + 2 + 4 + 6 = 12. Doubled: 2, 6, 10 (1 + 0 = 1), 14 (1 + 4 = 5), total 14. 12 + 14 = 26, so the check digit is 6.
AIC number012345676
Base 320CSSBD
Encoded as Code 39*0CSSBD*
Printed textA012345676

Code 32, Laetus Pharmacode and GS1 DataMatrix

"Pharmacode" can mean two different barcodes, and Italian medicine packs are moving to a third. This page covers Code 32 only.

Pharmaceutical barcodes that are often mixed up
BarcodeWhat it encodesWhere you see it
Code 32 (Italian Pharmacode)The 9-digit AIC number, as six base-32 characters in Code 39 barsPacks of medicines sold in Italy
Laetus PharmacodeA different symbology from Laetus GmbH: a single number from 3 to 131,070 written in binary as 2 to 16 thin and thick barsPharmaceutical packaging lines, as a packing control code that checks the right printed material is used
GS1 DataMatrixGTIN, serial number, batch, expiry and, in Italy, the AIC number with Application Identifier (716)The EU unique identifier on prescription medicine packs. A 2025 Italian decree specifies it for packs sold in Italy. See Data Matrix.

Where Code 32 barcodes are used

Code 32 is specific to the Italian pharmaceutical market. Medicines sold in other countries usually carry GS1 DataMatrix or EAN-13 instead.

Pharmacies and hospitals

Dispensing, stock

Pharmacies scan the Code 32 barcode to identify each medicine by its AIC number when dispensing it and when managing stock.

Barcode scanning for healthcare →

Pharmaceutical distribution

Wholesalers, logistics

Wholesalers and distributors identify medicine packs by their AIC number. While Italian packs move to GS1 DataMatrix, which also carries the AIC, their apps may need to read both barcodes.

Barcode scanning for logistics →

Pharmaceutical manufacturing

Packaging, bollino

Manufacturers apply the bollino, which carries the AIC number, to the outer packaging of medicines for the Italian market. The bollino is printed by the Istituto Poligrafico e Zecca dello Stato.

Barcode scanning for manufacturing →

Scanning Code 32 with barKoder

The barKoder Barcode Scanner SDK reads Code 32 on iOS, Android, the web, Windows and Linux, and in Flutter, React Native, .NET MAUI, Capacitor, Cordova and NativeScript apps. These features matter most for this code.

A dedicated Code 32 decoder

Code 32 has its own decoder in barKoder, separate from Code 39, with its own configuration class on Android. Enable it on its own for a pharmacy app, or together with Code 39 if your app also reads other Code 39 labels.

Web SDK API reference →

Segment Decoding® for curved packs

Reads all supported 1D barcodes when they are deformed along the Z axis, such as labels on bottles, tubes and other rounded surfaces. It is off by default.

Segment Decoding® →

Batch MultiScan for many packs at once

Decodes several barcodes in a single camera view, whatever their type or size. Use it to register a delivery of medicine packs in one pass, Code 32 and Data Matrix together.

Batch MultiScan →

GS1 parser for the new Data Matrix packs

When a pack also carries a GS1 DataMatrix, the GS1 parser splits it into labeled fields such as GTIN, batch, expiry and serial number, so one app handles both barcodes.

GS1 Barcode Parser →

Code 32 barcode reader API

Enable only the decoders you need. This Web SDK call from the barKoder docs enables the Code 32 decoder.

Web SDK (JavaScript)

JavaScript
Barkoder.setEnabledDecoders(Barkoder.constants.Decoders.Code32);

setEnabledDecoders takes any number of decoders. Add Barkoder.constants.Decoders.Datamatrix to read GS1 DataMatrix packs in the same session.

Get scanning in three steps

  1. Get a free trial license and install the SDK for your platform.
  2. Enable the Code 32 decoder, and Data Matrix if your packs carry both codes.
  3. Read the barcode type and text in your result callback, and check the output format on your own packs.
See the Web SDK example

Enable symbologies on other platforms: Android, iOS, Flutter, React Native, Capacitor, Cordova, .NET MAUI and NativeScript.

Scan a Code 32 barcode on your phone or in your browser

Install the free barKoder demo app, or open the web demo, and scan your own Italian medicine packs before you integrate the SDK.

iPhone and iPad

barKoder demo app for iOS

Scan with your camera, or point it at the QR code to open the App Store.

Download on the App Store
QR code linking to the barKoder demo app on the App Store

Android phones and tablets

barKoder demo app for Android

Scan with your camera, or point it at the QR code to open Google Play.

Get it on Google Play
QR code linking to the barKoder demo app on Google Play

Any modern browser

barKoder web demo

Runs the Web SDK in your browser, on desktop or mobile, with nothing to install.

Open the web demo
QR code linking to the barKoder web demo

Test with known samples. Print or display the testing sheet and scan each 1D and 2D barcode with the demo app. The data sheet summarizes the SDK for your team.

Code 32 and pharmacode scanner questions

What is a Code 32 barcode?

Code 32, or Italian Pharmacode, is the barcode on packs of medicines sold in Italy. It carries the product's 9-digit AIC number, assigned by the Italian Medicines Agency (AIFA). The number is converted to six base-32 characters and printed as a Code 39 barcode, with the AIC number and the prefix A printed underneath.

Is Code 32 the same as Pharmacode?

Not always. "Pharmacode" is used for two different barcodes. Code 32 is the Italian Pharmacode described on this page. Laetus Pharmacode is a separate symbology that writes a number from 3 to 131,070 in binary as thin and thick bars, and is used as a packing control code on pharmaceutical packaging lines. If you search for a pharmacode scanner for Italian medicine packs, you need a Code 32 reader.

Why does my scanner show six letters and digits instead of the AIC number?

Because it decoded the barcode as plain Code 39. The six characters, for example 0CSSBD, are the AIC number in base 32. A Code 32 decoder converts them back to the 9-digit number, here 012345676. In barKoder, enable the dedicated Code 32 decoder with Barkoder.setEnabledDecoders(Barkoder.constants.Decoders.Code32); and check the result format on your own packs.

Is Code 32 being replaced by Data Matrix in Italy?

Italy is adopting the EU unique identifier for prescription medicines. A decree of the Italian Ministry of Health of 6 March 2025 specifies a GS1 DataMatrix on the outer packaging that carries the GTIN, serial number, batch, expiry and the AIC number under Application Identifier (716). Until every pack has switched, apps in Italian pharmacies and distribution may see both codes. barKoder reads both, and its GS1 parser splits the Data Matrix into labeled fields.

Can a phone app read Code 32 barcodes?

Yes. With barKoder, iOS and Android phones and tablets read Code 32 with the built-in camera, and web apps read it in the browser through the WASM Barcode Scanner SDK. For a quick check without installing anything, the free online barcode scanner lists Code 32 (Pharmacode) among the codes it reads.

How do I create a Code 32 barcode?

Use the free barKoder barcode generator, which supports Code 32 (Pharmacode) with numeric input of up to 8 digits. Print a few samples and scan them with the demo app before you print on packs.

Add Code 32 scanning to your app

Test the SDK on your own Italian medicine packs with a free 30-day trial, or talk to an SDK expert about your project.