<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/ByteCountFormatStyle/Units",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation20ByteCountFormatStyleV5UnitsV"
  },
  "title" : "ByteCountFormatStyle.Units"
}
-->

# ByteCountFormatStyle.Units

The units to use when formatting a byte count, such as kilobytes or gigabytes.

```
struct Units
```

## Topics

### Units

[`static var `default`: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/default)

A value that indicates a format style should use the most appropriate units to express a byte count.

[`static var all: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/all)

A value that allows the use of all byte-count units.

[`static var bytes: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/bytes)

A value that indicates a format style should express byte counts in individual bytes.

[`static var kb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/kb)

The kilobytes unit.

[`static var mb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/mb)

The megabytes unit.

[`static var gb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/gb)

The gigabytes unit.

[`static var tb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/tb)

The terabytes unit.

[`static var pb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/pb)

The petabytes unit.

[`static var eb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/eb)

The exabytes unit.

[`static var zb: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/zb)

The zettabytes unit.

[`static var ybOrHigher: ByteCountFormatStyle.Units`](/documentation/Foundation/ByteCountFormatStyle/Units/ybOrHigher)

A value that indicates a format style should express byte counts as yottabytes or higher.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

[`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)