Open navigation menu
Back to All Calculators
5G NR

5G NR Cell Identity (NCI) Calculator

Calculate and validate 36-bit 5G NR Cell Identity (NCI) in Decimal, Hexadecimal, and Binary formats from gNB ID and Cell ID.

3

Inputs

Live

Math

3

Related

Calculator

Input Parameters

Enter parameters and click Calculate to view results

Formula & Theory

NCI = (gNB ID × 2^(36 - gNB_Bits)) + Cell ID [Total NCI Length = 36 bits]

This formula is used to calculate antenna parameters for 5g nr cell identity (nci) calculator.

The 5G NR Cell Identity (NCI) Calculator helps network engineers, RAN planners, telecom developers, and students calculate and validate a 36-bit 5G NR Cell Identity from a gNB ID, gNB ID bit length, and Local Cell ID. It provides the resulting NCI in decimal, hexadecimal, and 36-bit binary formats, while also checking whether the supplied identifiers fit within their allocated bit ranges.

NCI is an important part of 5G NR cell identification. However, it should not be confused with identifiers such as the Physical Cell Identity (PCI), gNB ID, or NR Cell Global Identity (NCGI).

This calculator makes the underlying bit allocation and calculation straightforward, especially when you need to verify identifiers during network planning, configuration, troubleshooting, software development, or telecom education.

What Is 5G NR Cell Identity (NCI)?

NR Cell Identity (NCI) is the 36-bit identity used for identifying an NR cell within the 5G system's cell identity structure.

The NCI is constructed by combining two logical components:

  • gNB ID — identifies the gNB portion of the identity.
  • Local Cell ID — identifies the individual cell within the gNB.

The 36 available bits are divided between these two components. The number of bits allocated to the gNB ID determines how many bits remain for the Local Cell ID.

For example, if the gNB ID uses 28 bits:


Total NCI bits = 36 gNB ID bits = 28 Local Cell ID bits = 36 − 28 = 8

The resulting structure can be visualized as:

[ 28-bit gNB ID ][8-bit Local Cell ID]

This bit-level structure is why the gNB ID bit length is an essential input when calculating an NCI.

NCI vs Other 5G Identifiers

Several identifiers appear together when working with 5G networks, but they serve different purposes.

IdentifierPurpose
NCI36-bit NR cell identity
gNB IDIdentifies the gNB portion of the NCI
Local Cell IDIdentifies a cell within the gNB
PCIPhysical radio-layer cell identity
NCGIGlobal NR Cell Identity incorporating PLMN identity and NCI

The NCI calculator focuses specifically on constructing the 36-bit NCI from the gNB ID and Local Cell ID.

5G NCI Structure: 36 Bits Explained

The calculator uses a total NCI length of 36 bits.

The available bits are divided between the gNB ID and Local Cell ID.

The relationship is:


Cell ID Bits = 36 − gNB ID Bits

The calculator accepts a gNB ID bit length from 22 through 32 bits.

This produces the following possible allocation:

gNB ID BitsLocal Cell ID Bits
2214
2313
2412
2511
2610
279
288
297
306
315
324

For example, with a 28-bit gNB ID, there are 8 bits remaining for the Local Cell ID.


36 − 28 = 8 bits

An 8-bit Local Cell ID can represent values from:

0 to 255

If the gNB ID uses 32 bits instead, only four bits remain for the Local Cell ID:

36 − 32 = 4 bits

In that case, the Local Cell ID range is:

0 to 15

This demonstrates an important concept: the maximum Local Cell ID depends on the selected gNB ID bit length.

5G NCI Calculation Formula

The calculator uses the following formula:

NCI = (gNB ID × 2^(36 − gNB ID Bits)) + Cell ID

Because:

Cell ID Bits = 36 − gNB ID Bits

the formula can also be written as:

NCI = (gNB ID × 2^Cell ID Bits) + Cell ID

At the bit level, the same operation can be represented as:

NCI = (gNB ID << Cell ID Bits) | Cell ID

Here, << represents a left bit shift and | represents a bitwise OR.

What Each Variable Means

VariableMeaning
NCIFinal 36-bit NR Cell Identity
gNB IDNumeric gNB identifier
gNB ID BitsNumber of bits allocated to the gNB ID
Cell IDLocal Cell ID
Cell ID BitsRemaining bits available for the Local Cell ID

The calculation essentially shifts the gNB ID to the left by the number of bits allocated to the Local Cell ID and then places the Local Cell ID into those lower-order bits.

For example:


gNB ID = 5000 gNB ID Bits = 28 Local Cell ID = 3

First:

Cell ID Bits = 36 − 28 = 8
Then:
NCI = (5000 × 2^8) + 3

or:

NCI = (5000 × 256) + 3

Therefore:

NCI = 1,280,003

How the 5G NR NCI Calculator Works

The calculator follows a straightforward validation and calculation process.

Step 1: Enter the gNB ID

Enter the numeric gNB ID.

For example:

5000

The calculator supports integer gNB IDs and verifies that the value can be represented using the selected number of bits.

Step 2: Enter the gNB ID Bit Length

Enter the number of bits allocated to the gNB ID.

The calculator accepts:

22–32 bits

The default configuration is:

28 bits

Step 3: Enter the Local Cell ID

Enter the Local Cell ID associated with the cell.

For example:

3

The calculator automatically determines how many bits are available for this value.

Step 4: Calculate the Cell ID Bit Length

The calculator calculates:

Cell ID Bits = 36 − gNB ID Bits

With 28 gNB ID bits:

Cell ID Bits = 8

Step 5: Validate the Inputs

The calculator checks whether:

  • The gNB ID is an integer.
  • The gNB ID bit length is an integer.
  • The gNB ID bit length is between 22 and 32.
  • The gNB ID fits within the selected bit length.
  • The Local Cell ID fits within the available Cell ID bits.
  • The calculated NCI remains within the 36-bit range.

Step 6: Generate Multiple Formats

The final NCI is displayed as:

  • Decimal
  • Hexadecimal
  • 36-bit binary

This makes the result useful for both general calculations and technical debugging.

Real-Life Example: Calculate an NCI for a 5G Cell

Consider a 5G RAN engineer configuring a cell associated with the following identifiers:


gNB ID = 5000 gNB ID Bit Length = 28 bits Local Cell ID = 3


The first step is determining how many bits remain for the Local Cell ID.

Step 1: Calculate Local Cell ID Bits


Cell ID Bits = 36 − 28 = 8 bits


Therefore, the identity structure is:


[ 28-bit gNB ID ][8-bit Cell ID]


Step 2: Calculate the NCI

Using the formula:


NCI = (gNB ID × 2^Cell ID Bits) + Cell ID


Substitute the values:


NCI = (5000 × 2^8) + 3


Since:


2^8 = 256


we get:


NCI = (5000 × 256) + 3


Therefore:


NCI = 1,280,003


Step 3: Decimal Representation

The decimal NCI is:


1,280,003


Step 4: Hexadecimal Representation

The same value in hexadecimal is:


0x138803


Step 5: Binary Representation

The calculator represents the value as a 36-bit binary number, padding the result with leading zeros when necessary.

This is useful when you want to visually inspect the relationship between the gNB ID portion and the Local Cell ID portion.

Example Result

ParameterResult
gNB ID5000
gNB ID Bit Length28 bits
Local Cell ID3
Local Cell ID Bit Length8 bits
NCI Decimal1,280,003
NCI Hexadecimal0x138803
NCI Binary36-bit representation

This example illustrates exactly how the calculator converts a practical gNB/cell configuration into a 36-bit NCI.

Understanding Maximum gNB ID and Cell ID Values

Every bit allocation has a maximum representable value.

For a field containing n bits:


Maximum Value = 2^n − 1


Therefore, the maximum gNB ID depends on the selected gNB ID bit length.

Maximum gNB ID Examples

gNB ID BitsMaximum gNB ID
224,194,303
2416,777,215
28268,435,455
301,073,741,823
324,294,967,295

The calculator dynamically calculates the appropriate maximum based on the selected bit length.

The same principle applies to the Local Cell ID.

For example, with an 8-bit Local Cell ID:


Maximum Cell ID = 2^8 − 1 = 255


With a 4-bit Local Cell ID:


Maximum Cell ID = 2^4 − 1 = 15


The maximum possible 36-bit NCI is:


2^36 − 1


which equals:


68,719,476,735


This represents the upper numerical limit of a 36-bit unsigned value.

Why gNB ID Bit Length Matters

The gNB ID bit length controls the division of the 36-bit NCI between the gNB ID and Local Cell ID.

This is important because changing the bit allocation changes the encoding of the NCI.

Suppose:


gNB ID = 5000 Local Cell ID = 3


With a 28-bit gNB ID:


Cell ID Bits = 8


The gNB ID is effectively shifted by eight bits.

If you instead select a 30-bit gNB ID:


Cell ID Bits = 36 − 30 = 6


The gNB ID is now shifted by only six bits.

Consequently, the resulting NCI is different even though the numeric gNB ID and Local Cell ID have not changed.

This is why an NCI calculation cannot simply use:


gNB ID + Cell ID


The bit allocation must be taken into account.

5G NCI Decimal, Hexadecimal, and Binary Formats

The calculator provides three representations of the NCI because different engineering and software workflows may use different formats.

Decimal NCI

Decimal is the easiest format for general-purpose use.

For example:


1280003


This format can be convenient for:

  • Network databases
  • Inventory systems
  • Spreadsheets
  • Application interfaces
  • General documentation

Hexadecimal NCI

Hexadecimal provides a more compact representation:


0x138803


Hexadecimal is particularly convenient when inspecting identifiers in technical logs, debugging output, and software tools.

Binary NCI

Binary makes the underlying bit structure visible.

The calculator pads the binary representation to 36 bits and groups the digits into four-bit sections.

This makes it easier to reason about:


[gNB ID portion][Cell ID portion]


Binary is especially useful for students and engineers who need to verify the bit-level construction of an NCI.

NCI vs NCGI: What's the Difference?

NCI and NCGI are closely related but are not the same thing.

NCI means NR Cell Identity. It represents the 36-bit cell identity.

NCGI means NR Cell Global Identity. It incorporates the PLMN identity together with the NCI.

Conceptually:


NCGI = PLMN Identity + NCI


The important distinction is that NCI is the cell identity component, while NCGI provides the broader global identification structure by associating the NCI with a PLMN.

Therefore, if you need to calculate only the 36-bit NCI from a gNB ID and Local Cell ID, the NCI calculator is the appropriate tool. It does not calculate the complete NCGI because PLMN information is outside the calculator's input model.

NCI vs PCI: Don't Mix Them Up

NCI and PCI are two completely different concepts.

NCI is the NR Cell Identity and is constructed using the gNB ID and Local Cell ID within the 36-bit identity structure.

PCI, or Physical Cell Identity, is associated with the radio layer and is used in physical cell synchronization and identification.

The NCI calculator should therefore not be used as a PCI calculator.

For example, if a network engineer has:


gNB ID = 5000 Local Cell ID = 3


the calculator can determine the corresponding NCI.

It does not mean that the resulting NCI is the cell's PCI.

A simple way to remember the distinction is:


NCI → logical/cell identity PCI → physical radio identity


They solve different problems in a 5G NR network.

Real-World Use Cases for a 5G NCI Calculator

A 5G NCI calculator can be useful in several telecom engineering and software workflows.

1. 5G RAN Planning

During radio access network planning, engineers need to work with identifiers representing gNBs and individual cells.

The calculator can help validate how different gNB ID bit allocations affect the available Local Cell ID range.

For example:


28-bit gNB ID → 8-bit Local Cell ID → values 0–255


This provides a quick way to assess whether a proposed identity configuration can accommodate the required local cell identifiers.

2. Network Configuration

When configuring NR cells, engineers can use the calculator to verify that a Local Cell ID fits within the available number of bits.

If a configuration uses 32 gNB ID bits, only four bits remain for the Local Cell ID.

Therefore:


Maximum Local Cell ID = 15


A Local Cell ID above this value would fail validation.

3. OSS/BSS and Network Inventory Systems

Telecom software platforms may store identifiers in different representations.

An engineering team might need the same NCI as:


Decimal Hexadecimal Binary


The calculator provides all three representations from a single input configuration.

4. Network Troubleshooting

During troubleshooting, engineers may encounter NCI values in logs or network-management systems.

Calculating an expected NCI from the known gNB ID, bit allocation, and Local Cell ID provides a straightforward way to verify whether the identifier is consistent with the intended configuration.

5. Telecom Software Development

Developers building:

  • RAN management platforms
  • Network inventory applications
  • Telecom dashboards
  • Configuration systems
  • Network automation tools

may need to understand the exact relationship between gNB ID, Cell ID, and NCI.

The formula provides a deterministic way to reproduce the identity calculation in software.

6. 5G Training and Education

The calculator is also useful for learning.

Instead of treating NCI as an opaque number, students can experiment with different bit lengths and observe how the NCI changes.

This makes the relationship between bit allocation and numerical identity much easier to understand.

7. Identifier Validation

The calculator can catch invalid configurations before they are used elsewhere.

For example, if a 28-bit gNB ID configuration is selected, the Local Cell ID must fit into eight bits.

An invalid value can therefore be detected immediately instead of producing an incorrect identity.

Common 5G NCI Calculation Mistakes

Mistake 1: Treating NCI as the gNB ID

NCI is not simply the gNB ID.

The Local Cell ID is incorporated into the 36-bit identity.

Mistake 2: Ignoring the gNB ID Bit Length

The gNB ID bit length determines how many bits remain for the Local Cell ID.

Ignoring this parameter can produce an incorrect NCI.

Mistake 3: Using One Fixed Maximum for Local Cell ID

There is no single Local Cell ID maximum that applies to every bit allocation.

The maximum is:


2^(36 − gNB ID Bits) − 1


Mistake 4: Treating NCI and PCI as the Same Identifier

NCI and PCI have different roles. A calculated NCI cannot simply be interpreted as a PCI.

Mistake 5: Dropping Leading Binary Zeros

A shorter binary string may represent the same numerical value, but it does not visually represent the complete 36-bit structure.

The calculator therefore pads the binary output to 36 bits.

Mistake 6: Using Inadequate Integer Handling

The provided calculator implementation uses JavaScript BigInt for the NCI calculation.

This is important because ordinary JavaScript bitwise operations are based on 32-bit integer operations, while the NCI has a 36-bit width.

Using BigInt allows the calculator to perform the shift and bitwise operations without the limitations associated with JavaScript's standard 32-bit bitwise operators.

Input Validation in the Calculator

Input validation is a core part of the calculator.

The gNB ID bit length must be an integer between:


22 and 32 bits


The calculator then determines the Local Cell ID bit length:


Cell ID Bits = 36 − gNB ID Bits


For the gNB ID, the permitted range is determined dynamically:


0 ≤ gNB ID ≤ 2^gNB Bits − 1


For the Local Cell ID:


0 ≤ Cell ID ≤ 2^Cell ID Bits − 1


Finally, the calculator checks that the calculated NCI does not exceed the maximum 36-bit value:


NCI ≤ 2^36 − 1


If an input violates these constraints, the calculator returns an error instead of producing a potentially misleading result.

This validation makes the tool more useful for configuration verification and engineering workflows.

How to Use the 5G NR Cell Identity Calculator

Using the calculator requires only three primary inputs.

1. Enter the gNB ID

Example:


5000


2. Enter the gNB ID Bit Length

Example:


28 bits


3. Enter the Local Cell ID

Example:


3


The calculator automatically determines the remaining Cell ID bits:


36 − 28 = 8 bits


It then calculates and displays:

  • gNB ID
  • gNB ID bit length
  • Local Cell ID
  • Local Cell ID bit length
  • NCI in decimal
  • NCI in hexadecimal
  • NCI in 36-bit binary
  • Validation status

For the example:


gNB ID = 5000 gNB ID Bits = 28 Local Cell ID = 3


the resulting NCI is:


1,280,003


and its hexadecimal representation is:


0x138803


Frequently Asked Questions About 5G NCI

What is NCI in 5G NR?

NCI stands for NR Cell Identity. It is a 36-bit identifier used to identify an NR cell. The NCI is constructed from a gNB ID and Local Cell ID according to the configured allocation of bits between those two components.

How many bits is a 5G NR Cell Identity?

The NCI used by this calculator has a total length of 36 bits.

The 36 bits are divided between the gNB ID and Local Cell ID.

How is 5G NCI calculated?

The calculator uses:


NCI = (gNB ID × 2^(36 − gNB ID Bits)) + Cell ID


The equivalent bit-shift representation is:


NCI = (gNB ID << Cell ID Bits) | Cell ID


where:


Cell ID Bits = 36 − gNB ID Bits


What gNB ID bit lengths does the calculator support?

The calculator accepts integer gNB ID bit lengths from 22 through 32 bits.

How many bits are available for the Local Cell ID?

The number of Local Cell ID bits is calculated by subtracting the gNB ID bit length from 36:


Local Cell ID Bits = 36 − gNB ID Bits


For example, a 28-bit gNB ID leaves eight bits for the Local Cell ID.

What is the maximum Local Cell ID with a 28-bit gNB ID?

A 28-bit gNB ID leaves:


36 − 28 = 8 bits


for the Local Cell ID.

Therefore:


Maximum Local Cell ID = 2^8 − 1 = 255


What is the maximum 36-bit NCI value?

The maximum unsigned 36-bit value is:


2^36 − 1 = 68,719,476,735


Can NCI be represented in hexadecimal?

Yes. The calculator converts the calculated NCI into hexadecimal and prefixes the result with 0x.

For example:


Decimal: 1280003 Hex: 0x138803


Why does the calculator show 36-bit binary?

The 36-bit binary representation makes the fixed NCI width visible and helps engineers understand how the gNB ID and Local Cell ID occupy the available bits.

Is NCI the same as PCI?

No. NCI and PCI serve different purposes. NCI is the 36-bit NR Cell Identity, while PCI is associated with physical radio-layer cell identification and synchronization.

Is NCI the same as NCGI?

No. NCI is the 36-bit NR Cell Identity component. NCGI is the broader global cell identity that incorporates PLMN identity with NCI.

Why does changing the gNB ID bit length change the NCI?

Changing the gNB ID bit length changes the number of bits allocated to the Local Cell ID. Consequently, the gNB ID is shifted by a different number of positions, producing a different NCI encoding.

Why does the calculator use BigInt?

The calculator uses JavaScript BigInt to perform exact integer and bit-shift operations for the 36-bit NCI. This avoids relying on JavaScript's ordinary 32-bit bitwise integer behavior.

Technical Reference: 5G NCI Formula Summary

For quick reference, the calculator uses these relationships:

Total NCI length


Total NCI Bits = 36


Local Cell ID bit length


Cell ID Bits = 36 − gNB ID Bits


Maximum gNB ID

Maximum gNB ID = 2^(gNB ID Bits) − 1

Maximum Local Cell ID

Maximum Cell ID = 2^(Cell ID Bits) − 1

NCI calculation

NCI = (gNB ID × 2^(Cell ID Bits)) + Cell ID

Equivalent bitwise calculation

NCI = (gNB ID << Cell ID Bits) | Cell ID

Maximum 36-bit NCI

Maximum NCI = 2^36 − 1 = 68,719,476,735

These formulas provide a compact reference for developers and telecom engineers implementing or validating NCI calculations.

5G NCI Calculator Best Practices

For reliable NCI calculations, always verify the bit allocation before calculating the identity.

Use the following practices:

  • Confirm the correct gNB ID.
  • Confirm the intended gNB ID bit length.
  • Check that the Local Cell ID fits within the remaining bits.
  • Use the calculated Cell ID bit length rather than assuming a fixed value.
  • Use decimal when working with general numerical data.
  • Use hexadecimal when compact technical representation is useful.
  • Use binary when inspecting the bit-level structure.
  • Do not confuse NCI with PCI.
  • Do not assume that changing the gNB ID bit length leaves the NCI unchanged.
  • Validate the calculated identity before using it in network configuration or software systems.
  • When implementing the calculation in JavaScript, use an integer representation appropriate for values and bit operations beyond the ordinary 32-bit bitwise range.

Key Takeaways

The 5G NR Cell Identity (NCI) Calculator provides a practical way to calculate and validate a 36-bit NCI from a gNB ID, gNB ID bit length, and Local Cell ID.

The most important points are:

  • NCI is a 36-bit NR cell identity.
  • The calculator supports gNB ID bit lengths from 22 to 32 bits.
  • Local Cell ID bits are calculated as 36 − gNB ID Bits.
  • The NCI is calculated by shifting the gNB ID and incorporating the Local Cell ID.
  • The calculator provides NCI in decimal, hexadecimal, and 36-bit binary formats.
  • Maximum gNB ID and Local Cell ID values depend on their allocated bit lengths.
  • The maximum 36-bit NCI is 68,719,476,735.
  • NCI should not be confused with PCI or NCGI.
  • Input validation helps prevent invalid bit allocations and out-of-range identifiers.
  • BigInt-based calculations provide appropriate integer handling for the 36-bit NCI implementation.

If you need to verify a 5G NR cell identity, enter the gNB ID, gNB ID bit length, and Local Cell ID into the calculator to quickly generate the corresponding NCI in multiple formats.

Inputs used by this calculator

  • gNB ID.
  • gNB ID Bit Length (3GPP: 22–32 bits) — use bits.
  • Local Cell ID.
AW
RF Engineering ExpertCalculator content reviewer

Alex Warren

B.Sc. in Electrical & Electronic Engineering (EEE)

Alex specialises in antenna design and wave propagation. His expertise helps ensure these calculators present practical RF concepts, useful design estimates, and clear engineering guidance for students, HAM operators, and wireless professionals.

Electrical & Electronic EngineeringAntenna & Wave Propagation
Connect: