Techbubbles

JSON vs XML

Introduction

This post explains the JSON Advantages over XML. JSON is more compact. Consider the following XML data

empxml

The above example contains three employees information where <empinfo> and <employees> elements help us to understand the overall structure and meaning of the information.

Consider the same information formatted as JSON:

j1

In JSON formatted data closing tags aren’t necessary to match opening tags which reduces the number of bytes needed to transmit the same information. JSON data is 210 bytes, where as comparable XML data is 325 bytes saving more than 100 bytes.

The disadvantage to JSON-formatted data as compared to XML is far less readable to naked eye.

Technorati Tags: ,

Share this post :





Related Posts:

  • Casey

    Gimme a break; this is a dishonest comparison.

%d bloggers like this: