← Hashito System Top 日本語 Tools Blog
Input
How to use: paste JSON on the left and the type definitions appear on the right. Nested objects are named after their key and split into separate types; identical structures are merged.
Output
Types: 0 Lines: 0

Frequently asked questions

Can I use the generated types as they are?

Yes, but they describe only what a single JSON sample shows. Optional keys and fields that can hold more than one type cannot be inferred from one sample. For API responses, paste several samples and compare the results.

How are null fields handled?

By default the type is null. Turn on the optional switch to mark the key with ? as well, which is closer to reality when the API sometimes omits the field.

How are array element types decided?

Every element is inspected. If all elements share a type the result is T[]; if they differ it becomes (A | B)[]. An empty array gives unknown[] because there is nothing to infer from.

Is the JSON I paste sent to a server?

No. Parsing and generation run entirely in your browser. Nothing is uploaded or stored.