Kotlin · online compiler

Run Kotlin online

Run Kotlin 2 online — the modern JVM language, Android's default.

Version
Firecracker microVM live per-test verdicts multi-file compile

Kotlin is JetBrains' language: null safety, coroutines, data classes, terse extension functions — everything Java should have shipped in 2015. Now Android's preferred language and increasingly common on server-side JVMs.

ls-judge runs Kotlin 2.x through kotlinc inside a Firecracker microVM.

Starter code

What you get in Kotlin

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

kotlin
Kotlin 2
fun main() { val n = readLine()!!.trim().toInt(); println(n * 2) }
stdin →21
expected →42
FAQ

Common questions about Kotlin on ls-judge

Which Kotlin?
Kotlin 2.x — with the K2 compiler.
Can I use coroutines?
Yes, the kotlinx.coroutines library is available.
Gradle / Maven?
No — sandbox has no network to fetch dependencies.
Kotlin/Native or Kotlin/JVM?
Kotlin/JVM.
Further reading
Also try