JSON zu TypeScript Generator

Wandle beliebiges JSON in saubere TypeScript-Interfaces oder Types um.

JSON-Eingabe

Knotendetails

Knoten auswählen, um Details anzuzeigen

Hauptfunktionen

Smart Shape Merging

Elements of heterogeneous arrays merge into one interface; fields missing from some elements become optional with ?

Union Types

Fields holding mixed string/number/null values collapse into precise union types like string | null.

interface or type

Switch between interface and type alias output with one checkbox — root name is fully customizable.

Editable Source

Tweak the JSON in the Tree or Table view and the generated TypeScript updates instantly.

So verwenden Sie JSON zu TypeScript Generator

1

Paste Your JSON

Insert an API response or any JSON document into the input panel.

2

Review the Output

The TypeScript interface appears in the dedicated TS tab — adjust the root name or switch to a type alias.

3

Copy or Download

Copy the definitions to your clipboard or download them as a ready-to-use types.d.ts file.

Technischer Architektur- & Datenschutz-Vergleich

Wie sich formatjson.net von herkömmlichen serverbasierten JSON-Tools unterscheidet

100% Lokale Browser-Ausführung Kein Server-Upload RFC 8259 & RFC 4180 Konform 64-Bit-Integer Sicher JSON Schema 2020-12 Offline-fähige PWA
Funktion / Standard formatjson.net (100% Client-Side Workbench) Klassische Server-basierte Tools
Datenverarbeitung & Datenschutz 100% lokal im Browser per JavaScript — Daten verlassen niemals Ihr Gerät Laden JSON/XML/CSV häufig auf externe Server hoch
API-Schlüssel, JWTs & Vertrauliche Daten Sicher durch Design — keine Netzwerkübertragung, funktioniert offline per Service Worker Risiko von Server-Logs oder Drittanbieter-Speicherung
Reparatur defekter & abgeschnittener LLM-JSONs 1-Klick-Zustandsautomat repariert Kommentare, einfache Anführungszeichen, Trailing Commas & offene Klammern Bricht bei nicht-striktem JSON mit Syntaxfehler ab
64-Bit Snowflake-IDs & Führende Nullen Bewahrt große Ganzzahlen (> 2^53 - 1) und Codes wie "00123" ohne Präzisionsverlust Schneidet 64-Bit-IDs ab oder entfernt führende Nullen
Verschachtelte Arrays als Tabelle Interaktiver Drill-down ([n items] →) mit Breadcrumbs, Spaltensortierung & Inline-Bearbeitung Nur flache Root-Tabellen oder schreibgeschützte Bäume
Performance bei großen Dateien Chunked Lazy-Tree (200 Knoten/Batch) + paginierte Tabelle + 150-KB-Highlight-Schutz Browser-Freeze bei mehreren Megabyte großen Dateien

Häufig gestellte Fragen

How are optional properties detected? ▾

When an array contains objects where a key is missing in some elements, that key is emitted with a ? marker.

Does it handle nested objects? ▾

Yes. Nested objects are rendered as inline object type literals, and arrays of objects merge into a single element type.

interface vs type — which should I use? ▾

interface supports declaration merging; type aliases are more flexible for unions. The tool outputs either with one click.

Are null fields handled? ▾

A field observed as both string and null becomes a union type string | null, never silently dropped.

Is my JSON sent to a server? ▾

No. Type inference runs entirely in your browser — perfect for private API payloads.