loot.tools

JSON to Code

Paste a JSON object or array and get it back as typed structures in TypeScript, Go, Python, or C#, or as SQL CREATE TABLE and INSERT statements. Pick the target, set the type or table name, and copy the result. Nested objects become their own types, arrays are typed by their contents, and keys missing from some records become optional or nullable. Python adds a dataclass/Pydantic switch, C# adds System.Text.Json or Newtonsoft attributes, and SQL picks MySQL, PostgreSQL, or SQLite.

Paste JSON and get typed structures or SQL back. Pick a target, set the name, and copy the result. Nested objects become their own interfaces, arrays are typed.

JSON Input
TypeScript Output

What this tool does

Paste JSON and get ready-to-use types in the language you pick. Each nested object becomes its own named type, arrays are typed by their contents, and a value that's missing or null in some records becomes optional or nullable. Set the root type name to match your domain, then copy the result straight into your file.

Why you'd use this

Hand-writing types from an API response is slow and easy to get wrong, especially with deeply nested payloads. Drop the JSON here and get accurate TypeScript interfaces, Go structs, Python classes, or C# models in seconds. One tool covers all four instead of four separate pages.

Per-target options

TypeScript emits interfaces with unions for mixed arrays. Go emits a struct with json tags and capitalizes common initialisms like ID and URL. Python switches between standard-library dataclasses and Pydantic models. C# emits auto-properties with optional System.Text.Json or Newtonsoft attributes so your JSON keys still map when they don't match C# naming. SQL turns an array of objects into a CREATE TABLE plus INSERT statements, with column types guessed from your data and quoting that matches MySQL, PostgreSQL, or SQLite.