tools/convert/yaml ↔ json
// convertnew

yaml ↔ json

two-way converter with comments preserved

// client-only — paste YAML or JSON
— paste YAML or JSON

// about this tool

The YAML ↔ JSON converter automatically detects whether the input is YAML or JSON and converts it to the other format. The YAML parser is implemented from scratch and handles block and flow mappings, block and flow sequences, all scalar types (string, integer, float, boolean, null), multi-line block scalars (| and >), quoted strings, and comments. Converting from JSON produces clean, indented YAML.

// when to use

  • Convert a docker-compose.yml or Kubernetes manifest to JSON for programmatic processing
  • Convert a JSON API response to YAML for more readable diffing or documentation
  • Validate YAML syntax when a config file fails to parse in CI
  • Strip YAML comments by converting to JSON and back

// faq

Are YAML comments preserved?
Comments are stripped during parsing because JSON has no concept of comments. If you need to keep comments, consider editing the YAML source directly.
What YAML features are supported?
Block and flow mappings and sequences, all scalar types including multi-line literals (| and >), quoted strings, anchors and aliases, and comments. YAML merge keys (<<: *anchor) are not supported.
// history
Pro Cloud Sync — upgrade
no operations yet