Online Kotlin compiler
Compile and run Kotlin online free, no sign-up: write fun main(), give it input on stdin and see the output, compiler errors and run time.
How do I run Kotlin code online?
This is an online Kotlin compiler: write a top-level fun main(), put its input in the Input box and press Run. It is compiled for the JVM and run on the server, and you see the output, the compiler's errors or the exception, and the run time — free, with no sign-up.
How it works
- Write your program. A Kotlin program starts at a top-level fun main() — no class is needed. The standard library (collections, sorted(), map, filter, string templates) is there without imports.
- Give it input. readLine() returns one line, or null once the input has run out — hence readLine()!! in short programs, or readLine().orEmpty() to be safe. Split a line of numbers with readLine()!!.split(" ").map { it.toInt() }. Put every line the program reads in the Input box before you run it.
- Run it. Press Run or Ctrl+Enter. You get what the program printed, any compiler or runtime error, and how long it ran. The first run without an account asks a quick check that you are a person.
Who it is for
Anyone writing Kotlin who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying Kotlin before setting it up.