The Kotlin Standard Library provides living essentials for everyday work with Kotlin. These include:
Core functions and types, available on all supported platforms.
Library support for the Kotlin annotation facility.
Access to top-level properties (document, window etc.) in the browser environment.
Collection types, such as [Iterable][kotlin.collections.Iterable], [Collection][kotlin.collections.Collection], [List][kotlin.collections.List], [Set][kotlin.collections.Set], [Map][kotlin.collections.Map] and related top-level and extension functions.
Helper functions for creating [Comparator][kotlin.Comparator] instances.
Utility functions for concurrent programming.
Experimental DSL for declaring custom function contracts.
Basic primitives for creating and suspending coroutines: [Continuation][kotlin.coroutines.Continuation], [CoroutineContext][kotlin.coroutines.CoroutineContext] interfaces, coroutine creation and suspension top-level functions.
Low-level building blocks for libraries that provide coroutine-based APIs.
Provides exceptions arising on suspended coroutine cancellation.
Utility functions for working with the browser DOM.
Utilities for working with Kotlin enum classes.
Experimental APIs, subject to change in future versions of Kotlin.
IO API for working with files and streams.
Convenient extensions for working with file system using [java.nio.file.Path][java.nio.file.Path].
API for encoding and decoding data using various encoding schemes, such as [Base64][kotlin.io.encoding.Base64].
Functions and other APIs specific to the JavaScript platform.
JavaScript-specific collection types, such as [JsArray][kotlin.js.collections.JsArray] and [JsReadonlyMap][kotlin.js.collections.JsReadonlyMap].
Functions and annotations specific to the Java platform.
Convenience extension functions for java.util.Optional to simplify Kotlin-Java interop.
Mathematical functions and constants.
The functions include trigonometric, hyperbolic, exponentiation and power, logarithmic, rounding, sign and absolute value.
Provides functions and types specific to Kotlin/Native, as well as means for interoperability with an underlying platform and other languages.
Kotlin/Native-specific concurrency primitives and utility functions for concurrent programming.
API for object life-cycle and references management.
Allows to query information from and interact with the Kotlin/Native runtime.
Standard implementations of delegates for delegated properties and helper functions for implementing custom delegates.
Provides the default generator of pseudo-random values, the repeatable generator, and a base class for other RNG implementations.
Ranges, Progressions and related top-level and extension functions.
Runtime API for Kotlin reflection
Extensions for Kotlin reflection provided by kotlin-reflect library.
Runtime API for interoperability between Kotlin reflection and Java reflection provided by kotlin-reflect library.
[Sequence][kotlin.sequences.Sequence] type that represents lazily evaluated collections. Top-level functions for instantiating sequences and extension functions for sequences.
The sequence operations can be classified into the following groups regarding their state requirements:
If the sequence operation returns another sequence, which is produced lazily, it's called intermediate, and otherwise the operation is terminal. Examples of terminal operations are [kotlin.sequences.Sequence.toList], [kotlin.sequences.Sequence.max].
Sequences can be iterated multiple times, however some sequence implementations might constrain themselves to be iterated only once. That is mentioned specifically in their documentation (e.g. [kotlin.sequences.generateSequence] overload). The latter sequences throw an exception on an attempt to iterate them the second time.
Utility functions for working with Java 8 streams.
System-related utility functions.
Functions for writing test assertions.
Functions for working with text and regular expressions.
API for measuring time intervals and calculating durations.
For more information, see our Time measurement guide.
Multiplatform Uuid class and utility functions for working with UUIDs.
Experimental API for working with unmanaged and foreign memory, as well as for interoperability with other languages, such as Objective-C and C.
Kotlin JavaScript wrappers for the WebGL API.
Kotlin JavaScript wrappers for the DOM API.
Kotlin JavaScript wrappers for the DOM CSS API.
Kotlin JavaScript wrappers for the DOM events API.
Kotlin JavaScript wrappers for the DOM parsing API.
Kotlin JavaScript wrappers for the DOM SVG API.
Kotlin JavaScript wrappers for the DOM URL API.
Kotlin JavaScript wrappers for the W3C fetch API.
Kotlin JavaScript wrappers for the W3C file API.
Kotlin JavaScript wrappers for the Web Notifications API.
Kotlin JavaScript wrappers for the Navigation Timing API.
Kotlin JavaScript wrappers for the Web Workers API.
Kotlin JavaScript wrappers for the XMLHttpRequest API.