JSON to TypeScript
Generate TypeScript interfaces from JSON samples, including nested objects and arrays.
About the JSON to TypeScript
The JSON to TypeScript converter generates interfaces (or type aliases) from a sample response, including nested objects and arrays, so you can type API data without writing it by hand.
Conversion happens in your browser, so your files and records stay private.
How to use the JSON to TypeScript
- Paste a representative JSON sample.
- Set the root type name and choose interface or type.
- Copy the generated types into your project.
Frequently asked questions
How are optional fields detected?
When an array contains objects with different keys, keys missing from some items are marked optional.
Should I trust generated types?
They describe the sample you pasted. Check them against your API documentation, especially for nullable fields.
Related tools
JSON to CSV
Convert JSON arrays to CSV with automatic column detection, nested object flattening and custom delimiters.
CSV to JSON
Convert CSV to a JSON array with header detection, type inference and delimiter auto-detection.
JSON to XML
Convert JSON to well-formed XML with a configurable root element and attribute support.
XML to JSON
Convert XML to JSON, preserving attributes and repeated elements as arrays.
JSON to YAML
Convert JSON to clean, human-readable YAML.
YAML to JSON
Convert YAML documents to formatted JSON with syntax validation.