# Intelligent Mail Barcode

> Source: https://docs.barcoder.ai/docs/standards/intelligent-mail-barcode
> research date 2026-06-03 · extracted at 2026-10-03
> Publisher: Barcoder — encyclopedia of QR, barcode and payment-code standards

Specifications:
- [Intelligent Mail Barcode (IMb) 4-State Specification — USPS PostalPro](https://postalpro.usps.com/node/2190)
- [Intelligent Mail barcode — Wikipedia](https://en.wikipedia.org/wiki/Intelligent_Mail_barcode)
- [Intelligent Mail Barcode — USPS PostalPro](https://postalpro.usps.com/mailing/intelligent-mail-barcode)

## Overview

The **Intelligent Mail Barcode (IMb)** — also called **USPS OneCode**, the **4-State Customer Barcode (4CB / USPS4CB)**, and **One Code Solution** — is a height-modulated, four-state postal barcode used by the **United States Postal Service** on letters and flats <sup>[1][1], [3][3]</sup>. It packs the routing (ZIP) data of the legacy [POSTNET](https://docs.barcoder.ai/docs/standards/postnet) barcode and the tracking data of the legacy [PLANET](https://docs.barcoder.ai/docs/standards/planet) barcode into a single symbol of **65 vertical bars** encoding up to **31 decimal digits** <sup>[1][1], [4][4]</sup>. The Postal Service required the IMb to qualify for automation prices beginning **January 28, 2013**, making it the de facto standard for U.S. automation-rate mail <sup>[1][1]</sup>.

## History

- The IMb was developed by the **United States Postal Service** to provide greater information and functionality than its predecessors [POSTNET](https://docs.barcoder.ai/docs/standards/postnet) and [PLANET](https://docs.barcoder.ai/docs/standards/planet), folding the routing ZIP Code and the tracking information of those two separate symbologies into one barcode <sup>[1][1], [3][3]</sup>.
- The Intelligent Mail Barcode was introduced to replace **POSTNET in the fall of 2009** <sup>[5][5]</sup>.
- The USPS allowed mailers to continue receiving automation discount rates using POSTNET until **January 28, 2013**, the date on which the Intelligent Mail Barcode became **required** for those reduced rates <sup>[5][5], [1][1]</sup>. The same 2013 cutover fully superseded the [PLANET](https://docs.barcoder.ai/docs/standards/planet) tracking barcode <sup>[6][6]</sup>.
- The official **Intelligent Mail Barcode (IMb) 4-State Specification** continued to be maintained by USPS, with a published revision dated **04/20/2015** <sup>[2][2], [3][3]</sup>.

## Technical specification

The IMb is a **height-modulated, four-state linear postal symbology** <sup>[1][1], [2][2]</sup>:

| Parameter | Value |
|---|---|
| Symbology family | 1D height-modulated, four-state |
| Bars per symbol | 65 fixed |
| Data capacity | 20, 25, 29, or 31 decimal digits |
| Total bits | 130 bits, grouped as ten 13-bit characters |
| Error handling | 11-bit cyclic redundancy check (CRC) — detection only, no correction |
| Information payload | 103 bits (130-bit structure minus 11-bit CRC and framing) |
| Spec document | USPS-B-3200 / IMb 4-State Specification |

**Four bar states** — the term "4-state" comes from each bar being in one of four states <sup>[1][1]</sup>. Every bar has a central **Tracker** portion and may additionally carry an **Ascender**, a **Descender**, neither, or both:

| State | Composition |
|---|---|
| **T** — Tracker | central portion only (no ascender, no descender) |
| **A** — Ascender | tracker + upward extension |
| **D** — Descender | tracker + downward extension |
| **F** — Full | tracker + ascender + descender (full-height bar) |

**Nonlinear character coding** — the 130 bits are arranged as **ten 13-bit characters**, where each character has exactly **2, 5, 8, or 11** of its 13 bits set to one, yielding **2,730 valid characters** (computed via binomial coefficients) <sup>[1][1], [7][7]</sup>. The minimum Hamming distance between characters is at least 2, allowing single-bit error detection within a character <sup>[7][7]</sup>.

**Error detection** — an **11-bit CRC** is embedded to *detect* (but not correct) errors <sup>[1][1], [7][7]</sup>. The Dynamsoft comparison notes that 27 of the 130 bits are devoted to error detection with no correction capability <sup>[6][6]</sup>.

**Data payload structure** — up to 31 digits are organized as <sup>[1][1]</sup>:

| Field | Length |
|---|---|
| Barcode Identifier | 2 digits |
| Service Type Identifier (STID) | 3 digits |
| Mailer ID | 6 or 9 digits |
| Serial / Sequence number | 9 or 6 digits (inverse of Mailer ID length) |
| Routing Code (delivery-point ZIP) | 0, 5, 9, or 11 digits |

The first 11 digits (Barcode Identifier + STID + Mailer ID prefix) form the **Tracking Code**; the trailing 0/5/9/11 digits form the **Routing Code** <sup>[1][1], [6][6]</sup>.

## Use cases

- **Automation-price letters and flats** — the IMb is required for letters and flats prepared for automation prices, covering First-Class Mail postcards, Insured Mail, Certified Mail, and other extra-service mail at automation pricing <sup>[3][3]</sup>.
- **Mail tracking and visibility** — by carrying the Service Type Identifier, Mailer ID, and serial number, the IMb supports USPS mailpiece tracking and Confirm-style visibility services that PLANET previously provided, combined into the same symbol that carries routing data <sup>[1][1], [6][6]</sup>.
- **High-speed automated sorting** — as a height-modulated barcode it is designed for high-speed automated mail-sorting machines, replacing the routing role of POSTNET <sup>[5][5]</sup>.

## Implementations

- **C** — [zint/zint][8] — 771★, active 2026. General-purpose encoding library supporting over 50 symbologies including USPS OneCode (Intelligent Mail).
- **JavaScript** — [metafloor/bwip-js][9] — 2,381★, active 2026. Pure-JavaScript barcode writer (port of Barcode Writer in Pure PostScript) supporting Intelligent Mail among 100+ types.
- **Python** — [samrushing/pyimb][10] — 25★, last commit 2016. Python implementation of the USPS Intelligent Mail Barcode.
- **R (encoder + decoder)** — [mvanhala/uspsimb][11] — 1★, active 2026. USPS Intelligent Mail Barcode encoder/decoder R package.
- **JavaScript decoder** — Douglas Boynton Quine publishes a browser-based POSTNET / PLANET / IMb decoder <sup>[12][12]</sup>.

## Comparison

**vs. [POSTNET](https://docs.barcoder.ai/docs/standards/postnet)** — POSTNET is a two-state (tall/short) height-modulated barcode that encodes only routing data (a 5-digit ZIP, ZIP+4, or 11-digit delivery point code) with a maximum of about 14 numeric digits <sup>[6][6]</sup>. The IMb is four-state, fixed at 65 bars, and carries up to 31 digits including both routing *and* tracking data, with CRC error detection rather than a single modulo-10 check digit <sup>[1][1], [6][6]</sup>. The IMb replaced POSTNET's routing function in 2009 <sup>[5][5]</sup>.

**vs. [PLANET](https://docs.barcoder.ai/docs/standards/planet)** — PLANET was a tracking-only companion to POSTNET (its bar pattern is the inverse of POSTNET), carrying 12–14 digits with a modulo-10 check digit for detection only <sup>[6][6]</sup>. The IMb absorbed PLANET's tracking role; PLANET was fully superseded by the IMb on January 28, 2013 <sup>[6][6]</sup>. Where mailers once printed two separate barcodes (POSTNET for routing, PLANET for tracking), the IMb carries both data sets in one symbol <sup>[3][3]</sup>.

**When to choose it** — for any current U.S. automation-rate mail, the IMb is the only viable choice; POSTNET and PLANET are legacy symbologies that no longer qualify for automation discounts <sup>[6][6]</sup>.

## Fun facts

- The four-state geometry means each of the 65 bars individually carries information through its shape, not just its presence — the **Tracker / Ascender / Descender / Full** scheme gives a single linear barcode far more density than the older two-state POSTNET while staying readable by face-cancelling and sorting equipment <sup>[1][1]</sup>.
- The IMb deliberately uses a **nonlinear coding** in which every 13-bit character must have exactly 2, 5, 8, or 11 bits set — out of 8,192 possible 13-bit patterns, only **2,730** are valid characters, which is what gives the symbology its built-in error-detection robustness <sup>[1][1], [7][7]</sup>.

## Status

**Active and required.** The IMb is the current USPS four-state standard, required for letters and flats prepared for automation prices <sup>[3][3]</sup>. It became mandatory for automation pricing on **January 28, 2013**, the date that retired the automation-discount eligibility of both POSTNET and PLANET <sup>[1][1], [5][5], [6][6]</sup>. The official 4-State Specification remains published and maintained on USPS PostalPro <sup>[2][2]</sup>.

## Sources

[1]: https://en.wikipedia.org/wiki/Intelligent_Mail_barcode
[2]: https://postalpro.usps.com/node/2190
[3]: https://postalpro.usps.com/mailing/intelligent-mail-barcode
[4]: https://barcodeguide.seagullscientific.com/Content/Symbologies/USPS_4-State_Customer_Code.htm
[5]: https://en.wikipedia.org/wiki/POSTNET
[6]: https://www.dynamsoft.com/blog/insights/intelligent-mail-vs-postnet-vs-planet/
[7]: https://handwiki.org/wiki/Intelligent_Mail_barcode
[8]: https://github.com/zint/zint
[9]: https://github.com/metafloor/bwip-js
[10]: https://github.com/samrushing/pyimb
[11]: https://github.com/mvanhala/uspsimb
[12]: https://www.quine.org/postnetj.html
[postnet]: https://docs.barcoder.ai/source/standards/postnet
[planet]: https://docs.barcoder.ai/source/standards/planet

1. [Intelligent Mail barcode — Wikipedia][1] — Wikipedia, accessed 2026-06-03
2. [Intelligent Mail Barcode (IMb) 4-State Specification — USPS PostalPro][2] — USPS, accessed 2026-06-03
3. [Intelligent Mail Barcode — USPS PostalPro][3] — USPS, accessed 2026-06-03
4. [USPS 4-State Customer Code — Seagull Scientific Barcode Guide][4] — Seagull Scientific, accessed 2026-06-03
5. [POSTNET — Wikipedia][5] — Wikipedia, accessed 2026-06-03
6. [Difference Between Intelligent Mail barcode, Postnet and Planet — Dynamsoft][6] — Dynamsoft, accessed 2026-06-03
7. [Intelligent Mail barcode — HandWiki][7] — HandWiki, accessed 2026-06-03
8. [zint/zint — GitHub][8] — GitHub, accessed 2026-06-03
9. [metafloor/bwip-js — GitHub][9] — GitHub, accessed 2026-06-03
10. [samrushing/pyimb — GitHub][10] — GitHub, accessed 2026-06-03
11. [mvanhala/uspsimb — GitHub][11] — GitHub, accessed 2026-06-03
12. [USPS POSTNET, PLANET, and IMB Barcode Decoder in JavaScript — Douglas Boynton Quine][12] — quine.org, accessed 2026-06-03

## Deployments

_No country reports mention this standard by name._
