Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>JSON to Types - Convert JSON to TypeScript/Python/GoNew to Visual Studio Code? Get it now.
JSON to Types - Convert JSON to TypeScript/Python/Go

JSON to Types - Convert JSON to TypeScript/Python/Go

miccho27

| (0) | Free
Convert JSON to TypeScript interfaces, Python dataclasses, Go structs, Rust structs, or Zod schemas. Paste JSON, get types instantly. No API key needed.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JSON to Types

Convert JSON to TypeScript interfaces, Python dataclasses, Go structs, Rust structs, or Zod schemas. Select JSON, pick a language, get types instantly.

VS Code Marketplace License: MIT

Features

5 Output Languages

  • TypeScript - export interface with proper types
  • Python - @dataclass with type hints
  • Go - struct with JSON tags
  • Rust - struct with serde derive macros
  • Zod - Schema with z.infer type extraction

Smart Type Inference

  • Detects string, number, boolean, null automatically
  • Distinguishes integers from floats
  • Handles nested objects as separate named types
  • Processes arrays with element type inference

Multiple Workflows

  • Select JSON in editor and run the command (Ctrl+Shift+J)
  • Right-click context menu on selected JSON
  • Convert from clipboard - paste JSON from any source

Nested Object Support

Complex nested JSON produces multiple separate types, each properly named from the key.

Example

Input JSON:

{
  "id": 1,
  "name": "Alice",
  "email": "alice@example.com",
  "address": {
    "street": "123 Main St",
    "city": "Springfield"
  },
  "tags": ["admin", "user"]
}

TypeScript Output:

export interface Address {
  street: string;
  city: string;
}

export interface Root {
  id: number;
  name: string;
  email: string;
  address: Address;
  tags: string[];
}

Commands

Command Keybinding Description
JSON to Types: Convert Selection Ctrl+Shift+J Convert selected JSON
JSON to Types: Convert from Clipboard - Convert JSON from clipboard

Settings

Setting Default Description
jsonToTypes.defaultLanguage typescript Default output language
jsonToTypes.rootName Root Name of the root type
jsonToTypes.optionalFields false Mark all fields optional (TS)
jsonToTypes.exportInterfaces true Add export keyword (TS)

Use Cases

  • API Development: Paste API response JSON, get typed interfaces instantly
  • Database Modeling: Convert JSON documents to typed structs
  • Code Generation: Rapid prototyping with type-safe models
  • Learning: See how JSON maps to types in different languages

Installation

code --install-extension miccho27.json-to-types

Or search "JSON to Types" in the VS Code Extensions panel.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft