Awesome Open Source
Awesome Open Source


Build Status GitHub release GitHub stars JetBrains Plugin Download GitHub closed issues license

Kotlin IntelliJ Idea Plugin Android Studio Plugin


Hi, Welcome! This is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to Kotlin data class (Json to Kotlin). We also have a Java/Kotlin library. With this you can generate Kotlin data class from JSON string programmatically.

implementation 'wu.seal.jsontokotlin:library:3.6.1'


This is a very cool tool for Kotlin developers, it can convert a JSON string to Kotlin data class. The tool could not only recognize the primitive types but also auto create complex types. It's easily accessible, we provide shortcut keymap ALT + K for Windows and Option + K for Mac, have a try and you'll fall in love with it! JsonToKotlinClass just makes programming more enjoyable, enjoy coding! image

Easy Use

alt text

Want to generate classes code in inner class model? Do like this.

alt text

Want to generate Kotlin data class file? Do like this.

alt text

Want to generate Kotlin data classes in single file? Do like this.

alt text


  • Search 'JsonToKotlinClass' in Intellij Idea Plugin Repository Or AndroidStudio Plugin Repository And Install it.

File --> Settings --> Plugins --> Browse Repositories --> Search JsonToKotlinClass

  • Restart your IDE

  • Press ALT + K for Windows or Option + K for Mac or right click on package -> New->Kotlin data clas file from JSON and continue as guided.

Advanced usage

Have a try with the advanced dialog 😜


Generate Example

This is the example JSON from

        "title":"example glossary",
                    "GlossTerm":"Standard Generalized Markup Language",
                    "Abbrev":"ISO 8879:1986",
                        "para":"A meta-markup language, used to create markup languages such as DocBook.",

And with this plugin converting, Kotlin data classes would generate like this by default

data class Example(
    val glossary: Glossary

data class Glossary(
    val GlossDiv: GlossDiv,
    val title: String

data class GlossDiv(
    val GlossList: GlossList,
    val title: String

data class GlossList(
    val GlossEntry: GlossEntry

data class GlossEntry(
    val Abbrev: String,
    val Acronym: String,
    val GlossDef: GlossDef,
    val GlossSee: String,
    val GlossTerm: String,
    val ID: String,
    val SortAs: String

data class GlossDef(
    val GlossSeeAlso: List<String>,
    val para: String

Change Log

Build From Source

Want to try out the newest features?

$ git clone
$ cd JsonToKotlinClass
$ ./gradlew buildPlugin

And you're done! Go to directory build/distributions and you'll find, which can be installed via Install plugin from disk....

Contribute to This Repo

Find it useful and want to contribute? All sorts of contributions are welcome, including but not limited to:

  • Open an issue here if you find a bug;

  • Help test the EAP version and report bugs:

Go to the "Plugins" settings, click "Browse repositories..." => "Manage repositories..." and click the "+" button to add the EAP channel repository URL "". Optionally, you can also add the Alpha and Beta channel repository URLs "" and "".

Kindly note that the "EAP" or "Alpha" or "Beta" channel update may be unstable and tend to be buggy, if you want to get back to the stable version, remove the "EAP" or "Alpha" or "Beta" version and reinstall this plugin from the "JetBrains Plugin Repository" channel, which can be filtered by the drop-down menu next to the search input field.

  • Contribute your code:
$ git clone
$ cd JsonToKotlinClass

Open the build.gradle in IntelliJ, open "Gradle" tool window, expand the project view to "JsonToKotlinClass | Tasks | intellij | runIde", right-click and choose "Debug ...", and you're done! Create your PR here!

Chinese Detail Document (中文文档)


  • Any kind of issues are welcome.
  • Pull Requests are highly appreciated.


  • Thank @davidbilik for giving me the first awesome advice.
  • Thank @cgoodroe for opening many awesome issues for me, help me improve myself
  • Thank @wangzhenguang for reminding me of the details of the problem
  • Thank @kezhenxu94 for introducing CI/CD to save me a lot of time :)
  • Thank iqbalhood for contributing logo for this project
  • Thank akindone for adding order by alphabetical feature for JsonToKotlinClass
  • Thank rafalbednarczuk for adding make keyword property valid feature for JsonToKotlinClass

Find it useful ? ❤️

  • Support and encourage me by clicking the ⭐️ button on the upper right of this page. ✌️
  • Share to others to help more people have a better develope expierience ❤️


This project exists thanks to all the people who contribute.


The development of this plugin is powerly driven by JetBrains.

Join the Community

Let's talk
Join JsonToKotlinClass Slack
Join JsonToKotlinClass Telegram


We analytics anonymous user behavior for improving plugin production, we've provided a switch case for that.

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Plugin (113,829
Kotlin (46,539
String (42,372
Json (39,414
Intellij (5,399
Gson (1,363
Jackson (1,295
Intellij Plugin (801
Fastjson (427
Moshi (349
Androidstudio Plugin (94
Android Studio Plugin (94
Json To Kotlin (4
Logansquare (3