Running on your device · 0 bytes uploaded

# Generate code from JSON

Turn JSON into TypeScript, Go, Rust, or Zod — generated in your browser from one sample, with every option and the exact generator version shown. The output is a starting point, not a contract.
TypeScriptGoRustZodInsert JSON sampleClearJSONC input (comments + trailing commas)

Strict JSON
Nothing in yet

Paste, drop, or type to begin. Everything stays on this device.

## How JSON becomes TypeScript

### TypeScript mapping rules

- Objects become interfaces in first-seen order; properties are required unless the nullability option makes them optional.
- JSON null infers the literal type null — a nullable property is a union, not an optional marker.
- Arrays always keep their order as array types; nested objects become their own named interfaces.

### Inference rules (every language)

- quicktype-core infers one schema from ONE sample: every property it sees becomes required — absence in the sample is absence in the types.
- Inference defaults: similar objects combine into one class; UUID-like, date-time-like, integer-like, and boolean-like strings become their typed forms; heterogeneous maps infer as maps.
- Number kinds are inferred through IEEE-754 doubles: spellings like 1e400 or 30-digit integers still infer, but as doubles when they exceed the target's integer range.
- The output is a starting point: names are guesses (Top-level, and per-shape names), and review beats trust.
Top-level type name

Letters, digits, underscores — starts with a letter or underscore.
Make every property optional (nullability)Also emit runtime converters (Convert class)

## Next door in JSON

- [JSON Converter](/json/convert)
- [JSON Validator](/json/validator)
- [JSON formatter](/json/formatter)
[All JSON tools](/json)

---

Canonical HTML: https://nutter.tools/json/codegen
Markdown version: https://nutter.tools/json/codegen/index.md
Plain-text version: https://nutter.tools/json/codegen/index.txt
Agent index: https://nutter.tools/llms.txt

