---
title: Codable
framework: swift
role: symbol
role_heading: Type Alias
path: swift/codable
---

# Codable

A type that can convert itself into and out of an external representation.

## Declaration

```swift
typealias Codable = Decodable & Encodable
```

## Discussion

Discussion Codable is a type alias for the Encodable and Decodable protocols. When you use Codable as a type or a generic constraint, it matches any type that conforms to both protocols.

## See Also

### Custom Encoding and Decoding

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