Skip to content
Toolden

TOOLDENDEVELOPERON-DEVICE

JSON to TypeScript

Turn a JSON object into a TypeScript interface or type.

230 chars · types inferred live on the right.

Paste JSON on the left. Set a root name and choose interface or type, copy on the right.
Paste JSON on the left, the TypeScript type appears here.

No input yet, paste JSON on the left to generate the type.

HOW TO USE

  1. 1Paste a JSON object on the left, or click "Try sample" to load a built-in example.
  2. 2Set the root name and pick interface or type on the left.
  3. 3Read the generated TypeScript on the right.
  4. 4Click Copy to grab the type into your project.

EXAMPLE

INPUT

{"name":"John","age":30,"tags":["admin"],"active":true}

OUTPUT

interface Data {
  name: string;
  age: number;
  tags: string[];
  active: boolean;
}

FAQ

What happens to empty arrays?
They become unknown[] since no element type can be inferred.
Is my JSON uploaded anywhere?
No. Everything happens in your browser.
Can it handle nested objects?
Yes, nested objects become inline types. Arrays of objects produce typed arrays.
Does it generate types or interfaces?
Both. Pick interface or type in the Shape toggle on the left.

RELATED TOOLS