json → typescript

JSON to TypeScript Interface Generator

Paste a JSON sample, get clean, nested TypeScript interfaces. Runs entirely in your browser.

Wire it to a real endpoint →

You've got the types, now get matching data. Spin up a live mock API that returns this shape, then simulate latency and errors to test your fetch and error handling.

Open the simulator

How to convert JSON to TypeScript

Paste a representative JSON object or array and click Generate interfaces. The generator infers field types, creates separate named interfaces for nested objects, merges keys across array items (marking inconsistent fields optional), and types arrays as T[]. Everything runs locally.

How are nested objects named?

From their key, converted to PascalCase (e.g. address → interface Address). Arrays of objects produce a single merged element interface.

What about null or missing fields?

Fields absent from some array items become optional (field?:). A null value is typed as any | null so you can tighten it manually.

Is my data uploaded?

No. Generation happens entirely in your browser.