Skip to content
Tesserae

Keyboard shortcuts

Focus search
/
This help dialog
?
Run the current tool
Ctrl/⌘ +Enter
Copy the output (when an output is focused)
Ctrl/⌘ +C

Shortcuts are ignored while you are typing in an input, a textarea or a select.

Data Formats

JSON to TypeScript

Paste a JSON value and get TypeScript type declarations for it. Nested objects become their own named types (RootAddress, RootUser), arrays can be merged across every element so missing keys become optional, and null or mixed values turn into unions. Runs entirely on your device.

On-device No network Offline-ready

🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.

Try:

Options

Your result will appear here

Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.

How it works

From a sample to named type declarations

The tool parses one JSON value and emits TypeScript types for it. Every nested object becomes its own named type, with the name built from the parent name plus the key — an address field under Root becomes RootAddress. Array element objects get an Item suffix, so an array under a users key becomes RootUsersItem[]. The output is a runnable set of interface or type declarations you can paste into a project.

Merging every element of an array

When Merge shape of every array element is on, the tool unions the shapes of all objects in an array rather than trusting only the first one. Keys present in some but not all elements become optional, and the value type is a union of every distinct type seen. Turn it off to sample just the first element and keep the type tighter.

Choices that change the output

Root type name sets the name of the top-level declaration, and defaults to Root. Prefer interface produces interface blocks with semicolon properties; disabling it emits type aliases with equals signs. Mark properties readonly prefixes every field with readonly. Any key that is not a valid identifier is quoted, and a root name starting with a digit is prefixed with an underscore.

How null and mixed values become types

A null value becomes the null type, a number always maps to number (JSON has no separate integer type), and an array holding several value types becomes a parenthesised union such as (number | string)[]. Because the input is a sample, generated types match what the JSON actually contains — they do not guess at fields that were missing from the data.

Generation is fully local

The conversion is plain string building inside this tab and makes no network request, so it works offline and your JSON is never uploaded. The output is offered as a .ts download when you want to save it, alongside the code view in the workbench.

Questions

How are nested types named?

Each nested object gets a PascalCase name built from its parent name plus the key, e.g. an "address" key under Root becomes RootAddress. Array element objects get an "Item" suffix.

What happens with null or mixed values?

A null value becomes the null type; an array holding several value types becomes a parenthesised union such as (number | string)[].

Are numbers split into int and float?

No. JSON has one number type, so every number becomes number.

See category