● JSON & Data

JSON to TypeScript Type

Generate a TypeScript type from a JSON example for faster API and fixture work.

●
Private by designRuns locally in this browser
Input61 chars · 1 lines
Drop a local text/data file here. Nothing is uploaded.
OutputWaiting for input
↗
Your result appears hereNothing is uploaded. Processing happens on this device.
Shortcut Ctrl/⌘ + Enter
Why this tool exists

Get the answer without turning it into a project.

Paste representative JSON and get a clean TypeScript type that mirrors its object, array, string, number, boolean and null structure.

Common questions

Does it infer optional fields?

This version infers from the single example you provide, so fields present in the sample are generated as required.

Can arrays contain mixed types?

Yes. Mixed sample arrays are represented using a TypeScript union.