<!--
{
  "availability" : [
    "iOS: 10.0.0 - 27.0.0",
    "iPadOS: 10.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.12.0 - 27.0.0",
    "tvOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 3.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSLocale/countryCode",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLocale(py)countryCode"
  },
  "title" : "countryCode"
}
-->

# countryCode

The country or region code for the locale.

```
var countryCode: String? { get }
```

## Discussion

Examples of country or region codes include `"GB"`, `"FR"`, and `"HK"`.

Use [`localizedString(forCountryCode:)`](/documentation/Foundation/NSLocale/localizedString(forCountryCode:)) to obtain a version of the value suitable for display to the user.

This property contains the same value returned by the [`object(forKey:)`](/documentation/Foundation/NSLocale/object(forKey:)) method when passing the [`countryCode`](/documentation/Foundation/NSLocale/Key/countryCode) key.

## See Also

[`isoCountryCodes`](/documentation/Foundation/NSLocale/isoCountryCodes)

The list of known country or region codes.



---

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)