Skip to content

JSON to Kotlin Converter

Embed

Paste this where you want JSON to Kotlin Converter on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/json-to-kotlin/" width="100%" height="500" frameborder="0" loading="lazy" title="JSON to Kotlin Converter"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/json-to-kotlin/">JSON to Kotlin Converter</a> by BrowserUtils</p>

Generate Kotlin data classes from JSON.Runs in this tab.

Next step

About JSON to Kotlin Converter

Free online JSON to Kotlin converter. Automatically generate Kotlin data classes from JSON data. It runs in your browser. Nothing is sent to a server.

Questions

How do I generate Kotlin data classes from JSON?
Paste your JSON into the input field and the tool will produce Kotlin data classes with val properties. Nested objects become separate data classes with proper type references.
What Kotlin types does the converter produce?
The converter maps JSON strings to String, integers to Int, decimals to Double, booleans to Boolean, and arrays to List<T>. Null values are typed as Any?.
Can I use the generated Kotlin data classes with Moshi or Gson?
Yes, the data classes work with Moshi, Gson, and kotlinx.serialization. You may need to add the appropriate annotations depending on which library your project uses.
Does the JSON to Kotlin converter work offline?
Once the page is loaded, all JSON parsing and class generation run in your browser with no server calls, so you can use it without an internet connection.
Is it safe to paste production JSON into the Kotlin converter?
Yes, no data is sent to any server. All processing happens locally in your browser, so production API responses and sensitive data remain private.

More in Code Generators

All 26 code generators