> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/products/cc-hardware/credentials/credential-information/credentials-universal-card-formats-ucf.md).

# Configure a Universal Card Format

Configure a Universal Card Format to interpret third-party 125 kHz card data.

A Universal Card Format changes the way a Gallagher controller interprets card data it receives from a reader. When a controller gets a data stream it cannot interpret, you generally see the alarm "Unrecognised card format read at Door xxx".

> **Important.** UCFs work for **125 kHz cards only**. MIFARE card technologies are encrypted with keys that are not compatible with this process.

### Collect the data

The alarm message in Command Centre contains most of what you need to create the UCF. Go to the **Details** tab of the alarm. Copy and paste the raw data rather than taking a screenshot, because the text itself is needed.

```
Card Format: Third Party (0xFD)
Number of Bits: 26
Raw Card Data (Hexadecimal): D4 95 12 40
Raw Card Data (Binary): 11010100 10010101 00010010 01
```

![UCF creation step 4](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-30ad92cc9473ca95a71827cbcf69c1cc8735e73d%2FSECHUB-CREDENTIALS-UCF-01-ucf-creation-step-04.png?alt=media)

Collect data from at least 3 cards that are close together in card number sequence. If card numbers are printed on the cards, record those alongside the bitstream data. If the cards work on another system, get the card numbers and the facility code from that system.

### Identify the facility code and card number

The bitstream is typically a parity bit, then the facility code, then the card number, then a parity bit. This varies by manufacturer.

Worked example, where both values are known:

| Field         | Decimal | Binary         |
| ------------- | ------- | -------------- |
| Card Number   | 10788   | 10101000100100 |
| Facility Code | 169     | 10101001       |

![UCF creation step 5](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-c05759e57cdd16a6996ae62aa77ce21f1c0d5b60%2FSECHUB-CREDENTIALS-UCF-02-ucf-creation-step-05.png?alt=media)

Locate both values in the raw bitstream and note the start bit and bit length of each. When you size the card number field, start a few bits earlier and make the field longer, so it can accommodate larger card numbers in future.

### Create the UCF

1. Identify the facility code start bit and length from the bitstream.
2. In Configuration Client, go to **Configure > Universal Card Format**.
3. Create a new UCF and configure the Format tab. Select the **Wiegand** radio button.
4. Enter the facility code start bit and bit count.
5. Enter the card number start bit and bit count.
6. Create a corresponding facility code entry in Command Centre.
7. Assign the UCF to the relevant controller's **Card Formats** property page.
8. Test by presenting the card to a reader.

Screenshots from the UCF creation walkthrough:

![UCF creation step 6](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-e9733f5270b5feda769059cbaafa9db6f38ad67f%2FSECHUB-CREDENTIALS-UCF-03-ucf-creation-step-06.png?alt=media)

![UCF creation step 7](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-9ca2398a3fc269af425df60d9238e298de9c6d28%2FSECHUB-CREDENTIALS-UCF-04-ucf-creation-step-07.png?alt=media)

![UCF creation step 8](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-33e86d7bda63bc3b38f21b80a2c16e3c9bf6a321%2FSECHUB-CREDENTIALS-UCF-05-ucf-creation-step-08.png?alt=media)

![UCF creation step 9](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-fedbe6f0eb1369afa63213b3d282ebdeee8660fe%2FSECHUB-CREDENTIALS-UCF-06-ucf-creation-step-09.png?alt=media)

![UCF creation step 10](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-a8dc679a29ab7b590be904b3f8e1efd69aa4bffe%2FSECHUB-CREDENTIALS-UCF-07-ucf-creation-step-10.png?alt=media)

### Multiple UCFs on the same system

If several UCFs share the same bit length but have different facility codes, cards can be identified incorrectly. Always define the facility code field to cover the largest feasible portion of the facility code binary in the bitstream, so the formats cannot be confused.

Example of the ambiguity:

| FC    | Binary           |
| ----- | ---------------- |
| 975   | `00001111001111` |
| 16335 | `11111111001111` |

The binary of 975 looks exactly like the binary of 16335 if you are only looking at the **last 10 binary bits** of the facility code. Always make the UCF select the largest section of the facility code of the Wiegand string as possible, within reason.

### Unknown facility code example

When the facility code is not known, you ideally need **3 or more of the same card, preferably in sequence**. Present the three cards to the reader and collect the bitstreams.

| Card    | Bitstream                                      |
| ------- | ---------------------------------------------- |
| 5431608 | `00000001 10000000 10100101 11000010 01110000` |
| 5439800 | `00000001 10000000 10100110 00000010 01110000` |
| 8298808 | `00000001 10000000 11111101 01000010 01110000` |

Looking at the bitstreams, the facility code at the start appears the same on all three cards, so you can assume they share the same facility code, which reads as **3**. The facility code component for the UCF is therefore **Start Bit 2, Bits in FC 8**.

Take the first card number 5431608, convert it to binary, `10100101110000100111000`, and compare it with the bitstream in Notepad.

![UCF creation step 11](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-4894fe5b5507126c7fb536fb8827684f0963a0db%2FSECHUB-CREDENTIALS-UCF-08-ucf-creation-step-11.png?alt=media)

The actual card number starts at **bit 17**, but start earlier in case card numbers grow. **Bit 14** is good enough, which makes the card number **26 bits** in length.

Make a card type with **A00003** and a UCF using this data.

![UCF creation step 12](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-58cee8b04907438d309458d8f366bce40dafef58%2FSECHUB-CREDENTIALS-UCF-09-ucf-creation-step-12.png?alt=media)

Add it to the controller and present the card to the reader. Access is granted.

![UCF creation step 13](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-da4e51f28148e49f773ef40822158bfb571e7421%2FSECHUB-CREDENTIALS-UCF-10-ucf-creation-step-13.png?alt=media)

### Cards with an obfuscated bitstream

Some 125 kHz card manufacturers obscured card data by shuffling the bits, so the card could only be read by systems that knew how to reorder them. Motorola and Indala are two manufacturers that did this. A standard UCF is not enough for these cards.

Gallagher provides custom DLL files, known as cust cards, that reside on the controller and reorder the bits. Identify these cards by the card format field in the alarm:

```
Card Format: Motorola (0x03)
Number of Bits: 64
```

If none of the existing cust card DLLs work, Gallagher can develop a custom DLL from sample cards. Contact Gallagher Technical Support.

***

🔗 **Related**

* [Credentials - Using Card CSN as the Card Number](/knowledge-hub/products/cc-hardware/credentials/credential-information/credentials-using-card-csn-as-the-card.md). The UCF parameters for reading a MIFARE card serial number as the card number.
* [Credential Information](/knowledge-hub/products/cc-hardware/credentials/credential-information.md). Which credential technologies Command Centre supports.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/products/cc-hardware/credentials/credential-information/credentials-universal-card-formats-ucf.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
