piko

JSON to TypeScript

Infer a TypeScript type from a sample JSON value.

Runs on your device. Nothing you add is uploaded.

TypeScript type
export type Root = {
  station: string;
  readings: Array<{
    celsius: number;
    hour: string;
  }>;
  active: boolean;
};

How to use JSON to TypeScript

  1. Paste a JSON value.
  2. Review the tool output or fix the first error shown.
  3. Copy the result or continue exploring the JSON.

Questions

How does this tool handle the input?
Mixed arrays produce a union of the element shapes. Empty arrays become unknown arrays. Fields are inferred from the sample.
Where is my input processed?
On your device. The tool does not upload the input or its result.

How this works

Parses strict JSON with a local syntax tree that retains the position and original spelling of each token.

Everything happens in this browser tab. What you type or add stays on your device, and the page has no tracking. Your last settings are kept in this browser so the tool opens the way you left it. Privacy

Related tools

More in Developer