A lightweight Visual Studio Code extension that instantly beautifies and formats JSON files with proper indentation.
Features
- Format JSON with a single command
- Access from the Command Palette
- Format JSON directly from the editor context menu
- Keyboard shortcut support (
Ctrl + Alt + J) - Validates JSON before formatting
- Fast and lightweight
Installation
From the Visual Studio Marketplace
Search for JSON Formatter in the Extensions Marketplace.
or
Install from a VSIX
- Open VS Code
- Open Extensions (
Ctrl + Shift + X) - Click the ... menu
- Select Install from VSIX...
- Choose the downloaded
.vsixfile
Usage
Command Palette
- Open a JSON file.
- Press
Ctrl + Shift + P. - Search for:
Format JSON
- Press Enter.
Right Click
Open a JSON file.
Right click inside the editor.
Select
Format JSON
Keyboard Shortcut
Ctrl + Alt + J
(macOS)
Cmd + Option + J
Example
Before
{"name":"Likitha","age":20,"skills":["Java","Spring Boot"]}
After
{
"name": "Likitha",
"age": 20,
"skills": [
"Java",
"Spring Boot"
]
}
Error Handling
If the JSON is invalid, the extension displays an error message instead of modifying the file.
Example:
Invalid JSON.
Requirements
- Visual Studio Code 1.125.0 or later
Repository
GitHub Repository
https://github.com/LikithaCSuguna/JSON-Formatter
Contributing
Contributions are welcome.
If you'd like to improve this extension:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a Pull Request
Reporting Issues
Found a bug?
Please create an issue here:
https://github.com/LikithaCSuguna/JSON-Formatter/issues
License
This project is licensed under the MIT License.
See the LICENSE file for details.
Author
Likitha Chendrimada Suguna
GitHub