Kotlin source code
File type: Source code and script file
A .kts file contains a Kotlin script written in the Kotlin programming language. Unlike a regular Kotlin source file, a script can contain statements intended to run as a script.
File type category:
Source code and script file
Date updated: November 22, 2026
Kotlin is a statically typed programming language developed by JetBrains. It is used to create applications for the Java Virtual Machine and Android, as well as software targeting JavaScript and native platforms.
A .kts script contains Kotlin source code that can be run with Kotlin scripting support. Scripts may also be used for configuration; their contents and required dependencies depend on the script's purpose.
Android Studio and IntelliJ IDEA provide Kotlin support on their supported platforms. Kotlin scripting remains part of the Kotlin ecosystem, although a particular script may require a compatible scripting host and its dependencies to run.
Open and edit .kts files in IntelliJ IDEA or Android Studio, both of which support Kotlin. To run a script, use a Kotlin scripting environment that supports its dependencies and any script-specific configuration.
There is no general conversion that turns every .kts script into an equivalent standalone file. Kotlin code can be compiled to JavaScript with Kotlin/JS tooling, but script-specific features may need to be adapted, and the result is compiled output rather than a direct source-file conversion.
Software applications that can open kts files:
Microsoft Windows
Apple macOS / Mac OS X
Linux/Unix
Multiplatform
Software applications that can edit kts files:
Microsoft Windows
Apple macOS / Mac OS X
Linux/Unix
Multiplatform
Software capable of saving kts files:
Microsoft Windows
Apple macOS / Mac OS X
Linux/Unix
Multiplatform
Software apps that create kts files:
Microsoft Windows
Apple macOS / Mac OS X
Linux/Unix
Multiplatform