Skip to main content

YAML ↔ JSON Converter

转换模式

输入 YAML

Instructions

  1. Select conversion mode: "YAML → JSON" or "JSON → YAML"
  2. Paste or enter data in the input box
  3. The tool will automatically convert and display results in real-time
  4. Click "Copy" button to copy the result to clipboard
  5. Click "Sample" button to load sample data
  6. 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" }
]
}
}