Fork me on GitHub

A simple web framework
for Java and Kotlin

  • Java
  • Kotlin
import io.javalin.Javalin;

public class HelloWorld {
    public static void main(String[] args) {
        Javalin app = Javalin.create().start(7000);
        app.get("/", ctx -> ctx.result("Hello World"));
import io.javalin.Javalin

fun main(args: Array<String>) {
    val app = Javalin.create().start(7000)
    app.get("/") { ctx -> ctx.result("Hello World") }

Why Javalin?


Unlike other Java and Kotlin web frameworks, Javalin has very few concepts that you need to learn. You never extend classes and you rarely implement interfaces.


Javalin is just a few thousand lines of code on top of Jetty, and its performance is equivalent to raw Jetty code. Due to its size, it's very easy to reason about the source code.


Other Java and Kotlin web frameworks usually offer separate version for each language. Javalin is being developed with interoperability in mind, so apps are built the same way in both Java and Kotlin.


Javalin is designed to be simple and blocking, as this is the easiest programming model to reason about. However, if you set a Future as a result, Javalin switches into asynchronous mode.


Visit our educators page if you're teaching web programming and looking for a web framework which will get out of your way and let you focus on the core concepts of your curriculum.

OpenAPI integration

Many lightweight Java and Kotlin web frameworks don't support OpenAPI, but Javalin has a full integration, including Swagger UI and redoc to display the generate docs. Learn more at the dedicated OpenAPI plugin page.

Declare server and API
in the same place

  • Java
  • Kotlin
import io.javalin.Javalin;
import static io.javalin.apibuilder.ApiBuilder.*;

Javalin app = Javalin.create(config -> {
    config.defaultContentType = "application/json";
}).routes(() -> {
    path("users", () -> {
        path(":user-id", () -> {
        ws("events", userController::webSocketEvents);
import io.javalin.Javalin;
import io.javalin.apibuilder.ApiBuilder.*;

val app = Javalin.create { config ->
    config.defaultContentType = "application/json"
}.routes {
    path("users") {
        path(":user-id") {
        ws("events", userController::webSocketEvents)

Creating a REST API has never been easier

A solid foundation


Javalin runs on top of Jetty, one of the most used and stable web-servers on the JVM. You can configure the Jetty server fully, so you can easily get SSL and HTTP2 and everything else that Jetty has to offer.

SparkJava and Koa.js

Javalin started as a fork of the Java and Kotlin web framework SparkJava, but turned into a ground-up rewrite influenced by the Javascript framework koa.js. Javalin takes the best concepts from these two frameworks.

Who's using Javalin?

JHU Microsoft Redhat NTNU Pleo Uber Measures for Justice WIT Briar Two Sigma nav Virgil Security Working Group Two Talan Labs Datawire Swatt Telenor Revolut Express Scripts Deutsche Kreditbank C6 Bank Nordstrom

Are you using Javalin? Let us know!

What is Javalin used for?

Check out our current survey results (Spring 2020) to learn more about how people use Javalin.

Do you like Javalin?