---
title: leadingZeroBitCount
framework: swift
role: symbol
role_heading: Instance Property
path: swift/int/leadingzerobitcount
---

# leadingZeroBitCount

The number of leading zeros in this value’s binary representation.

## Declaration

```swift
var leadingZeroBitCount: Int { get }
```

## Discussion

Discussion For example, in a fixed-width integer type with a bitWidth value of 8, the number 31 has three leading zeros. let x: Int8 = 0b0001_1111 // x == 31 // x.leadingZeroBitCount == 3 If the value is zero, then leadingZeroBitCount is equal to bitWidth.

## See Also

### Working with Binary Representation

- [bitWidth](swift/int/bitwidth.md)
- [bitWidth](swift/int/bitwidth-swift.property.md)
- [nonzeroBitCount](swift/int/nonzerobitcount.md)
- [trailingZeroBitCount](swift/int/trailingzerobitcount.md)
- [words](swift/int/words-swift.property.md)
- [Int.Words](swift/int/words-swift.struct.md)
