快捷工具

JSON to TypeScript Interface

Convert JSON to TypeScript interfaces or types.

json to typescripttypescript interface generatorjson to ts

拖拽到此处或

Supports JSON files

隐私: 此工具完全在您的浏览器中运行。数据不会发送到我们的服务器。我们不存储、分享或访问您在此处理的任何信息。

Examples

Example 1
{"name":"John","age":30,"active":true}
Click above to load example 1
Example 2
{"items":[{"id":1,"name":"Item 1"},{"id":2,"name":"Item 2"}]}
Click above to load example 2
Example 3
{"metadata":{"createdAt":"2024-01-01","tags":["tag1","tag2"]}}
Click above to load example 3

FAQ

Q: Does it generate interfaces or types?

A: You can choose between interface and type alias.

Q: Can I handle optional fields?

A: Yes, fields with null/undefined become optional.

Related Tools

More in Developer Tools

Privacy: This tool runs entirely in your browser. No data is sent to our servers.