JSON to Kotlin Data Class Converter
BeanTrans converts JSON into concise Kotlin data classes with val properties, nullable T? inference, and List<T> collections completely inside your browser. Ideal for Android, Jetpack Compose, and Kotlin backend DTO modeling.
Key Capabilities
- Produces clean Kotlin data class definitions with idiomatic camelCase val properties.
- Automatically extracts nested JSON structures into companion Kotlin data classes.
- Zero server transmission—safe for mobile API contracts and internal backend DTOs.
Type Mapping Reference
| Source | Target | Notes |
|---|---|---|
string | String | Kotlin String |
integer | Int / Long | Maps via Number Type |
decimal | Double | 64-bit Double |
null / optional | T? | Kotlin null-safe type |
array<T> | List<T> | Read-only List<T> |
Frequently Asked Questions
How does BeanTrans handle nullable properties in Kotlin?
Fields with null values or when Nullable fields is enabled are typed with Kotlin's null-safe ? suffix (such as String? or Int?).
Can I convert Java classes directly to Kotlin data classes?
Yes. Switch the Source language dropdown to Java and keep Target on Kotlin to translate POJOs via the shared AST.
Does BeanTrans require login or send my code to the cloud?
No. Everything runs locally inside your browser with zero sign-up and zero backend requests.