---
title: CodingKey
framework: swift
role: symbol
role_heading: Protocol
path: swift/codingkey
---

# CodingKey

A type that can be used as a key for encoding and decoding.

## Declaration

```swift
protocol CodingKey : CustomDebugStringConvertible, CustomStringConvertible, Sendable
```

## Topics

### Initializers

- [init(intValue:)](swift/codingkey/init(intvalue:).md)
- [init(stringValue:)](swift/codingkey/init(stringvalue:).md)

### Instance Properties

- [intValue](swift/codingkey/intvalue.md)
- [stringValue](swift/codingkey/stringvalue.md)

## Relationships

### Inherits From

- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Custom Encoding and Decoding

- [Encoding and Decoding Custom Types](foundation/encoding-and-decoding-custom-types.md)
- [Codable](swift/codable.md)
- [Encodable](swift/encodable.md)
- [Decodable](swift/decodable.md)
- [CodingKeyRepresentable](swift/codingkeyrepresentable.md)
- [CodingUserInfoKey](swift/codinguserinfokey.md)
