Nifty Paste JSON as Code
Turn JSON on your clipboard into types for TypeScript, C#, Go, Rust, Python, Java, Kotlin, Swift, Dart and more.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features



- Paste JSON as Code (
Ctrl+Alt+V, or Cmd+Alt+V on Mac). Copy an API response, press the shortcut in a .ts, .cs, .go or other file, and get matching types at the cursor, in that file's language and indentation. In Go files, needed imports go into the file's import block.
- Open JSON as Code. In a JSON file (or with some JSON selected), right-click and pick any language; the types open beside it.
- 16 targets: TypeScript, TypeScript + Zod, C#, Go, Rust, Python, Java, Kotlin, Swift, Dart, PHP, Ruby, C++, Elm, Flow and JSON Schema.
- Smart inference. Nested objects become their own types, arrays are merged, optional fields, dates and maps are detected.
- Plain types by default. Turn off
nifty.paste-json.justTypes to also get JSON (de)serialisation helpers.
- Offline. Everything runs locally with the open-source quicktype engine.
- Works in the browser on vscode.dev and github.dev.
Commands
| Command |
Key |
What it does |
Nifty: Paste JSON as Code |
Ctrl+Alt+V |
Paste clipboard JSON as types in the current file's language |
Nifty: Open JSON as Code… |
|
Generate from the JSON file, selection or clipboard in any language |
Settings
| Setting |
Default |
What it does |
nifty.paste-json.justTypes |
true |
Plain types only (no serialisation helpers) |
nifty.paste-json.askForName |
true |
Ask for the top-level type name |
Install
- VS Code: search for "Nifty Paste JSON as Code" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Credits
Code generation by quicktype (Apache-2.0).
Privacy
This extension collects no telemetry, needs no account and makes no network requests.
- Nifty C# Templates: New Class, Record & Namespace: New C# class, interface, record, enum, test and controller files with the right namespace, plus namespace syncing. (Open VSX)
- Nifty Mermaid: Mermaid Diagram Preview & Export: Mermaid diagrams with no account: live preview beside .mmd files and Markdown, diagrams in the Markdown preview, syntax highlighting, and export to SVG or PNG. (Open VSX)
- Nifty Data Viewer: CSV & Parquet Viewer with SQL: Open CSV, Parquet and JSON files as a fast table and query them with SQL, powered by DuckDB. Sort, page through millions of rows, and export to CSV, Parquet or JSON. (Open VSX)
- Nifty JSON: Formatter, Validator & JSONPath: Format, minify, sort keys, query with JSONPath, copy paths, generate TypeScript types, and browse huge JSON files in a fast tree view. (Open VSX)
- Nifty REST Client: .http Files & HTTP Requests: Send HTTP requests from .http files: variables, environments, request chaining, response viewer, cURL import and export, and history. No account, no cloud. (Open VSX)
- Nifty SQL: SQL Formatter for 20 Dialects: Format SQL in 20 dialects, including dbt and Jinja templates, with your team's settings. (Open VSX)
See all 18 Nifty tools at https://getnifty.dev
| |