Useful Hacks

JSON to TypeScript

Generate TypeScript interfaces from a JSON sample.

Processed locally in your browser. Nothing you enter is uploaded or stored.

Overview

Infers TypeScript interfaces from a sample JSON value — a fast starting point for typing an API response instead of writing interfaces by hand.

How to use it

  1. 1Paste a representative JSON sample.
  2. 2Optionally name the root type.
  3. 3Copy the generated interfaces.

How it works

Walks the JSON structure recursively, inferring a type for each value and generating a named interface for each nested object.

Tips

  • Since it's inferred from one sample, optional fields or fields that can be multiple types in your real data won't be detected — review the output before relying on it for a large API.

Related tools

All developer tools

Search tools

Search for any tool by name, category or keyword