Loadingโฆ
Loadingโฆ
Paste JSON and get TypeScript interfaces or type aliases, with nested objects named for you, optional and nullable fields detected from every array item, and union types.
Also covers: JSON to TS interface ยท JSON to TypeScript type ยท Generate TypeScript types from JSON
TypeScript types appear here as you type. Paste JSON, or click Sample.
An API response, a config file, or an array of records. Drop a .json file or click Sample to try it.
Name the root type, choose interface or type alias, and toggle export and readonly.
Nested objects get their own named types, and identical shapes are declared once. Copy or download types.ts.
Every item in an array is merged into one shape. A key missing from some items becomes optional (name?: string), and a key that is sometimes null gets | null.
From their keys in PascalCase: an address object becomes Address, and an array called lines becomes Line[] (the key in singular form). Identical shapes reuse one type.
Both describe object shapes equally well. Interfaces can be extended and merged; type aliases can also describe unions. Pick whichever your codebase uses.
No. Everything is generated in your browser, and nothing you paste is sent to a server.
Data
Format, validate, and minify JSON in your browser. Paste it, upload a file, or load it from a URL. Errors show the exact line and column.
C# / .NET
Paste JSON and get C# model classes or records, ready for System.Text.Json or Newtonsoft.Json. Nested objects, arrays, nullable types, dates, and GUIDs are inferred for you.
SQL
Turn a JSON array into a CREATE TABLE with inferred column types and batched INSERT statements for PostgreSQL, MySQL, SQL Server, or SQLite.
SQL
Format and beautify SQL queries for SQL Server (T-SQL), PostgreSQL, MySQL, Oracle, and more. Set the indentation, keyword case, and layout, and get the exact line of any syntax error.
Data
Format, validate, and minify XML (config files, .csproj, SOAP, RSS) in your browser. Entities, CDATA, and mixed content are kept exactly as written, and errors show the line and column.
Data
Format and validate YAML (docker-compose, Kubernetes, GitHub Actions) without losing comments, or convert YAML to JSON. Errors show the exact line and column.