Share Kotlin code with CodeThis

Kotlin makes JVM code read like Swift. CodeThis keeps coroutines, extension functions, and sealed classes all syntax-aware.

Paste Kotlin now

What you get

  • Kotlin-aware syntax highlighting via CodeMirror
  • Instant shareable link — no signup required
  • Optional expiration (7 days, 30 days, permanent)
  • Password protection for private pastes
  • Works with the REST API and MCP server
  • Rich markdown and MDC components alongside code

Common use cases for Kotlin pastes

  • Android view models
  • Ktor handlers
  • Coroutine flow examples
  • DSL prototypes

Example

sealed class Result<out T>
data class Ok<T>(val value: T) : Result<T>()
data class Err(val message: String) : Result<Nothing>()

fun Result<Int>.orZero(): Int = when (this) {
  is Ok -> value
  is Err -> 0
}

Related languages

Ready to share some Kotlin?