Home / Developer / JSON to Types

JSON to Types

Generate TypeScript, Zod, Go, Rust, Python, Java, C#, Swift, Kotlin, Dart, C++, PHP, Ruby, Elm types or JSON Schema from JSON.

Free, no uploads, no sign-up. Runs 100% in your browser.

How JSON to Types works

Types are inferred with quicktype (Apache-2.0) running in your browser. It merges the shape of all objects, finds optional fields, dates, UUIDs and unions, and renders idiomatic code for the language you pick.

Input: JSON. Output: TS, GO, RS, PY, JAVA, CS, SWIFT, KT, DART, HPP, PHP, RB, ELM, JSON Schema.

How to use JSON to Types

  1. Paste JSON (an object or an array of objects).
  2. Pick a language and a name for the top-level type.
  3. Copy or download the generated code.

Tips

  • Paste several sample objects in an array so optional fields are detected.
  • TypeScript + Zod gives you runtime validation as well as types.

JSON to Types FAQ

Is my file uploaded?
No. Everything runs in this browser tab on your own device. Engines are downloaded once and cached, but your files never leave your computer.
Are my files uploaded?
No. This tool runs entirely in your browser tab. Files are read from your disk into memory and the result is generated locally.
Is it free? Are there limits or watermarks?
Free and open source (MIT). There are no file-size caps, daily quotas, accounts or watermarks.
Does it work offline?
Yes, once the page (and any engine it needs) has loaded, it keeps working without a connection thanks to the service worker cache.

Related tools

  • JSON Formatter: Prettify, validate, minify and explore JSON as a tree.
  • YAML ⇄ JSON: Convert between YAML and JSON with validation.
  • Mock Data Generator: Generate realistic fake names, emails, addresses, products and dates as JSON, CSV, SQL inserts, NDJSON or TSV.
  • QR Code Generator: QR codes for links, Wi-Fi, vCards and text with colors and logo.

OpenFile runs in your browser. Turn on JavaScript to use the tools.