Skip to main content

TypeScript to JSON Converter

Generate sample JSON data from TypeScript interfaces instantly.
Paste your types and get mock data for testing.

Error: No interfaces or types found. Make sure your input contains valid TypeScript interface or type definitions.

How it works

Placeholder Values

Generates sensible placeholder values: string → "string", number → 0, boolean → true

Nested Types

Handles nested objects and references to other interfaces. All nested structures are recursively converted to JSON.

Union Types

For union types like string | null, uses the first non-null type to generate the value.

Supported Types

stringnumberbooleannullstring[]Array<T>nested objectsoptional (?)union (|)interface references