JSON Input Area
TypeScript Interface/Type Definition

TypeScript Conversion Guide & Type Info

Tool Features

  • Interface vs Type: You can choose to generate an interface or a type alias according to your project specifications. Both are generally interchangeable when describing object structures in most scenarios.
  • Export Declaration: When checked, export is automatically added to all generated definitions, making it easy to export directly as a module in .ts or .d.ts files.
  • Readonly Properties: When enabled, the readonly modifier is prepended to all object properties, which is very useful for immutable data flows in state management libraries like Redux/Vuex.
  • Smart Property Names: When a JSON key contains a hyphen (e.g., first-name) or starts with a number, the tool automatically wraps it in double quotes to ensure the generated TS code syntax is valid.

Type Mapping Rules

  • Stringstring
  • Numbernumber
  • Booleanboolean
  • ArrayType[] or any[]
  • Null / Undefinedany (Used when precise types cannot be inferred)