<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/swift-standard-library",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Swift Standard Library"
}
-->

# Swift Standard Library

Solve complex problems and write high-performance, readable code.

## Overview

The Swift standard library defines a base layer of functionality for writing Swift
programs, including:

- Fundamental data types such as [`Int`](/documentation/Swift/Int), [`Double`](/documentation/Swift/Double), and [`String`](/documentation/Swift/String)
- Common data structures such as [`Array`](/documentation/Swift/Array), [`Dictionary`](/documentation/Swift/Dictionary), and [`Set`](/documentation/Swift/Set)
- Global functions such as [`print(_:separator:terminator:)`](/documentation/Swift/print(_:separator:terminator:)) and [`abs(_:)`](/documentation/Swift/abs(_:))
- Protocols, such as [`Collection`](/documentation/Swift/Collection) and [`Equatable`](/documentation/Swift/Equatable), that describe
  common abstractions.
- Protocols, such as [`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible) and [`CustomReflectable`](/documentation/Swift/CustomReflectable),
  that you use to customize operations that are available to all types.
- Protocols, such as [`OptionSet`](/documentation/Swift/OptionSet), that you use to provide implementations
  that would otherwise require boilerplate code.

> Note: Experiment with Swift standard library types and learn high-level concepts
> using visualizations and practical examples. Learn how the Swift standard library
> uses protocols and generics to express powerful constraints. Download the playground
> below to get started.
> 
> [Swift Standard Library.playground](https://developer.apple.com/sample-code/swift/downloads/standard-library.zip)

## Topics

### Values and Collections

  <doc://com.apple.Swift/documentation/Swift/numbers-and-basic-values>

  <doc://com.apple.Swift/documentation/Swift/strings-and-text>

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

  <doc://com.apple.Swift/documentation/Swift/time-and-duration>

### Tools for Your Types

  <doc://com.apple.Swift/documentation/Swift/basic-behaviors>

  <doc://com.apple.Swift/documentation/Swift/encoding-decoding-and-serialization>

  <doc://com.apple.Swift/documentation/Swift/initialization-with-literals>

### Programming Tasks

  <doc://com.apple.Swift/documentation/Swift/input-and-output>

  <doc://com.apple.Swift/documentation/Swift/debugging-and-reflection>

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

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

  <doc://com.apple.Swift/documentation/Swift/key-path-expressions>

  <doc://com.apple.Swift/documentation/Swift/manual-memory-management>

  <doc://com.apple.Swift/documentation/Swift/type-casting-and-existential-types>

  <doc://com.apple.Swift/documentation/Swift/c-interoperability>

  <doc://com.apple.Swift/documentation/Swift/operator-declarations>

### Deprecated

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



---

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)