What does this tool do?
It parses a JSON object or array, infers the data types of its fields, and automatically generates valid TypeScript declarations (interfaces, types, or classes).
How does it handle nested JSON objects?
It recursively parses child objects and automatically extracts them into separate, unique interfaces linked by their parent keys.
What happens to array types?
The tool checks the items in the array. If all items share a single type, it generates a standard array type (e.g. string[]). If items have mixed types, it creates a union type array.
Can I make all interface properties optional?
Yes. Toggle the 'Make Properties Optional' option to append a question mark (?) after all generated keys.
Why does it show a JSON syntax error?
The input must be a valid JSON string. Ensure keys are double-quoted, commas are placed correctly, and there are no trailing commas.
Is my API payload data secure?
Yes. All JSON parsing and TypeScript string compilations occur entirely in your browser. No data is sent to external servers.
How are null or empty array values typed?
If a property value is null, the tool infers it as `any` or `null`. For empty arrays `[]`, it defaults to `any[]` since there is no item data to determine the specific element type.
How does the tool choose interface names for nested objects?
It sanitizes the object key (e.g. converting `user_profile` to PascalCase `UserProfile`) and verifies it doesn't collide with existing interface names, appending a numeric suffix if needed to maintain uniqueness.
Can it convert a JSON array as the root input?
Yes. If the root input is a JSON array, the tool parses the first item's schema to build the type interface and labels the root output type as an array of that interface (e.g., `type RootObject = RootInterface[]`).
Does it support custom classes with constructor methods?
The class export option generates ES6 class structures with declared fields. It compiles clean type-safe structures that you can copy and decorate with your custom constructor or helper methods.