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

# capacity

The total number of key-value pairs that the dictionary can contain without allocating new storage.

## Declaration

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

## See Also

### Inspecting a Dictionary

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