---
title: count
framework: swift
role: symbol
role_heading: Instance Property
path: swift/dictionary/count
---

# count

The number of key-value pairs in the dictionary.

## Declaration

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

## Discussion

Discussion note: O(1).

## See Also

### Inspecting a Dictionary

- [isEmpty](swift/dictionary/isempty.md)
- [capacity](swift/dictionary/capacity.md)
