---
title: "How do you convert Kotlin code to Java?"
description: "There is no source converter from Kotlin to Java, but Android Studio can show the Java equivalent of compiled Kotlin through its bytecode decompiler."
url: "https://bugsee.com/answers/kotlin/convert-kotlin-to-java/"
---

# How do you convert Kotlin code to Java?

There is no official Kotlin-to-Java converter. In Android Studio or IntelliJ use Tools > Kotlin > Show Kotlin Bytecode, then Decompile, to see equivalent Java for a file.

- Open the Kotlin file, choose Tools > Kotlin > Show Kotlin Bytecode, then click Decompile at the top of the panel.
- The decompiled Java is generated from bytecode, so it is verbose and contains helper code (Intrinsics checks, synthetic accessors). Treat it as a reference, not clean source.
- For hand conversion, map each feature: properties become fields with getters and setters, data classes need `equals`, `hashCode`, `toString` and copy logic, null safety becomes annotations, and extension functions become static methods.

```kotlin
data class User(val name: String, val age: Int = 18)

// Roughly the Java you would write by hand:
// public final class User {
//     private final String name;
//     private final int age;
//     public User(String name, int age) { this.name = name; this.age = age; }
//     public String getName() { return name; }
//     public int getAge() { return age; }
//     // plus equals, hashCode, toString and copy
// }
```

If the aim is to call Kotlin from existing Java code, you do not need to convert anything: the two languages interoperate, and annotations such as `@JvmStatic` and `@JvmOverloads` shape how Kotlin appears to Java callers.

## Related questions

- [How do you convert Java code to Kotlin?](https://bugsee.com/answers/kotlin/java-to-kotlin/)
