thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Commonly confused · DevOps & Automation

JSON vs YAML vs XML: What's the Difference?

All three are text formats for structured data. JSON uses braces and brackets and dominates REST APIs, YAML uses indentation and is popular for human-edited configuration such as Ansible and Kubernetes, and XML uses opening and closing tags and underpins NETCONF and older SOAP services.

JSONYAMLXML
SyntaxBraces {}, brackets [], key: value pairs in quotesIndentation and dashes for listsNested <tag></tag> elements
CommentsNot supportedSupported with #Supported with <!-- -->
ReadabilityGoodBest for humansVerbose
Whitespace significantNoYesNo
Common useREST APIs, RESTCONFAnsible playbooks, Kubernetes manifests, CI pipelinesNETCONF, SOAP, legacy configs
RelationshipSubset-compatible with YAML 1.2Superset of JSONIndependent
Remember it

JSON has braces, YAML has spaces, XML has tags.

Exam tip

Automation exams show a snippet and ask which format it is or what the data types are (object, array, string, boolean). Remember valid JSON is also valid YAML 1.2, and NETCONF uses XML.

Tested on

More DevOps & Automation look-alikes