<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/numbers-data-and-basic-values",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Numbers, Data, and Basic Values"
}
-->

# Numbers, Data, and Basic Values

Work with primitive values and other fundamental types used throughout Cocoa.

## Topics

### Numbers

  <doc://com.apple.documentation/documentation/Swift/Int>

  <doc://com.apple.documentation/documentation/Swift/Double>

[`Decimal`](/documentation/Foundation/Decimal)

A structure representing a base-10 number.

[`NumberFormatter`](/documentation/Foundation/NumberFormatter)

A formatter that converts between numeric values and their textual representations.

### Numbers

  <doc://com.apple.documentation/documentation/ObjectiveC/NSInteger>

  <doc://com.apple.documentation/documentation/ObjectiveC/NSUInteger>

[`Decimal`](/documentation/Foundation/Decimal)

A structure representing a base-10 number.

[`NSDecimalNumber`](/documentation/Foundation/NSDecimalNumber)

An object for representing and performing arithmetic on base-10 numbers.

[`NSNumber`](/documentation/Foundation/NSNumber)

An object wrapper for primitive scalar numeric values.

[`NumberFormatter`](/documentation/Foundation/NumberFormatter)

A formatter that converts between numeric values and their textual representations.

### Binary Data

[`Data`](/documentation/Foundation/Data)

A byte buffer in memory.

[`DataProtocol`](/documentation/Foundation/DataProtocol)

A protocol that provides consistent data access to the bytes underlying contiguous and noncontiguous data buffers.

[`MutableDataProtocol`](/documentation/Foundation/MutableDataProtocol)

A protocol that provides consistent data access to the bytes underlying contiguous and noncontiguous mutable data buffers.

[`ContiguousBytes`](/documentation/Foundation/ContiguousBytes)

A protocol that declares the type offers direct access to the underlying raw bytes in a contiguous manner.

### Binary Data

[`NSData`](/documentation/Foundation/NSData)

A static byte buffer in memory.

[`NSMutableData`](/documentation/Foundation/NSMutableData)

An object representing a dynamic byte buffer in memory.

### URLs

[`URL`](/documentation/Foundation/URL)

A value that identifies the location of a resource, such as an item on a remote server or the path to a local file.

[`URLComponents`](/documentation/Foundation/URLComponents)

A structure that parses URLs into and constructs URLs from their constituent parts.

[`URLQueryItem`](/documentation/Foundation/URLQueryItem)

A single name-value pair from the query portion of a URL.

### URLs

[`NSURL`](/documentation/Foundation/NSURL)

An object that represents the location of a resource, such as an item on a remote server or the path to a local file.

[`NSURLComponents`](/documentation/Foundation/NSURLComponents)

An object that parses URLs into and constructs URLs from their constituent parts.

[`NSURLQueryItem`](/documentation/Foundation/NSURLQueryItem)

An object representing a single name/value pair for an item in the query portion of a URL.

### Unique Identifiers

[`UUID`](/documentation/Foundation/UUID)

A universally unique value to identify types, interfaces, and other items.

### Unique Identifiers

[`NSUUID`](/documentation/Foundation/NSUUID)

A universally unique value that can be used to identify types, interfaces, and other items.

### Geometry

  <doc://com.apple.documentation/documentation/CoreFoundation/CGFloat-swift.struct>

[`NSPoint`](/documentation/Foundation/NSPoint)

A point in a Cartesian coordinate system.

[`NSSize`](/documentation/Foundation/NSSize)

A two-dimensional size.

[`NSRect`](/documentation/Foundation/NSRect)

A rectangle.

[`AffineTransform`](/documentation/Foundation/AffineTransform)

A graphics coordinate transformation.

[`NSEdgeInsets`](/documentation/Foundation/NSEdgeInsets)

A description of the distance between the edges of two rectangles.

### Geometry

  <doc://com.apple.documentation/documentation/CoreFoundation/CGFloat-swift.struct>

[`NSPoint`](/documentation/Foundation/NSPoint)

A point in a Cartesian coordinate system.

[`NSSize`](/documentation/Foundation/NSSize)

A two-dimensional size.

[`NSRect`](/documentation/Foundation/NSRect)

A rectangle.

[`NSAffineTransform`](/documentation/Foundation/NSAffineTransform)

A graphics coordinate transformation.

[`NSEdgeInsets`](/documentation/Foundation/NSEdgeInsets)

A description of the distance between the edges of two rectangles.

### Ranges

[`NSRange`](/documentation/Foundation/NSRange-c.struct)

A structure used to describe a portion of a series, such as characters in a string or objects in an array.

[`NSRange`](/documentation/Foundation/NSRange-swift.typealias)

A structure used to describe a portion of a series, such as characters in a string or objects in an array.



---

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)