Runs in this tab · nothing uploaded

EN

English

हिन्दीComing soon

EspañolComing soon

Pinned
HelpyTools

More

JSON to TypeScript

Turn a JSON sample into TypeScript interfaces or types, with nested types, unions and optional keys worked out for you.

Runs in your browserNothing uploadedWorks offline
Loading JSON to TypeScriptRuns on this device. Nothing is uploaded.

Questions

How are optional keys decided?

When an array holds several objects, a key that is missing from some of them is marked optional with a question mark. Turn this off to make every key required.

What does it do with mixed values?

Values of different types under the same key become a union such as string | null. Empty arrays become unknown[] because the sample does not say what they hold.

Does it guess dates or enums?

No. It types what JSON can express: strings, numbers, booleans, null, arrays and objects. A date string stays a string.

All developer tools

↑ ↓ move↵ openesc close

The tray

Install HelpyTools

Get HelpyTools on your home screen or Dock. It opens in its own window, and tools you have opened once keep working offline.