Home / Tools / Data and formats
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
Runs in your browserFree, no sign-upOpens .json
Loading tool…
How to use it
- Paste a JSON sample or open a file.
- Set the name of the root interface.
- Copy the interfaces into your project.
About this tool
Paste a real API response and get interfaces for every nested object, with arrays typed from their items. Keys that are not valid identifiers are quoted. A quick way to type a third-party API before you write the client.
Your input is processed on your device. Nothing is sent to a server or stored.
Questions
How are null values typed?
A null value becomes `unknown | null`, because the sample does not say what the real type is. Edit it by hand once you know.
Data and formats
All data and formatsMore tools like this
Data and formatsJSON Formatter & ValidatorFormat, validate, minify, stringify and parse JSON.Opens filesOpen →Data and formatsXML to JSON ConverterConvert XML to JSON and JSON back to XML.Opens filesOpen →Data and formatsCSV to JSON ConverterTurn CSV or TSV into JSON and JSON arrays into CSV.Opens filesOpen →Data and formatsYAML to JSON ConverterConvert YAML to JSON and JSON to YAML.Opens filesOpen →Data and formatsSQL FormatterFormat messy SQL into readable, indented queries.Opens filesOpen →Data and formatsHTML Beautifier & MinifierIndent minified HTML or minify it for production.Opens filesOpen →Data and formatsMarkdown Table GeneratorTurn CSV or spreadsheet cells into a Markdown table.Opens filesOpen →Data and formatsQuery String to JSONTurn URL parameters into JSON and JSON into a query string.Open →