UUID v5 Generator
Generate deterministic UUIDs from a namespace and a name.
Generate TypeScript interfaces from a sample JSON payload.
The JSON to TypeScript converter generates interfaces from a sample payload: a named interface per nested object, element types for arrays, optional markers for keys that are not always present, and unions with null where nulls appear.
Paste an API response and get the interfaces for it. Every nested object becomes its own named interface, arrays are typed by their element, and a field missing from some elements of an array is marked optional with a question mark.
The inference merges rather than guessing from the first item. An array whose objects differ slightly produces one interface covering all of them, with the sometimes-present keys optional and a widened type where an integer and a decimal both appear. Nulls become a union with null rather than being silently dropped. You can emit interfaces or type aliases, name the root type, and make every field optional in one click for the partial-update shapes a PATCH endpoint takes.
An array of slightly different objects produces one interface covering all of them, rather than a type built from the first item alone.
A key missing from some records gets a question mark, so your compiler forces you to handle its absence.
A field that is sometimes null is typed string | null rather than any, which keeps strict null checking useful.
Emit whichever your codebase uses; interfaces are extensible, type aliases compose more freely.
Make every field optional in one click for the partial shapes a PATCH endpoint accepts.
A real API response gives the best result; an array of records is ideal.
Set the name for the top-level interface — the nested ones are named from their keys.
Interfaces are extensible; type aliases compose more freely. Pick what your codebase uses.
Paste the result into a .ts file, or download it directly.
When the sample is an array of objects and a key is missing from at least one of them. From a single object it cannot tell, so pass a representative array whenever you can.
The field is typed as a union with null, for example string | null. That is more honest than typing it as any, and it makes the strict null checks in your compiler do their job.
TypeScript has no integer type — every JavaScript number is a double. number is the correct and only choice.
No, as string, because that is what is actually in the JSON. JSON has no date type, so the conversion to a Date object belongs in your parsing layer rather than in the type.
What people who use the JSON to TypeScript think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON to TypeScript. It takes half a minute and no account.
Write the first reviewGenerate deterministic UUIDs from a namespace and a name.
Measure text in UTF-8 bytes, code points, UTF-16 units and graphemes.
Strip whitespace and optionally comments from XML, and see the bytes saved.
Work out a subnet: network, broadcast, host range and usable count.
Draft a GraphQL type definition from a sample JSON response.
Your browser, engine, platform, languages and what it supports.
Generate prefixed API keys in the format modern providers use.
Convert XML into clean JSON, with attributes and text handled predictably.