You are a Kotlin developer. You build Android apps. But your company also needs an iOS app. And maybe a desktop app. And a web app.
Do you write everything four times? Do you switch to Flutter and learn Dart? Do you hire a separate iOS team?
Or do you use the Kotlin you already know — and share your code across all platforms?
That is what Kotlin Multiplatform (KMP) does.
What is Kotlin Multiplatform?
KMP is a technology from JetBrains that lets you write Kotlin code once and use it on Android, iOS, Desktop, Web, and Server.
The key idea: share the logic, keep the UI native.
┌─────────────────────────────────────────┐
│ Shared Kotlin Code │
│ │
│ Business logic, networking, database, │
│ ViewModels, data models, validation │
└────────┬──────────┬──────────┬──────────┘
│ │ │
┌────▼────┐ ┌───▼────┐ ┌──▼──────┐
│ Android │ │ iOS │ │ Desktop │
│ Compose │ │ SwiftUI│ │ Compose │
│ (UI) │ │ (UI) │ │ (UI) │
└─────────┘ └────────┘ └─────────┘
Your networking code, database code, business logic, and ViewModels are written once in Kotlin. Each platform uses its own native UI — Jetpack Compose on Android, SwiftUI on iOS, Compose Multiplatform on Desktop.
What Can You Share?
| Layer | Shared? | Example |
|---|---|---|
| Business Logic | Yes | Validation, calculations, formatting |
| Data Models | Yes | User, Product, Order classes |
| Networking | Yes | API calls with Ktor |
| Database | Yes | Local storage with SQLDelight or Room |
| ViewModel | Yes | Screen logic with StateFlow |
| UI | Optional | Compose Multiplatform (Android + iOS + Desktop) |
| Platform APIs | No (use expect/actual) | Camera, GPS, push notifications |
You choose how much to share. Some teams share only business logic (20% of code). Others share everything including UI (90% of code). KMP gives you that flexibility.
How is KMP Different from Flutter?
This is the question everyone asks. Here is the honest answer:
| KMP | Flutter | |
|---|---|---|
| Language | Kotlin | Dart |
| UI approach | Native UI (Compose + SwiftUI) or shared with CMP | Custom rendering engine (same UI everywhere) |
| What you share | You choose (logic only → logic + UI) | Everything by default |
| Performance | Native (compiles to platform code) | Near-native (custom renderer) |
| App look | Native look on each platform | Same look everywhere |
| Adoption | 23% of developers (3x growth in 1 year) | 46% of developers |
| Best for | Teams with existing Kotlin/Swift skills | Teams building from scratch with one codebase |
| Backed by | JetBrains + Google |
When KMP Wins
- You already know Kotlin (no new language to learn)
- You have an existing Android app and want to add iOS
- You want each platform to look and feel truly native
- Your team has both Kotlin and Swift developers
- You need deep platform integration (camera, sensors, etc.)
When Flutter Wins
- You are starting from zero and want maximum speed
- You want pixel-identical UI on all platforms
- Your team knows Dart or is willing to learn
- You are a small team building a prototype
There is no wrong choice. Both are production-ready. The best one is the one that matches your team and project.
Who Uses KMP in Production?
KMP is not experimental. Major companies run it in production serving millions of users:
Netflix
Netflix uses KMP for their Studio apps (the tools used to produce films and TV shows). They share business logic between Android and iOS while keeping native UI. Netflix is the first FAANG company to publicly adopt KMP.
McDonald’s
McDonald’s started with KMP for their payment feature. After seeing the results — fewer crashes and better performance — they expanded KMP to their entire mobile app. That app processes 6.5 million orders per month.
Duolingo
Duolingo tried six different code-sharing approaches before settling on KMP. Now they share 80% of their logic across platforms and ship iOS and Android releases simultaneously. Development time for new features dropped dramatically.
Airbnb
Airbnb famously abandoned React Native in 2018. In 2025, they adopted KMP instead — achieving 95% code sharing for booking logic while keeping native UI. Their release cycle went from monthly to weekly.
Other Companies
Google, Forbes, Philips, Bolt, H&M, Cash App, VMware, Autodesk, and hundreds more use KMP in production.
How KMP Works Under the Hood
KMP compiles your Kotlin code differently for each platform:
Kotlin Code (.kt)
↓
KMP Compiler
↓
┌────────────────────┐
│ Android → JVM/ART │ (runs on Android Runtime)
│ iOS → Native ARM │ (runs natively, no VM)
│ Desktop → JVM │ (runs on JVM)
│ Web → JavaScript │ (runs in browser)
│ Server → JVM │ (runs on server)
└────────────────────┘
There is no bridge, no interpreter, no virtual machine on iOS. Your Kotlin code compiles directly to native ARM code. This is why KMP apps perform as well as fully native apps.
The Project Structure
A KMP project has three main parts:
my-kmp-project/
├── shared/ ← Shared Kotlin code
│ └── src/
│ ├── commonMain/ ← Code for ALL platforms
│ ├── androidMain/ ← Android-specific code
│ └── iosMain/ ← iOS-specific code
├── androidApp/ ← Android app (Compose UI)
│ └── src/main/
└── iosApp/ ← iOS app (SwiftUI)
└── ContentView.swift
commonMain
Code in commonMain runs on every platform. This is where you put:
- Data models
- Business logic
- Networking (Ktor)
- Database (SQLDelight)
- ViewModels
// shared/src/commonMain/kotlin/
// This code runs on Android, iOS, Desktop, and Web
data class User(
val id: String,
val name: String,
val email: String
)
class UserRepository(private val api: UserApi) {
suspend fun getUsers(): List<User> {
return api.fetchUsers()
}
}
Platform-Specific Code (expect/actual)
Sometimes you need different code on each platform. KMP uses the expect/actual pattern:
// commonMain — declare WHAT you need
expect fun getPlatformName(): String
// androidMain — provide Android implementation
actual fun getPlatformName(): String = "Android"
// iosMain — provide iOS implementation
actual fun getPlatformName(): String = "iOS"
You expect a function in common code, then provide the actual implementation for each platform. The compiler ensures you implement it everywhere.
The KMP Library Ecosystem
KMP has its own set of multiplatform libraries:
| What You Need | Native Android | KMP Alternative |
|---|---|---|
| Networking | Retrofit + OkHttp | Ktor Client |
| Database | Room | SQLDelight or Room (now KMP!) |
| Key-value storage | SharedPreferences | DataStore (now KMP!) |
| Dependency injection | Hilt | Koin |
| Serialization | Gson | Kotlin Serialization |
| ViewModel | AndroidX ViewModel | AndroidX ViewModel (now KMP!) |
| Image loading | Coil | Coil (now KMP!) |
| Navigation | Navigation Compose | Navigation Compose (now KMP!) |
Notice that many Google libraries now support KMP directly — ViewModel, Room, DataStore, Navigation. The ecosystem has matured significantly.
Compose Multiplatform — Share UI Too
If you don’t want to write SwiftUI for iOS, you can use Compose Multiplatform (CMP). It lets you write Compose UI once and run it on Android, iOS, Desktop, and Web.
// This Composable runs on ALL platforms
@Composable
fun UserCard(user: User) {
Card {
Column(modifier = Modifier.padding(16.dp)) {
Text(user.name, fontWeight = FontWeight.Bold)
Text(user.email)
}
}
}
Same Compose code you already know from our Jetpack Compose tutorials. No new framework to learn.
CMP is stable for Android, Desktop, and iOS (iOS became stable in CMP 1.8.0, May 2025). Web support (Kotlin/Wasm) is still in beta.
Should You Learn KMP?
Important: You need a Mac to build iOS apps with KMP. There is no way around this — Apple requires Xcode, and Xcode only runs on macOS. You can develop the shared code on Windows/Linux, but testing on iOS requires a Mac.
Yes, if:
- You are a Kotlin developer (Android, backend, or both)
- You want to build iOS apps without learning Swift from scratch
- Your company needs cross-platform apps
- You want to future-proof your skills (KMP adoption is growing 3x/year)
- You already know Jetpack Compose (CMP is the same API)
Maybe wait, if:
- You are completely new to programming (learn one platform first)
- Your project is iOS-only (just use Swift/SwiftUI)
- Your team is already deep into Flutter (no reason to switch)
The career angle
KMP developers are rare and in demand. Most companies have plenty of Android developers and plenty of iOS developers — but very few who can do both with shared code. Learning KMP puts you in a unique position.
What You Will Learn in This Series
This is the first tutorial in a 20-part KMP series. Here is what’s coming:
- What is KMP? (this article)
- Setting up your first KMP project
- Understanding project structure
- Compose Multiplatform — sharing UI
- KMP vs Flutter vs React Native
- Ktor — networking in KMP
- SQLDelight — database in KMP
- DataStore — key-value storage
- Koin — dependency injection
- Shared ViewModel
- Clean architecture in KMP 12-20. Navigation, testing, real app, publishing, and more
By the end, you will build a complete cross-platform app from scratch.
Quick Summary
| Concept | What It Means |
|---|---|
| KMP | Write Kotlin once, run on Android/iOS/Desktop/Web |
| commonMain | Shared code that runs everywhere |
| expect/actual | Platform-specific implementations |
| Compose Multiplatform | Share Compose UI across platforms (optional) |
| Not a new language | It is just Kotlin — you already know it |
| Production-ready | Netflix, McDonald’s, Airbnb, Duolingo use it |
| Growing fast | 7% → 23% adoption in one year |
Frequently Asked Questions
Is Kotlin Multiplatform production ready?
Yes. Netflix, McDonald’s, Airbnb, and Duolingo run KMP in production serving millions of users. Google officially supports it. JetBrains maintains it actively.
Do I need to learn Swift for iOS?
No — if you use Compose Multiplatform for shared UI. Yes — if you want native SwiftUI on iOS (but you only need basic Swift to integrate the shared module).
Can I add KMP to my existing Android app?
Yes. KMP supports gradual adoption. You can extract one module (like networking) into shared code and keep everything else native. No need to rewrite your whole app.
Is KMP the same as KMM?
KMM (Kotlin Multiplatform Mobile) was the old name that focused on Android + iOS only. JetBrains renamed it to KMP because it now supports Desktop, Web, and Server too.
Related Articles
- Jetpack Compose Tutorial Series — learn Compose first (KMP uses the same API)
- Cursor vs Claude Code vs Copilot — AI tools that help with KMP development
- What is Vibe Coding? — use AI to build KMP apps faster
What’s Next?
In the next tutorial, we will set up your first KMP project — install the tools, create a project with the KMP wizard, and run it on both Android and iOS.
See you there.