JSON is strict data interchange; YAML adds comments and compact indentation.
# YAML name: Alice active: true # JSON {"name": "Alice", "active": true}
Choose JSON for APIs and strict validation, YAML for human-edited configuration.