JSON Tutorial

X

## JSON Tutorial

JSON HOME JSON Intro JSON Syntax JSON HowTo JSON Files

# JSON Tutorial

« W3Schools Home
Next Chapter »

JSON: JavaScript Object Notation.

JSON is a syntax for storing and exchanging data.

JSON is an easier to use alternative to XML.

This JSON syntax defines an employees object, with an array of 3 employee records (objects):

## JSON Example

{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]}

This XML syntax also defines an employees object with 3 employee records:

## XML Example

<employees>
<employee>
<firstName>John</firstName> <lastName>Doe</lastName>
</employee>
<employee>
<firstName>Anna</firstName> <lastName>Smith</lastName>
</employee>
<employee>
<firstName>Peter</firstName> <lastName>Jones</lastName>
</employee>
</employees>

## What is JSON?

- JSON stands for JavaScript Object Notation
- JSON is lightweight data interchange format
- JSON is language independent *
- JSON is "self-describing" and easy to understand

| * JSON uses JavaScript syntax, but the JSON format is text only, just like XML. Text can be read and used as a data format by any programming language.

« W3Schools Home
Next Chapter »

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

UK Reseller Hosting cPanel Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER Free HTML5 Templates

## W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

## SHARE THIS PAGE

## WEB RESOURCES

Web Statistics Web Validation