Data Parsers

Barcode Data Parsers for Structured Data Extraction

Turn the raw contents of driver's licenses, ID cards, passports, boarding passes and GS1 supply chain barcodes into labeled fields. barKoder's built-in parsers run on the device, inside the same SDK that scans the barcode, so your app gets names, dates, numbers and product data without writing its own parsing code.

Every barKoder barcode data parser

A barcode reader returns a string. A barcode data parser tells your app what that string means: which part is the date of birth, the expiry date, the batch number or the flight. barKoder ships these parsers with the SDK and returns their output as labeled fields with each scan.

AAMVA Parser

U.S. and Canadian driver's licenses and ID cards · PDF417

Parses the PDF417 barcode on the back of North American licenses and ID cards, following the AAMVA DL/ID Card Design Standard from v1.0.0 to v10.0. It covers all U.S. states and most Canadian provinces, handles fixed and optional data groups and validates check digits and formatting.

Fields you can map

  • Full name
  • Address
  • Date of birth
  • Document number
  • Issue and expiry dates
  • Jurisdiction and class
  • Endorsements and restrictions
  • Gender and eye color
Parse driver's license barcodes with the AAMVA Parser →

SA DL Parser

South African driving licenses, Smart ID cards and vehicle license discs · PDF417

Decrypts and parses the ultra-dense PDF417 on South African driving licenses, which holds up to 720 bytes, and can return the holder's photo. Two options of the same parser read the Smart ID card and the vehicle license disc.

Fields you can map

  • ID number
  • License number
  • Surname and initials
  • Date of birth
  • Vehicle codes
  • Restrictions
  • Issue and expiry dates
  • Holder photo
Scan SA licenses, IDs and discs with the SA DL Parser →

MRZ Parser

Passports, ID cards, visas and residence permits · OCR

Reads and parses the Machine Readable Zone defined by ICAO Document 9303, in the TD1, TD2, TD3 and MRV formats. It validates check digits and formatting and works offline. MRZ needs a license key with MRZ enabled.

Fields you can map

  • Document type
  • Name
  • Document number
  • Nationality
  • Date of birth
  • Sex
  • Expiry date
  • Issuing country
Read passports and IDs with the MRZ Parser →

GS1 Parser

Supply chain, retail and healthcare barcodes · GS1 Application Identifiers

Splits GS1-formatted data into labeled Application Identifier fields, following the GS1 General Specifications v24. It recognizes GS1 data in Data Matrix, QR Code and 1D symbologies, and handles fixed- and variable-length AIs.

Fields you can map

  • GTIN
  • Batch and lot
  • Expiry date
  • Serial number
  • Quantity, weight, volume
  • SSCC and GLN
Decode supply chain data with the GS1 Parser →

Boarding pass (BCBP) parser

IATA-style Bar Coded Boarding Pass

Parses boarding pass barcodes into structured data: the mandatory header and flight leg data, the variable and security sections, and baggage-related fields. It tolerates small irregularities found in real boarding passes and can report parsing warnings.

Fields you can map

  • Passenger
  • Flight
  • Journey
  • Baggage data
Read boarding passes with the BCBP Parser →

The SA ID and vehicle license disc parsers are options of the SA DL Parser, documented for Android, iOS and six cross-platform frameworks. The BCBP parser runs on every barKoder platform and framework, with step-by-step examples for Android and iOS.

How barcode data parsing works

Reading the barcode and interpreting its contents are two steps. barKoder does both on the device and returns the parsed fields with the scan result.

  1. Scan The camera or your image pipeline delivers the frame: the back of a license, a passport page, a boarding pass or a shipping label.
  2. Decode The SDK reads the barcode, or the MRZ text through OCR. PDF417-LineSight® handles worn license barcodes.
  3. Parse The formatting mode you set (GS1, AAMVA, SADL, BCBP or Automatic) turns the payload into labeled fields. MRZ fields come from the ID document decoder.
  4. Use Read the result's formattedJSON, or formattedText as key/value pairs, and map the fields to your forms and records. For MRZ, read the JSON entry in the result's extra data.
Formatting modes in the barKoder SDK
Mode Value What it does
Disabled 0 Keeps the raw result. This is the default.
Automatic 1 Detects whether the result is parsable and parses it if so.
GS1 2 Uses the GS1 parser.
AAMVA 3 Uses the AAMVA parser.
SADL 4 Uses the South African driver's license parser.
BCBP 5 Uses the Bar Coded Boarding Pass parser.

Parse a driver's license barcode in a few lines

Turn on the decoder for the barcode, set the formatting mode and read the parsed fields from the result. These snippets are copied from the barKoder documentation.

Web SDK: parse AAMVA driver's license data.

JavaScript
            Barkoder.setFormatting(Barkoder.constants.Formatting.AAMVA);
          

Web SDK: read the parsed South African license fields after a scan.

JavaScript
            //access the parsed result
            let SADL_ParsedData = JSON.parse(result.formattedJSON);
          

Python SDK: the same AAMVA parsing on a server or in a script.

Python
            formatting = BarkoderSDK.constants["Formatting"]["AAMVA"];
            BarkoderSDK.setFormatting(formatting);
          
Open the Web SDK API reference

Android: parse boarding passes.

Java
            bkdView.config.getDecoderConfig().formattingType = Barkoder.FormattingType.BCBP;
          

iOS: the same parser.

Swift
            guard let config = barkoderView.config else { return }
            guard let decoderConfig = config.decoderConfig else { return }
            decoderConfig.formatting = BCBP
          

Android: South African license, Smart ID and license disc parsing.

Java
            // Enable PDF417 symbology and South African Driving License parser
            bkdView.config.getDecoderConfig().PDF417.enabled = true;
            bkdView.config.getDecoderConfig().formattingType = Barkoder.FormattingType.SADL;
            // Parsers for data in South African IDs and South African Vehicle License Discs
            Barkoder.SetCustomOption(bkdView.config.getDecoderConfig(), "SADL_decode_ID" , 1);
            Barkoder.SetCustomOption(bkdView.config.getDecoderConfig(), "SADL_decode_vehicle_disk", 1);
          
Open the Android API reference

For MRZ, enable the ID document decoder instead of a formatting mode. Follow the Web MRZ example, the Android MRZ example or the iOS MRZ example. GS1 output can be tuned with the strict_gs1_rules and gs1_format_decimal_places custom options.

Which parser fits your product

Product teams in ID verification, rental, fleet and logistics usually need more than one document type. One SDK covers them all, so you add documents without adding vendors.

Workflow What users scan Parser
ID verification, KYC and onboarding Passports, national ID cards, driver's licenses MRZ Parser, AAMVA Parser, SA DL Parser
Car rental, car sharing and fleet Driver's licenses at check-in, South African vehicle license discs AAMVA Parser, SA DL Parser with the license disc option, plus VIN scanning for the vehicle
Logistics, warehousing and retail Shipping labels, cases, pallets and product packaging GS1 Parser for GTIN, SSCC, batch and expiry
Pharma and healthcare UDI and serialized packs, ID documents at patient onboarding GS1 Parser, MRZ Parser and AAMVA Parser for onboarding
Travel, airlines and hospitality Boarding passes, passports at check-in BCBP parser, MRZ Parser
Access control, events and visitor management ID cards, licenses, passports MRZ Parser, AAMVA Parser, SA DL Parser

What parsing proves, and what it doesn't

Parsed ID and vehicle data in production

Teams that use barKoder to turn licenses, ID documents and license discs into fields their systems can use.

Parsed personal data stays in your app

Decoding, decryption and parsing run locally. The SDK goes online only for the license check, at least once every 30 days, and it doesn't store any personal information retrieved from scanning a barcode. Your application decides what it keeps.

Parsers inside the SDK on every major platform

The parsers ship with the barKoder SDK, so you set a formatting mode in the native, web or cross-platform SDK you already use. Check each parser's docs for the platforms it documents.

  • 7 native & desktop SDKs
  • 6 cross-platform integrations
  • One consistent scanning core

Try barKoder on your phone or in your browser

Install the free barKoder demo app, or open the web demo, and scan your own barcodes 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.

Barcode data parser questions

What is a barcode data parser?

A barcode data parser interprets the decoded contents of a barcode or MRZ according to its standard, such as AAMVA, GS1, ICAO 9303 or IATA BCBP, and returns labeled fields instead of one long string. In barKoder, the parsed barcode data arrives with the scan result as formattedJSON and formattedText. MRZ results arrive in the result’s extra data, as a JSON string and as key/value pairs.

How do I parse a driver's license barcode?

Enable the PDF417 decoder and set the formatting to AAMVA for U.S. and Canadian licenses, or to SADL for South African licenses. Automatic mode detects parsable data for you. Start with the AAMVA Parser or the SA DL Parser, which also covers Smart ID cards and vehicle license discs.

Which barcodes does the GS1 parser read?

GS1-formatted data in Data Matrix, QR Code and 1D barcodes, with fixed- and variable-length Application Identifiers, following the GS1 General Specifications v24. barKoder also decodes GS1 DataBar and GS1 Composite codes. See the GS1 Parser.

Which platforms does the MRZ parser SDK run on?

MRZ is supported on every barKoder platform and framework: Android, iOS, the Web SDK, Windows, Linux, Python, C# and the cross-platform plugins. On the web it uses the barkoder-wasm-ocr package, and on Linux the OCR build on 64-bit systems. Every platform needs a license key with MRZ enabled. See the MRZ Scanner SDK.

Can barKoder parse airline boarding passes?

Yes. Set the formatting to BCBP, or use Automatic mode, which recognizes boarding passes after a lightweight pre-check. The result contains structured passenger, flight and journey data. The parser is available on every barKoder platform and framework. See the Android and iOS examples and the BCBP parser page.

Does parsed ID data leave the device?

No. Scanning and parsing run locally. The SDK connects to the internet only for the license check, at least once every 30 days, and it doesn't store personal information retrieved from scans. What happens to the data next is up to your application.

Does parsing prove that an ID is genuine?

No. Check digits and format checks show that the data was read consistently. They don't establish that the document is authentic or that it belongs to the person presenting it.

Can I generate AAMVA PDF417 barcodes for testing?

barKoder's free online Barcode Generator creates PDF417 barcodes from the data you enter. Use made-up test data, never a real person's details.

Parse your own documents and labels

Get a free 30-day trial key and test the parsers on the licenses, IDs, passports, boarding passes and GS1 labels your users scan, or talk to an SDK expert about your workflow.