JSON to Schema / TS / Kotlin / Swift

Generate strict OpenAI/Gemini Structured Output JSON Schema, TypeScript interfaces, Kotlin data classes, or Swift Codable structs from sample JSON.

How It Works & Reference

Paste a representative JSON object or array, pick your target format (JSON Schema Draft 2020-12 with required & additionalProperties:false for LLM tool calling, TypeScript, Kotlin, or Swift), and copy the generated code in one click.

JSON Type Mapping Reference

JSON ValueJSON SchemaTypeScriptKotlin / Swift
"leo"stringstringString / String
42integernumberInt / Int
3.14numbernumberDouble / Double
truebooleanbooleanBoolean / Bool
["a"]arraystring[]List<String> / [String]

Frequently Asked Questions

Does the JSON Schema work with OpenAI and Gemini Structured Outputs?

Yes. Each object includes explicit types, properties, required keys, and additionalProperties: false.

Is my JSON payload sent to a server?

No. Parsing and code generation run 100% inside your browser tab.

How are nested objects and arrays handled?

Yes, nested objects are recursively converted into sub-interfaces/classes or nested schema definitions.

Related Tools