Learnr

Learn Kotlin

Learn the concise, null-safe language behind modern Android apps.

or browse all courses.

Free to start. Built from a single prompt. No credit card.

Kotlin is a statically typed language created by JetBrains that runs on the Java Virtual Machine and interoperates fully with Java code. Google made it the preferred language for Android development, and it is also used for server-side apps with frameworks like Ktor and Spring. Kotlin cuts boilerplate with data classes, type inference and extension functions, and its type system separates nullable types like String? from non-null ones, preventing many crashes. Learnr builds you a personalized Kotlin course from one prompt and teaches it through short, interactive lessons, from val and var to coroutines.

How to learn Kotlin, step by step

  1. Start in the Kotlin Playground or IntelliJ. Run snippets in the official online Kotlin Playground, then install IntelliJ IDEA Community Edition or Android Studio for real projects. Learn the difference between val, which cannot be reassigned, and var.
  2. Get comfortable with null safety. Practice nullable types, the safe-call operator ?., the Elvis operator ?: and smart casts after a null check. Treat the !! operator as a warning sign rather than a fix.
  3. Use expressions instead of statements. In Kotlin, if and when return values, and functions can be single expressions. Rewrite chains of if statements as when blocks and use string templates for readable output.
  4. Model data with data and sealed classes. Data classes give you equals, toString and copy for free. Use sealed classes or interfaces to represent states like Loading, Success and Error, and let when check every case.
  5. Learn collection functions and lambdas. Use listOf, mapOf, map, filter, firstOrNull, groupBy and sortedBy with lambdas and the implicit it parameter. Knowing the standard library well replaces most hand-written loops.
  6. Apply coroutines in a project. Learn suspend functions, launch and async, then build a small Android app with Jetpack Compose or a Ktor server that loads data. Daily Learnr lessons help Kotlin idioms stick.

What you'll learn

  • Write idiomatic Kotlin with val, var, type inference and when expressions
  • Handle nullable types safely with ?., ?: and smart casts
  • Model data concisely with data classes and sealed classes
  • Transform collections with lambdas, map, filter and groupBy
  • Run asynchronous work with coroutines and suspend functions

What's inside your Kotlin course

A sample path Learnr builds for Kotlin. Your real course adapts to your goal and level.

  • 1. Kotlin basics and the JVM
  • 2. Functions, control flow and when
  • 3. Null safety and smart casts
  • 4. Classes, data classes and sealed hierarchies
  • 5. Collections, lambdas and extension functions
  • 6. Coroutines and applying Kotlin to Android

How long does it take to learn Kotlin?

With Java or another typed language behind you, Kotlin basics take 2 to 4 weeks. From scratch, the core language takes about 2 to 3 months at 5 hours a week. Coroutines and Android development add another few months of practice.

What you need before you start

No prior language is required, though knowing Java helps since Kotlin shares its platform. You need IntelliJ IDEA, Android Studio or the online playground.

Common mistakes to avoid

  • Using !! to force a nullable value whenever the compiler objects. Handle null explicitly with ?., ?: or an early return instead.
  • Writing Java-style Kotlin with getters, setters and verbose loops. Learn data classes, properties and collection functions to write idiomatic code.
  • Launching coroutines without a proper scope. Use lifecycle-aware scopes such as viewModelScope on Android so work is cancelled when no longer needed.

How Learnr builds your course

Type your topic

Tell Learnr you want to learn Kotlin, or get as specific as you like.

Get a personalized course

Learnr instantly builds a full Kotlin course tailored to your goal and skill level.

Learn and level up

Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.

Kotlin questions, answered

Do I need to learn Java before Kotlin?

No. Kotlin can be your first language. Java knowledge helps you read older Android code and libraries, but most new Android material is written in Kotlin.

Is Kotlin only for Android?

No. Kotlin is also used for server-side apps, command-line tools and, through Kotlin Multiplatform, for sharing code across Android, iOS, desktop and web.

What is the difference between val and var in Kotlin?

A val is a read-only reference that cannot be reassigned after initialization, while a var can be changed. Idiomatic Kotlin prefers val wherever possible.

Explore more courses

More programming and tech courses

See all programming and tech courses

Ready to learn Kotlin?

Start your free, personalized Kotlin course in seconds. .