Bit Length Is Not a Format: Five 34-Bit Layouts

2026-11-15 · 1210 words

Ask someone in the trade for "the 34-bit Wiegand format" and you will usually get one answer: 16 bits of facility code, 16 bits of card number, two parity bits. That answer is right for the credential in their hand and wrong for the one on the next door.

Thirty-four bits is a length. A length constrains how many bits arrive; it says nothing about where the fields sit. In the published tables there are five layouts sharing that length, from four vendors, and two of them overlap in a way that produces a facility code nobody will question until a cardholder is standing at a door that will not open.

This is not a curiosity. It is the single most common way a working decoder returns a confidently wrong answer.

The five

The most widespread is HID H10306, also documented by Honeywell as N10002. A leading parity bit, sixteen bits of facility code, sixteen bits of card number, a trailing parity bit. With 65,536 facility codes and 65,536 cards per facility, it is the natural step up from the 26-bit standard when a site runs out of facility codes.

AWID's RS2 has the same total length and a different split: eight bits of site code, twenty-four bits of card number. Read an RS2 credential with an H10306 decoder and you get a facility code built from the top eight bits of the site field plus the first eight bits of the real card number. Both numbers look plausible. Neither is the number the panel was programmed with. The frame passes parity, because parity is about bits, not meaning. The controller accepts it, the door does not open, and the installer spends an afternoon on the reader instead of the credential.

Indala's Optus format splits eleven bits of site against sixteen bits of card, and the published table places them apart: site code in the high bits, card number near the front. Seven of the thirty-four columns are marked for neither field. That gap is information, not an omission to be tidied away.

Cardkey Smartpass carries three fields, not two. Thirteen bits of site, three bits of issue level, sixteen bits of card number. The issue level is the one that gets dropped. Drop it and you are decoding a card number that is off by whatever the issue level contributed — usually zero, sometimes not, which is worse than always wrong, because it works often enough to look correct.

BQT takes a fourth approach: eight bits of facility code and twenty-four bits of card number. Same shape as AWID RS2, different vendor, and unlike RS2 this one publishes its parity rows — over spans that do not line up with the field boundary. The even region runs across the end of the facility code and the first eight bits of the card number. So parity and field layout are two separate questions, and getting one right tells you nothing about the other.

The seven empty columns

The Indala entry is worth pausing on, because the instinct when you see a table with gaps is to fill them. Thirty-four bits minus twenty-seven assigned leaves seven. Two of those are plausibly parity. The other five are unknown.

You can always construct a tidy reading. Put the parity at the ends, close the gap, and the table looks professional. What you have actually done is invent a layout, because the source you are copying from did not know either. If a frame later fails to decode, you will not suspect the seven bits, because nothing in your tool says they were guessed.

Leaving them visible — "eleven site, sixteen card, seven unaccounted" — means a user whose frames do not decode has somewhere to look. That is the difference between a tool that is sometimes wrong and a tool that tells you when it does not know.

Even the good references have typos

While checking our own table against a widely used public format reference, we found an entry labelled HID 34-bit (N1002) with eight bits of site code and sixteen bits of card number. Twenty-four data bits. A 34-bit frame carries thirty-two.

The arithmetic settles it without needing another source: a layout that adds up to twenty-six bits cannot be a thirty-four-bit format. Three other references — including the Honeywell format specification that gives a per-bit map — put N10002 at sixteen plus sixteen. The entry is a typo in an otherwise excellent table.

The lesson is not that the table is bad. It is that a field layout has to be checked by arithmetic before it is trusted. Sum the fields, add the parity bits, compare to the length. A table with four columns of plausible numbers will not be caught by reading it.

What to do with a frame in hand

The practical rule: never let a bit count choose a layout. Two questions settle almost every case.

First, what is the facility code? An eight-bit site field tops out at 255. A facility code of 12,000 cannot have come from an eight-bit field, which rules out AWID RS2 and points at H10306. This one check resolves most mislabelled frames.

Second, how many fields does the credential actually have? If the card is enrolled with a site, an issue level and a card number, Cardkey Smartpass is in play and the issue level must be preserved through every conversion.

Past that, the honest answer is that a 34-bit frame carries no self-describing marker of its layout. The format number is printed on the credential or stored in the panel. Anything else is inference.

Which is why a decoder that makes you pick the layout, instead of picking for you, is not being pedantic. Ours asks before it answers, and refuses the widths where the answer would be a guess — see the frame decoder.

Why this keeps happening

Parity protects bits, not meaning. A decoder that checks parity confirms the frame arrived intact; it says nothing about whether the field boundaries are right. Add that a wrong split still produces numbers inside the valid ranges of the fields it thinks it is reading, and you have a failure mode with no alarm attached.

The 37-bit length has the same problem, worse: H10302 carries no facility code at all, and H10304 carries sixteen bits of one. Same vendor, same length, incompatible. Thirty-six bits has at least four layouts. Thirty-two has five, two of which have no parity bits, so a corrupted frame cannot even be detected.

The pattern is consistent enough to state plainly: in this protocol, the length is the least informative part of the frame.

Checking our own work

We keep the layouts we could source with a per-bit reference in one table, with a confidence level on every row and an explicit count of bits that are not assigned to any field. Where sources disagree — the 37-bit parity boundary is the clearest case — the row says so rather than picking a winner.

The table is at /wiegand-bit-formats/, and the dataset behind it is published separately so it can be corrected rather than merely read. If a row is wrong for the systems you work with, the fix is worth more to us than the traffic.

Related reading

Try the Base64 to Image converter →