Convert between JSON, XML, and YAML formats directly in VS Code with a single keyboard shortcut.

Features
- 🔄 Quick Convert - Press
Ctrl+Shift+C to convert between formats instantly
- 🎯 Smart Detection - Automatically detects source format from content
- ✂️ Selection Support - Convert selected text or entire document
- 📋 Multiple Output Options - Replace in-place, open in new file, or copy to clipboard
- 🖱️ Context Menu - Right-click to convert selected text
- JSON ↔ XML
- JSON ↔ YAML
- XML ↔ YAML
Usage
Method 1: Keyboard Shortcut (Recommended)
- Open a JSON, XML, or YAML file
- Press
Ctrl+Shift+C (or Cmd+Shift+C on Mac)
- Confirm or select the source format
- Select the target format
- Choose output action (Replace, New File, or Copy)
Method 2: Command Palette
- Press
Ctrl+Shift+P to open Command Palette
- Type "Data Format Converter" to see all available commands:
Data Format Converter: Convert - Interactive conversion
Data Format Converter: JSON → XML
Data Format Converter: JSON → YAML
Data Format Converter: XML → JSON
Data Format Converter: XML → YAML
Data Format Converter: YAML → JSON
Data Format Converter: YAML → XML
- Select the text you want to convert
- Right-click to open context menu
- Click "Data Format Converter: Convert Selection"
Method 4: Convert Selection
- Select a portion of text in your editor
- Use any of the above methods
- Only the selected text will be converted
Examples
Convert JSON to YAML
Before (JSON):
{
"database": {
"host": "localhost",
"port": 5432
}
}
After (YAML):
database:
host: localhost
port: 5432
Convert XML to JSON
Before (XML):
<user id="123">
<name>John Doe</name>
<email>john@example.com</email>
</user>
After (JSON):
{
"user": {
"@id": "123",
"name": "John Doe",
"email": "john@example.com"
}
}
Commands
| Command |
Description |
Keybinding |
Data Format Converter: Convert |
Interactive format conversion |
Ctrl+Shift+C |
Data Format Converter: Convert Selection |
Convert selected text |
- |
Data Format Converter: JSON → XML |
Convert JSON to XML |
- |
Data Format Converter: JSON → YAML |
Convert JSON to YAML |
- |
Data Format Converter: XML → JSON |
Convert XML to JSON |
- |
Data Format Converter: XML → YAML |
Convert XML to YAML |
- |
Data Format Converter: YAML → JSON |
Convert YAML to JSON |
- |
Data Format Converter: YAML → XML |
Convert YAML to XML |
- |
Output Options
After conversion, you can choose what to do with the result:
- Replace - Replace the current content with converted output
- New File - Open the converted content in a new editor tab
- Copy to Clipboard - Copy the converted content to clipboard
Requirements
Extension Settings
This extension currently has no configurable settings.
Known Issues
None at this time.
Release Notes
1.0.0
- Initial release
- Support for JSON, XML, and YAML conversions
- Interactive and direct conversion commands
- Context menu integration
- Keyboard shortcut support
Author
Naman Khater
Powered By
This extension is powered by @naman22khater/data-converter - a universal data format converter with central engine architecture.
License
MIT