Ideal for tests
fun main() {
    val name = "stranger"        // Declare your first variable
    println("Hi, $name!")        // ...and use it!
    print("Current count:")
    for (i in 0..10) {           // Loop over a range from 0 to 10
        print(" $i")
Get started ↗
// More than 30% fewer lines of code compared to Java
// (based on the experience of Duolingo and other companies)

data class Book (
    val title: String,                         // + automatically generated equals(),
    val year: Int                              // hashCode(), toString(), and copy()
fun century(year: Int) = (year - 1) / 100 + 1  // Top-level function,
                                               // single-expression body
fun main() {
    val books = listOf(                        // Construct a list
        Book("Don Quixote", 1605),             // No `new` keyword
        Book("The Lord of the Rings", 1955)
    val classics = books.filter { century(it.year) < 20 } // Trailing single-argument lambda
    println("Classic books: $classics")                   // Calls toString() for Book
Get started ↗

Share code on your terms and for different platforms

Simplify the development of cross-platform projects with Kotlin Multiplatform. It reduces time spent writing and maintaining the same code for different platforms while retaining the flexibility and benefits of native programming. Kotlin applications will work on different operating systems, such as iOS, Android, macOS, Windows, Linux, watchOS, and others.

Mobile platforms Feature
Learn about Kotlin Multiplatform → Learn more →

Big, friendly and helpful

Kotlin has great support and many contributors in its fast-growing global community. Enjoy the benefits of a rich ecosystem with a wide range of community libraries. Help is never far away — consult extensive community resources or ask the Kotlin team directly.

Join the community →