<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/JSONDecoder/KeyDecodingStrategy-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11JSONDecoderC19KeyDecodingStrategyO"
  },
  "title" : "JSONDecoder.KeyDecodingStrategy"
}
-->

# JSONDecoder.KeyDecodingStrategy

The values that determine how to decode a type’s coding keys from JSON keys.

```
enum KeyDecodingStrategy
```

## Overview> Note:
> Key decoding strategies other than ``doc://com.apple.foundation/documentation/Foundation/JSONDecoder/KeyDecodingStrategy-swift.enum/useDefaultKeys`` may have a noticeable performance cost because those strategies may inspect and transform each key.

## Topics

### Built-in Decoding

[`JSONDecoder.KeyDecodingStrategy.convertFromSnakeCase`](/documentation/Foundation/JSONDecoder/KeyDecodingStrategy-swift.enum/convertFromSnakeCase)

A key decoding strategy that converts snake-case keys to camel-case keys.

[`JSONDecoder.KeyDecodingStrategy.useDefaultKeys`](/documentation/Foundation/JSONDecoder/KeyDecodingStrategy-swift.enum/useDefaultKeys)

A key decoding strategy that doesn’t change key names during decoding.

### Custom Decoding

[`JSONDecoder.KeyDecodingStrategy.custom(_:)`](/documentation/Foundation/JSONDecoder/KeyDecodingStrategy-swift.enum/custom(_:))

A key decoding strategy defined by the closure you supply.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)