Kotlin Help

Types overview

In Kotlin, everything is an object in the sense that you can call member functions and properties on any variable. Some types, such as numbers, characters, and booleans, have an optimized internal representation as primitive values at runtime, but they appear and behave like regular classes in Kotlin code.

Basic types

This section describes the basic types used in Kotlin:

Category

Basic types

Definition

Integers

Byte, Short, Int, Long

Whole numbers

Unsigned integers

UByte, UShort, UInt, ULong

Non-negative whole numbers

Floating-point numbers

Float, Double

Numbers with a fractional part

Booleans

Boolean

Logical values: true and false

Characters

Char

A single character

Strings

String

A sequence of characters

Arrays

Array<T>, primitive-type arrays

A fixed-size sequence of values

To learn about other Kotlin types, such as Nothing, Any, and Unit, look through the Kotlin API reference:

  • Any – The root of the Kotlin class hierarchy.

  • Nothing – A type that has no values.

  • Unit – A type with only one value (Unit).

Non-denotable types

Kotlin also has non-denotable types. They are the types that you can't write directly in the Kotlin code. Instead, the compiler uses them internally, for example, for interoperability with other languages. Kotlin creates non-denotable types to represent type information that is more precise than what Kotlin source syntax allows.

Even though you can't declare non-denotable types yourself, you may encounter them in compiler diagnostics, IDE tooltips, or inferred type displays. Learn more about non-denotable types in:

22 September 2026