Skip to content
Run here 100% in your browser, no upload, no login

JSON to TypeScript

Turn JSON into named TypeScript interfaces with nested types and array element typing.

How to use it

  1. Paste your JSON into the left panel — a sample payload loads on start.
  2. Set the root interface name; nested interfaces are named from their key paths.
  3. Toggle optional fields to mark keys that are missing in some sibling objects with ?.
  4. The output updates as you type; click Copy to take the interfaces into your project.
  5. Name collisions get numeric suffixes, and non-identifier keys are emitted as ['quoted-key'].

Common use cases

Why it stays private

Parsing and code generation are local string operations; your JSON is never uploaded. Safe for internal payloads, tokens-free but unreleased API shapes, and customer data samples.

FAQ

Q: How are arrays of objects handled? A: All object elements are merged into one interface covering their key union; the array itself is typed as that interface name followed by []. Non-object elements contribute a union member when they differ.

Q: What happens to null values? A: null becomes the null type and joins any union, so a field that is string in one place and null in another comes out as string | null.

Q: Are identical nested shapes deduplicated? A: Not structurally — deduplication is by generated name only. Two objects with the same keys but different names produce two interfaces; merge them manually if you want a single shared type.

Your data stays on this device

JSON to TypeScript runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.