Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Nifty JSON: Formatter, Validator & JSONPathNew to Visual Studio Code? Get it now.
Nifty JSON: Formatter, Validator & JSONPath

Nifty JSON: Formatter, Validator & JSONPath

Nifty

|
2 installs
| (0) | Free
Format, minify, sort keys, query with JSONPath, copy paths, generate TypeScript types, and browse huge JSON files in a fast tree view.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nifty JSON

Format, minify, sort keys, query with JSONPath, copy paths, generate TypeScript types, and browse huge JSON files in a fast tree view. One maintained extension instead of five abandoned ones.

Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.

Features

Querying an API response with JSONPath: the names of active users open beside it

TypeScript interfaces generated from a JSON sample

  • Format without surprises. Pretty-prints the document or just the selection, and keeps comments, key order and number literals (1.0, 12345678901234567890) exactly as written. Works on JSON and JSONC.
  • Minify. Strips whitespace and comments in one step.
  • Sort Keys. Sorts every object recursively in natural order (k2 before k10), ascending or descending.
  • Copy Path at Cursor. Puts the path of the key under the cursor on the clipboard as JSONPath ($.users[0].name), jq (.users[0].name) or JavaScript (users[0].name).
  • Query with JSONPath. Filter and extract data, e.g. $.items[*].name or $..book[?(@.price < 10)]. Results open beside your file. Filters run in a safe evaluator, never as arbitrary code.
  • Generate TypeScript Types. Turns sample data into interfaces. Array items are merged, so keys that only some items have become optional.
  • Escape / Unescape. Converts a selection to or from a JSON string literal, which is handy for JSON embedded in JSON.
  • Tree View for large files. Opens JSON files that are too big for the editor (up to 512 MB by default) and loads children only when you expand them. Hover any node to copy its path or value. Right-click a .json file in the Explorer to open it straight in the tree.

Find everything under Nifty JSON in the Command Palette, or in the editor's right-click menu.

Commands

Command What it does
Nifty JSON: Format Document or Selection Pretty-print, keeping comments and literals
Nifty JSON: Minify Remove whitespace and comments
Nifty JSON: Sort Keys Sort object keys recursively
Nifty JSON: Copy Path at Cursor Copy the path of the key under the cursor
Nifty JSON: Query with JSONPath Run a JSONPath query and open the results
Nifty JSON: Generate TypeScript Types Create interfaces from the data
Nifty JSON: Escape Selection as JSON String Wrap and escape the selected text
Nifty JSON: Unescape JSON String Turn a JSON string literal back into text
Nifty JSON: Open Tree View (Large Files) Browse the current or a picked file as a lazy tree

Settings

Setting Default What it does
nifty.json.indent auto Indentation: the editor's setting, 2, 4, 8 or tab
nifty.json.sort.order asc Sort Keys order: asc or desc
nifty.json.sort.caseSensitive false Treat upper and lower case as different when sorting
nifty.json.pathFormat jsonpath Copy Path style: jsonpath, jq or javascript
nifty.json.types.rootName Root Name of the top-level generated type
nifty.json.tree.pageSize 200 Children loaded at a time in the tree view
nifty.json.tree.maxFileSizeMB 512 Largest file the tree view will open

Install

  • VS Code: search for "Nifty JSON" in the Extensions view, or install from the Visual Studio Marketplace.
  • Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.

Privacy

This extension collects no telemetry, needs no account and makes no network requests.

More Nifty tools: https://getnifty.dev

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft