Kotlin 2.0 (JVM)

Online Kotlin Compiler

Modern, concise Kotlin programming playground with null safety and JVM execution. Write code with auto-formatting, test with standard input (stdin), and inspect terminal output in real-time.

✓ Null safety and type inference✓ Data classes and sealed interfaces✓ Extension functions✓ readLine standard input
main.kt
Kotlin 2.0 (JVM)
13px
Standard Input (stdin)
Passed to scanf, input(), cin, etc.
UTF-8Kotlin2 SpacesWrap: Off
Ctrl+Enter to Run
Ln 1, Col 121 lines528 chars
Output & ConsoleIdle

Ready to Compile & Run

Click the blue ▶ Run button in the header bar or press Ctrl + Enter to compile and execute your Online Kotlin Compiler.

How to Run Kotlin Code Online

Compile and run concise Kotlin code targeting modern JVM runtime.

  1. Write fun main(), press "▶ Run", and view output.

Common Errors & Troubleshooting

Encountering compilation or runtime diagnostics? Check these common scenarios:

Null can not be a value of a non-null typeUse nullable types (Type?) if null is possible.

Related Popular Language Compilers

View all 35+ compilers →
Python 3.py

Write, run and test Python 3 code in your browser with interactive standard input

JavaScript (Node.js).js

Execute modern ES6+ JavaScript code in an isolated high-speed runtime

TypeScript.ts

Type-safe JavaScript playground with instant transpilation and type validation

HTML / CSS / JS.html

Multi-pane web editor with live preview, responsive device frames and instant rendering

Frequently Asked Questions (Kotlin)

Yes, compiles with the latest Kotlin 2.0 K2 compiler.