Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>JSON OpticsNew to Visual Studio Code? Get it now.
JSON Optics

JSON Optics

Shreyank Snehal

|
2 installs
| (0) | Free
Inspect, navigate, and repair JSON right in the editor — tree and table views, jump-to-source, and a repair workspace for broken or LLM-generated JSON.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JSON Optics

Version License: MIT VS Code

JSON Optics is a fast, theme-adaptive Visual Studio Code extension for visualizing, navigating, and repairing JSON — including malformed outputs from LLMs (ChatGPT, Claude), copy-pasted object literals, or complex configuration files — without leaving your editor.

Instead of copy-pasting sensitive payload data into external web tools, JSON Optics gives you an interactive Tree View, a sortable Table View, precision Jump-to-Source navigation, and a dedicated Side-by-Side Repair Workspace.


⚡ Instant Visualization in Action

JSON Optics Walkthrough


🚀 Quick Start

Trigger Method Steps
Method A: Lightbulb (Recommended) Place cursor on { or [ $\rightarrow$ Click the margin lightbulb (or press Ctrl + . / Cmd + .) $\rightarrow$ Select "See through JSON Optics".
Method B: Shortcut Select code segment $\rightarrow$ Press Ctrl + Alt + J (Cmd + Alt + J on macOS).
Method C: Context Menu Right-click any selection $\rightarrow$ Select "See through JSON Optics".

🌟 Key Features

1. 🔍 Virtualized Tree & Table Views

  • Interactive Tree View: Browse deeply nested structures smoothly using virtual scrolling. Search keys/values in real-time or copy JSONPath references ($.users[0].address.city) with a single click.
  • Dynamic Table View: Automatically triggered when root-level data is an array of objects. Sort columns, filter across all fields, page through rows, and inspect nested cells.

2. 💡 Inline "Visualize" Lightbulb

  • Detects JSON-like blocks without a full parser pass, so it stays fast even in large files.
  • Put your cursor on a { or [ in a JSON, JavaScript, TypeScript, or Python file and press Ctrl + . / Cmd + . for a "See through JSON Optics" action.

3. 🛠️ Repair Workspace (LLM & Syntax Fixer)

Fix common structural errors automatically with real-time differential highlights (+ / -):

  • LLM Markdown Fences: Strips enclosing ```json blocks directly from AI responses.
  • Unquoted Keys: Automatically quotes identifiers including hyphens, underscores, dots, $, and @ ({ user-id: 101 } → { "user-id": 101 }).
  • Quote Normalization: Converts single quotes to double quotes while escaping internal literals.
  • Python Types & Comments: Converts True → true, False → false, None → null, and strips #, //, or /* */ comments.
  • Structural Seals: Fixes trailing commas, missing commas, and auto-closes truncated/cut-off JSON streams.

JSON Optics Repair Walkthrough

4. 🎯 Precision Jump-to-Source Navigation

  • Click the eye icon next to any property node in the Tree or Table view to highlight and jump directly to its exact line coordinate in your source document.

📊 What Gets Repaired

Problem Type Input Example Repaired Output
Unquoted keys & Python types { user-id: 101, is_active: True } { "user-id": 101, "is_active": true }
Single quotes {'title': 'He said "Hello"'} {"title": "He said \"Hello\""}
Python literals & comments {"status": None} # inline comment {"status": null}
Trailing commas {"items": [1, 2, 3,],} {"items": [1, 2, 3]}
LLM Markdown fences ```json\n{"data": 1}\n``` {"data": 1}
Variable assignments const config = { "port": 8080 }; {"port": 8080}
Truncated streams {"user": {"name": "Alex" {"user": {"name": "Alex"}}

⌨️ Commands & Keybindings

Command Keybinding Context
JSON Optics: See through JSON Optics Ctrl + Alt + J (Cmd + Alt + J) Active text selection
See through JSON Optics Ctrl + . (Cmd + .) Cursor on object/array boundary

🎨 Theme Synchronization

JSON Optics seamlessly integrates with VS Code native CSS variables, adapting dynamically across Light, Dark, and High Contrast themes without fixed colors.


⚡ Performance & Safety

  • Fast Startup: Bundled with esbuild with zero runtime dependencies beyond jsonc-parser.
  • Large File Protection: Diffing calculations are gracefully bypassed for files over 50,000 characters to protect UI responsiveness, while full Tree/Table rendering remains supported.

📄 License

Licensed under the MIT License.

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