Skip to content
I Hate Online Tools

JSON to TypeScript

Infer TypeScript interfaces from a JSON sample.

Runs in this tab. The file stays here.

TypeScript

This runs in your browser. Nothing is uploaded.

About JSON to TypeScript

Infer TypeScript interfaces from a JSON sample.

Best-effort inference; refine by hand for unions.

How to use JSON to TypeScript

  1. 1Paste JSON.
  2. 2Copy interfaces.

Common questions

Nested objects?

Named nested interfaces are emitted.

Related tools

Why this one doesn't upload your file

There is no server to upload to. This page is a static file, and the work happens in your browser using the same graphics and WebAssembly code that renders every other site you visit. Your file is read from disk into memory, processed, and handed back as a download. Once the page has loaded you can disconnect from the network entirely and it keeps working. The longer explanation

Install the app