<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/ByteCountFormatter/Units",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSByteCountFormatterUnits"
  },
  "title" : "ByteCountFormatter.Units"
}
-->

# ByteCountFormatter.Units

Specifies the units appropriate for the formatter to display. Specifying any units explicitly causes just those units to be used in showing the number.

```
struct Units
```

## Topics

### Constants

[`NSByteCountFormatterUseBytes`](/documentation/Foundation/ByteCountFormatter/Units/useBytes)

Displays bytes in the formatter content.

[`NSByteCountFormatterUseKB`](/documentation/Foundation/ByteCountFormatter/Units/useKB)

Displays kilobytes in the formatter content.

[`NSByteCountFormatterUseMB`](/documentation/Foundation/ByteCountFormatter/Units/useMB)

Displays megabytes in the formatter content.

[`NSByteCountFormatterUseGB`](/documentation/Foundation/ByteCountFormatter/Units/useGB)

Displays gigabytes in the formatter content.

[`NSByteCountFormatterUseTB`](/documentation/Foundation/ByteCountFormatter/Units/useTB)

Displays terabytes in the formatter content.

[`NSByteCountFormatterUsePB`](/documentation/Foundation/ByteCountFormatter/Units/usePB)

Displays petabyte in the formatter content.

[`NSByteCountFormatterUseEB`](/documentation/Foundation/ByteCountFormatter/Units/useEB)

Displays exabytes in the formatter content.

[`NSByteCountFormatterUseZB`](/documentation/Foundation/ByteCountFormatter/Units/useZB)

Displays zettabytes in the formatter content.

[`NSByteCountFormatterUseYBOrHigher`](/documentation/Foundation/ByteCountFormatter/Units/useYBOrHigher)

Displays yottabytes in the formatter content.

[`NSByteCountFormatterUseAll`](/documentation/Foundation/ByteCountFormatter/Units/useAll)

Can use any unit in the formatter content.

[`NSByteCountFormatterUseDefault`](/documentation/Foundation/NSByteCountFormatterUnits/NSByteCountFormatterUseDefault)

This causes default units appropriate for the platform to be used. This is the default.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)