ParseJar › Data

JSON to TypeScript

Turn an API response or config file into TypeScript types in one paste. Arrays of objects are merged, so keys missing from some items become optional.

What it infers

  • Each nested object becomes its own named type, named after its key in PascalCase (shipping_address becomes ShippingAddress).
  • Arrays of objects are merged into one item type. Keys that are missing in some items get ?; differing value types become a union.
  • null values become null in a union, or unknown if a key is only ever null.
  • Keys that are not valid identifiers are quoted.

Limits

Types are inferred from one sample, so they describe what you pasted, not every response the API can return. For a contract you can rely on, generate types from an OpenAPI or JSON Schema document instead.

FAQ

Is my JSON sent to a server?

No. The JSON is parsed and the types are generated in your browser.

Why is a field typed as unknown[]?

The sample had an empty array, so there was nothing to infer the item type from. Paste a sample with at least one item.

ParseJar is free. Its sister project ScrapeMole sells pay-per-call data APIs for AI agents.

Related tools