<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1" -->

---
title: Introduction to barcode parsing | daily.dev
description: Parsing barcodes correctly involves far more edge cases than a simple check digit, so the author built Biip, a Python library for making sense of barcode data....
canonical: https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Introduction to barcode parsing | daily.dev
og:description: Parsing barcodes correctly involves far more edge cases than a simple check digit, so the author built Biip, a Python library for making sense of barcode data....
og:url: https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1
og:image: https://api.daily.dev/og/posts/VfquyGbI1.png
og:image:alt: Introduction to barcode parsing
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to barcode parsing

**[Planet Python](https://daily.dev/sources/planetpython)** · 19 min read · 1 upvotes · 0 comments

## Summary

Parsing barcodes correctly involves far more edge cases than a simple check digit, so the author built Biip, a Python library for making sense of barcode data. Biip has run in production at Oda since 2020, parsing hundreds of thousands of barcodes daily. It handles EAN-13, EAN-8, UPC-A, UPC-E conversions, GS1 Restricted Circulation Numbers with variable weight encoding, and normalization of all GTIN formats into GTIN-14 for reliable database lookups. The code examples are current with Biip 5.2.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://jodal.dev/2026/10/26/barcode-parsing>

## Questions this post answers

### How do I convert a UPC-E barcode to UPC-A in Python?

The Biip library's Upc class provides an as_upc_a() method that expands a parsed UPC-E code into its full UPC-A equivalent, for example turning '14252611' into '142100005261'. Conversely, Upc.parse() on a UPC-A value exposes as_upc_e() to compress back, though only a subset of UPC-A codes can be represented in UPC-E format.

_Developers handling point-of-sale barcode formats can find more parsing patterns like this on daily.dev._

### What is a GS1 Restricted Circulation Number (RCN) and how is it different from a GTIN?

An RCN looks like a GTIN but is only valid within a single company or country rather than globally, and can encode extra data such as product weight, count, or price instead of just identifying the product. For example, a Norwegian RCN starting with '23' encodes six digits for product identity followed by a three-decimal weight in kilograms, then a check digit.

_Teams building cash register or inventory logic around variable-weight products can track these parsing nuances on daily.dev._

### How do I normalize different GTIN formats (GTIN-8, GTIN-12, GTIN-13, GTIN-14) for database lookups?

Pad every GTIN format to 14 digits (GTIN-14) before storing or querying, since GTIN-8, GTIN-12, and GTIN-13 are all left-zero-padded subsets of GTIN-14. The Biip Python library exposes an as_gtin_14() method that converts any parsed GTIN, UPC-A, or UPC-E value into this normalized 14-digit form for consistent database matching.

_Engineers designing product databases that must match barcodes reliably can compare approaches like this on daily.dev._

## Similar posts on daily.dev

- [C\# Barcode Library: Comparing 11 Options for .NET Developers in 2026](https://daily.dev/posts/c-barcode-library-comparing-11-options-for-net-developers-in-2026-9jmviki4z) · C\# Corner · 4 upvotes · 0 comments
- [Barcode printing: Argox changes the game](https://daily.dev/posts/barcode-printing-argox-changes-the-game-lhs0cr1vb) · TechCentral · 0 upvotes · 0 comments
- [ISBN Validation Algorithm: Handling Edge Cases in TypeScript](https://daily.dev/posts/isbn-validation-algorithm-handling-edge-cases-in-typescript-qptme6xmc) · SitePoint · 0 upvotes · 0 comments
- [Variants now support multiple barcodes](https://daily.dev/posts/variants-now-support-multiple-barcodes-1zgdawp1d) · Shopify Developer changelog · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python)

[View this post on daily.dev](https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Introduction to barcode parsing","url":"https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1"},"datePublished":"2026-10-26T01:49:18.014Z","dateModified":"2026-10-26T01:49:59.239Z","description":"Parsing barcodes correctly involves far more edge cases than a simple check digit, so the author built Biip, a Python library for making sense of barcode data....","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"Planet Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/eac3cc584cb043b5a242d13752bd3d0c","url":"https://daily.dev/sources/planetpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet Python","item":"https://daily.dev/sources/planetpython"},{"@type":"ListItem","position":3,"name":"Introduction to barcode parsing"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/introduction-to-barcode-parsing-vfquygbi1#faq","mainEntity":[{"@type":"Question","name":"How do I convert a UPC-E barcode to UPC-A in Python?","acceptedAnswer":{"@type":"Answer","text":"The Biip library's Upc class provides an as_upc_a() method that expands a parsed UPC-E code into its full UPC-A equivalent, for example turning '14252611' into '142100005261'. Conversely, Upc.parse() on a UPC-A value exposes as_upc_e() to compress back, though only a subset of UPC-A codes can be represented in UPC-E format. Developers handling point-of-sale barcode formats can find more parsing patterns like this on daily.dev."}},{"@type":"Question","name":"What is a GS1 Restricted Circulation Number (RCN) and how is it different from a GTIN?","acceptedAnswer":{"@type":"Answer","text":"An RCN looks like a GTIN but is only valid within a single company or country rather than globally, and can encode extra data such as product weight, count, or price instead of just identifying the product. For example, a Norwegian RCN starting with '23' encodes six digits for product identity followed by a three-decimal weight in kilograms, then a check digit. Teams building cash register or inventory logic around variable-weight products can track these parsing nuances on daily.dev."}},{"@type":"Question","name":"How do I normalize different GTIN formats (GTIN-8, GTIN-12, GTIN-13, GTIN-14) for database lookups?","acceptedAnswer":{"@type":"Answer","text":"Pad every GTIN format to 14 digits (GTIN-14) before storing or querying, since GTIN-8, GTIN-12, and GTIN-13 are all left-zero-padded subsets of GTIN-14. The Biip Python library exposes an as_gtin_14() method that converts any parsed GTIN, UPC-A, or UPC-E value into this normalized 14-digit form for consistent database matching. Engineers designing product databases that must match barcodes reliably can compare approaches like this on daily.dev."}}]}
```

