# GS1 UDI Barcode Format & AI Parser Guide (GS1-128 & DataMatrix)
> Parse GS1-128 linear barcodes and 2D DataMatrix medical device UDIs into structured DI/PI attributes in milliseconds.

- **Canonical URL:** https://stanzaapi.com/tools/udi-decoder/standard/gs1-udi-format
- **Governing Standard:** FDA 21 CFR 801.20 / EU MDR 2017/745 (FDA AccessGUDID Database & IMDRF)
- **Latency:** <2ms Edge
- **Privacy:** In-memory execution only (zero data stored or logged)

## Technical Overview & Governing Rules
GS1 UDIs utilize Global Trade Item Numbers (GTIN) as the Device Identifier (AI 01) and standardized Application Identifiers for Production Identifiers.

## Specification Matrix
| AI | Data Element | Format | FDA / MDR Role |
| --- | --- | --- | --- |
| (01) | GTIN-14 | 14 digits numeric with Mod-10 | Primary UDI-DI |
| (17) | Expiration Date | YYMMDD (6 digits) | UDI-PI Expiration |
| (10) | Batch / Lot | 1-20 alphanumeric characters | UDI-PI Lot Number |
| (21) | Serial Number | 1-20 alphanumeric characters | UDI-PI Serial Number |
| (11) | Manufacturing Date | YYMMDD (6 digits) | UDI-PI Production Date |

## Standard JSON Response Model
```json
{
  "issuingAgency": "GS1",
  "di": "00884838012345",
  "pi": {
    "expirationDate": "2026-08-31",
    "lotNumber": "LOT7788",
    "serialNumber": "SN991823"
  }
}
```

## Frequently Asked Questions & Edge Cases
### Q: Is GTIN check digit validation included?
**A:** Yes, the Modulo-10 check digit is verified on the GTIN-14 Device Identifier.
