JSON Parser
This VS Code extension provides a comprehensive set of tools for working with JSON data in your editor. It supports various JSON operations including conversion, formatting, validation, and more.
Features
- Convert Document: Convert the entire JSON string in the active document to a JSON object.
- Convert Selection: Convert a selected JSON string in the active document to a JSON object.
- Prettify JSON: Format JSON with proper indentation and line breaks.
- Minify JSON: Compress JSON to a single line format.
- Sort Keys: Sort object keys alphabetically (recursively for nested objects).
- Validate JSON: Check if JSON syntax is valid and show detailed error messages.
Usage
Command Palette
- Open the command palette with
Ctrl+Shift+P
(Windows/Linux) or Cmd+Shift+P
(macOS).
- Type
JSON Parser
and select the desired command:
Convert Document
or Convert Selection
Prettify JSON
- Format JSON with proper indentation
Minify JSON
- Compress JSON to single line
Sort Keys
- Sort all object keys alphabetically
Validate JSON
- Check JSON syntax validity

- Right-click in the editor to open the context menu.
- Navigate to the
JSON Parser
submenu.
- Select your desired operation.

Keyboard Shortcuts
Ctrl+Alt+P
(Cmd+Alt+P
on macOS): Prettify JSON
Ctrl+Alt+M
(Cmd+Alt+M
on macOS): Minify JSON
Ctrl+Alt+S
(Cmd+Alt+S
on macOS): Sort Keys
Ctrl+Alt+V
(Cmd+Alt+V
on macOS): Validate JSON
How it Works
All operations work on either:
- Entire Document: When no text is selected, operations apply to the whole file
- Selection: When text is selected, operations apply only to the selected portion
The extension automatically detects JSON strings (quoted) vs JSON objects and handles both appropriately.
Installation
Install this extension from the Visual Studio Code Marketplace or by searching for "JSON Parser" in the VS Code Extensions view.
Requirements
- VS Code version 1.89.0 or higher.
Extension Settings
This extension contributes the following commands:
json-parser.convertJSON
: Convert the entire document from JSON string to JSON object.
json-parser.convertSelectedJSON
: Convert the selected text from JSON string to JSON object.
json-parser.prettifyJSON
: Format JSON with proper indentation (2 spaces).
json-parser.minifyJSON
: Compress JSON to a single line.
json-parser.sortKeys
: Sort object keys alphabetically (recursive for nested objects).
json-parser.validateJSON
: Validate JSON syntax and show error details.
Keyboard Shortcuts
Command |
Windows/Linux |
macOS |
Prettify JSON |
Ctrl+Alt+P |
Cmd+Alt+P |
Minify JSON |
Ctrl+Alt+M |
Cmd+Alt+M |
Sort Keys |
Ctrl+Alt+S |
Cmd+Alt+S |
Validate JSON |
Ctrl+Alt+V |
Cmd+Alt+V |
Known Issues
Currently, there are no known issues.
Release Notes
0.1.0
Major feature update with enhanced JSON tools:
- ✨ Added Prettify JSON with proper formatting
- 🗜️ Added Minify JSON for compression
- 🔤 Added Sort Keys functionality (recursive)
- ✅ Added JSON Validation with detailed error reporting
- ⌨️ Added convenient keyboard shortcuts
- 🎯 Enhanced context menu with all features
- 📝 Improved error messages and user feedback
0.0.1
Initial release of JSON Parser.
Support
If you find this extension helpful, consider supporting me by buying me a coffee!

License
This extension is licensed under the MIT License.