Related tools
- Parquet ViewerOpen a Parquet file and read its schema, row counts and data in your browser.
- JSON Schema ValidatorValidate a JSON document against a JSON Schema with readable, path-specific errors.
- Fake Data GeneratorBulk names, emails, addresses, IDs and JSON fixtures, with a seed for repeatable output.
- CSV ViewerOpen, sort, filter and convert CSV and TSV right in your browser.
- Binary Format DecoderDecode protobuf, CBOR, and msgpack payloads to readable JSON in your browser.
- Data Format ConverterConvert data between CSV, JSON, YAML, and TOML in any direction, auto detecting the source format from what you paste.
What it does
Turns a sample JSON document into TypeScript interfaces, Zod schemas, or Kotlin data classes. Every element of an array is merged rather than sampled from the first item, so a key that only some records carry comes out optional and a key with two different value types comes out as a union. Nested objects become their own named types, full ISO date-time strings are flagged with a comment, and keys that are not valid identifiers are quoted or given a @SerialName annotation.
How to use it
Paste your JSON, drop a .json file, or pick one from disk. Choose a target and set the name you want for the root type. Turn the nulls option off if you would rather get a required nullable property than an optional one. The generated code appears immediately with a copy button, and your settings live in the URL so you can share the exact output.
Why this one
The well known JSON to TypeScript converter sites are ad walled, cap the payload size, and post your JSON to their servers to do the work. This one runs in your browser, so your files and inputs never leave your device, and it merges the shapes of all array elements instead of only reading the first one, which is where the popular converters quietly lose optional and union fields.
FAQ
- How are arrays with mixed objects handled?
- The shapes of every element are merged into one type. A key missing from some elements becomes optional, and a key with conflicting value types becomes a union: string | number in TypeScript, z.union in Zod. Kotlin has no structural union, so it falls back to JsonElement with a comment naming the types that were mixed.
- Which Zod version does the output target?
- Zod v3 syntax, which is also what Zod v4 accepts for these constructs: z.object, z.array, z.union, .optional(), .nullable(), .describe(), and z.infer. Child schemas are always declared before the schema that references them, and each one gets an exported z.infer type.
- Is my JSON uploaded anywhere?
- No. Parsing and code generation run entirely in your browser, so your files and inputs never leave your device. The page keeps working offline after the first load.
Keyboard shortcuts: press ? anywhere on this page to see them.