JSON to TypeScript Converter

Paste JSON and instantly generate clean TypeScript interfaces with support for nested objects, arrays, and optional properties.

JSON Input

TypeScript Output

// Paste JSON on the left and click "Convert"
0
Interfaces
0
Properties
0
Nested Types
0
Lines

Conversion History

No conversions yet

JSON to TypeScript Type Mapping

stringstring
number (int)number
number (float)number
booleanboolean
nullnull
arrayT[]
objectinterface
mixed array(A | B)[]
empty arrayunknown[]
nested objectNestedInterface

Tips & Best Practices

Use interface for object shapes that may be extended; use type for unions, intersections, or computed types.
Enable readonly for immutable data structures like API responses to prevent accidental mutations.
Use optional properties when some fields may not be present in every response variant.
Name your root interface after the API endpoint or domain concept (e.g., UserProfile, OrderResponse).
For arrays of objects, the converter automatically creates a separate interface with Item suffix.
Properties with special characters are automatically quoted (e.g., 'content-type').

More Free Tools