YAML ↔ JSON Converter
转换模式
输入 YAML
Instructions
- Select conversion mode: "YAML → JSON" or "JSON → YAML"
- Paste or enter data in the input box
- The tool will automatically convert and display results in real-time
- Click "Copy" button to copy the result to clipboard
- Click "Sample" button to load sample data
- Click "Clear" button to clear input and output
Features
- Bidirectional Conversion: Supports both YAML to JSON and JSON to YAML
- Real-time Conversion: Automatically converts as you type
- Multi-document Support: Supports multi-document YAML (separated by
---) - Syntax Highlighting: Output results with syntax highlighting for easy reading
- Error Messages: Displays detailed error messages for invalid input
- Local Processing: All data is processed locally in your browser for privacy
Examples
YAML Input
server:
host: localhost
port: 8080
database:
name: myapp
users:
- name: admin
role: administrator
- name: guest
role: viewer
JSON Output
{
"server": {
"host": "localhost",
"port": 8080
},
"database": {
"name": "myapp",
"users": [
{ "name": "admin", "role": "administrator" },
{ "name": "guest", "role": "viewer" }
]
}
}