JSON is derived from JavaScrtipt (JavaScript Object Notation) and is just the format using key value pairs. Values can be booleans, strings, numbers, arrays or objects. That's all it is. Answer from Jayoval on reddit.com
🌐
W3Schools
w3schools.com › whatis › whatis_json.asp
What is JSON
A common use of JSON is to read data from a web server, and display the data in a web page. For simplicity, this can be demonstrated using a string as input.
🌐
Reddit
reddit.com › r/learnjavascript › can someone please explain json to me?
r/learnjavascript on Reddit: Can someone please explain JSON to me?
November 24, 2023 -

I've never worked with any DB or back-end, etc stuff, but I am in need of some sort of data storage. I'm working on a javascript application that will only be run on my pc, offline, and I need to be able to save information. I don't want to rely on localStorage because if the browser history is wiped then all the data goes with it.

While searching for a way to collect and store info, I read about JSON, and it sounded like what I was looking for--and yet I've spent the last 4 hours watching tutorials and so far all I know about it is it's fching JS. I sat through a 12 minute video where all the guy did was write out an object in json and then copy and paste into a js file and said "now you know how to use json in all your future projects" 🙄 like what in ACTUAL fk. You could have just WROTE that in js. What's the point of JSON? Everything I've seen or read is practically just the same as this video.

DOES json collect and store data?

Like, if I put an input form in my app, and type a name and hit submit, can I make that Input hardcode into the json file to be saved forevermore and called upon when I needed in this app? Because that's what I need. Any explanation or help on this would be GREATLY appreciated.

Discussions

What is JSON and what is it used for? - Stack Overflow
I've looked on Wikipedia, googled it, and read the official documentation, but I still haven't got to the point where I really understand what JSON is, and why I'd use it. I have been building More on stackoverflow.com
🌐 stackoverflow.com
ELI5: What is the point of JSON and how does it work?

JSON is a data interchange format (or serialization format.) If you have some object and you want to store it in a file or send it over a network connection or something of that nature, you have to convert it to a string first, because you can't send objects over a network or write objects to a file. You can only write strings. And the other end has to receive that string and reconstitute it into an object before it can work with it. JSON is a set of rules for how to turn objects into strings and vice versa. It's based on JavaScript syntax, but it's not specific to JavaScript; it's used by many other languages. Its cousins are other serialization formats such as YAML and XML.

toString() is completely useless for this. When invoked on an object, it evaluates to the string "[object Object]". Example:

> var obj = {foo: 42, bar: [1, 2, 3], baz: "hippo"};
undefined
> obj.toString();
'[object Object]'
> JSON.stringify(obj);
'{"foo":42,"bar":[1,2,3],"baz":"hippo"}'

Note that in this example you could have just put quotes around the object literal, but that's missing the point. You don't always have an object literal. The object could have been built by much more complicated means. This is just a simple example.

More on reddit.com
🌐 r/learnjavascript
2
10
May 22, 2014
What is JSON?

Javascript object notation.

Its a way of sending and receiving data in a certain format. In the old days if I wanted to exchange data with (for example) Hertz I might call them up and agree to send them a fixed width or comma separated values (CSV) file with request information and they might agree to send a similar fromatted response file or a completely different format. If my colleague contacted them they might also agree on an interface but his request file might be a different format to mine and their response might also be a different format. Hertz may want a fixed width request file but Budget may want me to send a CSV request file. So loads of different interfaces existed (Hertz may be different to Budget, who are also different from AVIS etc.). And Im just using rental car companies as an example - loads of different comanies have interfaces and exchange information all the time.

My request file to Hertz (formatted as we agreed):

REQUEST=WhoIsDriver, DATE=01/01/2010, Plate="XYZ 1234"

Their response (formatted however they choose):

DRIVER:JoeSmith, CAR:Ford, MODEL: Explorer, FROM: 12/30/2009, TO: 01/07/2010

So in the old days it was truly random with all sorts of interface formats whcih were proprietary to whoever designed them Then came along XML, which was. better in that it forced a certain kind of syntax but it was very wordy

<request>
<type>WhoIsDriver</type>
<date>01/01/2011</date>
<plate>XYZ 1234</plate>
</request>

This was very popular and the forced formatting meant lots of standardized services appeared on the WEB saying if you send us data formatted in XML in a certain way we will send back information to you also formatted in XML. Google SOAP interfaces for more info on this.

But in a trifector of luck/timing/ whatever:

  1. XML is very wordy, If you have an interface with 10,000 requests and responses the file sizes get huge because of all the <start-tag>...<end-tag> stuff, and this makes things slow.

  2. everyone is slowly moving to new shiny web front-ends for their systems and therefore having to use Javascript, and

  3. Javascript have a nifty less wordy way of representing data - their Javascript object notation (also called JSON).

So slowly but surely, JSON is taking over the world in interfaces between companies and also many public interfaces (such a Google maps) that used to be XML only are now becoming REST services/interfaces that use JSON format for data exchange.

Javascript (JSON) format is:

{ "type" : "WhoIsDriver", "date" : "01/01/2011", "plate" : "XYZ 1234" }  

In the web development world we frequently have to pass data from the front-end programs in the browser to the back-end programs on the server. This is also an interface and nowadays most data is passed on JSON format.

More on reddit.com
🌐 r/webdev
1
0
March 10, 2010
ELI5 what a JSON file is

JSON is a convention or protocol for formatting and structuring data you want to store. The basic idea is that information and data is very important just in general for just about anything you might possibly might want to do, which means being able to easily access and manipulate the data you own is also very important.

When you have information (demographic data, some representation of a CAD model, numbers computed from research, whatever), you could just take that data, chuck it into a text file, and write some custom code to try and extract and write to that file in some manner. This however is somewhat of a fragile solution since anybody else who wants to work with your data would also need to write some custom code to parse however your data is formatted.

This is obviously sub-optimal -- being able to freely exchange and work with data is nearly as important as the data itself.

So, what people did was invent standards for how data should be formatted and structured (and took care to make sure those standards were flexible enough to represent all kinds of data). The idea is then that if somebody creates a library that can understand and work with that format, everybody else can use that library without having to constantly reinvent things. As they say, don't reinvent the wheel.

XML is one such standard. CSV is another. JSON is yet another. There are many.

JSON, in particular, was designed to be simple and minimalistic. The rules for what constitutes a valid chunk of JSON were designed to very basic and straightforward, and to closely mimic data structures and primitive types that many programming languages have built-in by default.

For example, here is a basic example of some invented data I came up with structured in JSON format:

{
    "data-type": "posts",
    "posts": [
        {
            "title": "Comment 1",
            "body": "..."
        },
        {
            "title": "Comment 2",
            "body": "..."
        }
    ]
}

If you have any experience working with languages like JavaScript or Python, you'll notice this looks identical to dict, list, and string literals. This resemblance is identical.

For comparison is how you might decide to structure this same data in a different format, XML:

<data type="posts">
    <comment>
        <title>Comment 1</title>
        <body>...</body>
    </comment>
    <comment>
        <title>Comment 2</title>
        <body>...</body>
    </comment>
</data>

Learning JSON (or XML or any data exchange format) is not typically the hard part and is typically easily learned and mastered. Working with the underlying data as well as tools that can manipulate your data, store it into various forms may potentially be hard.

More on reddit.com
🌐 r/learnprogramming
6
1
November 25, 2014
People also ask

What is a JSON file?
A JSON file is a text file with the .json extension that stores structured data using the JSON format. It is used to persist data or exchange it between systems.
🌐
opc-router.com
opc-router.com › startseite › what is a json file?
What is a JSON file, what is it used for and how can it be opened?
How is a JSON file structured?
A JSON file consists of key-value pairs and arrays. The structure is hierarchical and clearly defined, making the data easy to read, process, and validate.
🌐
opc-router.com
opc-router.com › startseite › what is a json file?
What is a JSON file, what is it used for and how can it be opened?
Who works with JSON files?
JSON files are used by software developers, system integrators, web services, and automated systems. In many cases, they are generated and processed automatically in the background.
🌐
opc-router.com
opc-router.com › startseite › what is a json file?
What is a JSON file, what is it used for and how can it be opened?
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › JSON
Working with JSON - Learn web development | MDN
JSON is a text-based data format following JavaScript object syntax. It represents structured data as a string, which is useful when you want to transmit data across a network. Even though it closely resembles JavaScript object literal syntax, it can be used independently from JavaScript.
🌐
OPC Router
opc-router.com › startseite › what is a json file?
What is a JSON file, what is it used for and how can it be opened?
January 2, 2026 - More specifically, the format is used to structure and transfer information between web-based systems. To open and edit a JSON file, all you need is a text editor of your choice.
JSON is derived from JavaScrtipt (JavaScript Object Notation) and is just the format using key value pairs. Values can be booleans, strings, numbers, arrays or objects. That's all it is. Answer from Jayoval on reddit.com
🌐
Oracle
oracle.com › ai database
What is JSON?
April 4, 2024 - JSON is a data format that’s commonly used by web developers for transferring data between a server and a web application. Developers often prefer JSON because it simplifies the exchange of data between different technologies.
Find elsewhere
🌐
JSON
json.org
JSON
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence. These are universal data structures. Virtually all modern programming languages support them in one form or another.
🌐
Wikipedia
en.wikipedia.org › wiki › JSON
JSON - Wikipedia
March 6, 2005 - JSON (JavaScript Object Notation, ... format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializable values)....
🌐
Stack Overflow
stackoverflow.blog › 2022 › 06 › 02 › a-beginners-guide-to-json-the-data-format-for-the-internet
A beginner's guide to JSON, the data format for the internet - Stack Overflow
Here's a primer on why JSON is how networked applications send data. As the web grows in popularity and power, so does the amount of data stored and transferred between systems, many of which know nothing about each other. From early on, the format that this data was transferred in mattered, and like the web, the best formats were open standards that anyone could use and contribute to.
🌐
YouTube
youtube.com › web dev simplified
Learn JSON in 10 Minutes - YouTube
In this video we will cover everything you need to know about JSON in only 10 minutes. We will cover what JSON is, why JSON is important, what JSON is used f...
Published   November 1, 2018
Views   864K
🌐
MongoDB
mongodb.com › resources › languages › what-is-json
What Is JSON? | A Beginner’s Guide | MongoDB
JSON, or JavaScript Object Notation, is a text-based data interchange format that is used for transmitting information between web application clients and servers.
Top answer
1 of 15
679

JSON (JavaScript Object Notation) is a lightweight format that is used for data interchanging. It is based on a subset of JavaScript language (the way objects are built in JavaScript). As stated in the MDN, some JavaScript is not JSON, and some JSON is not JavaScript.

An example of where this is used is web services responses. In the 'old' days, web services used XML as their primary data format for transmitting back data, but since JSON appeared (The JSON format is specified in RFC 4627 by Douglas Crockford), it has been the preferred format because it is much more lightweight

You can find a lot more info on the official JSON web site.

JSON is built on two structures:

  • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
  • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

JSON Structure













Here is an example of JSON data:

{
     "firstName": "John",
     "lastName": "Smith",
     "address": {
         "streetAddress": "21 2nd Street",
         "city": "New York",
         "state": "NY",
         "postalCode": 10021
     },
     "phoneNumbers": [
         "212 555-1234",
         "646 555-4567"
     ]
 }

JSON in JavaScript

JSON (in JavaScript) is a string!

People often assume all JavaScript objects are JSON and that JSON is a JavaScript object. This is incorrect.

In JavaScript, var x = {x:y} is not JSON, this is a JavaScript object. The two are not the same thing. The JSON equivalent (represented in the JavaScript language) would be var x = '{"x":"y"}'. x is an object of type string not an object in its own right. To turn this into a fully fledged JavaScript object you must first parse it, var x = JSON.parse('{"x":"y"}');, x is now an object but this is not JSON anymore.

See JavaScript object vs. JSON


When working with JSON and JavaScript, you may be tempted to use the eval function to evaluate the result returned in the callback, but this is not suggested since there are two characters (U+2028 & U+2029) valid in JSON but not in JavaScript (read more of this here).

Therefore, one must always try to use Crockford's script that checks for a valid JSON before evaluating it. Link to the script explanation is found here and here is a direct link to the JavaScript file. Every major browser nowadays has its own implementation for this.

Example on how to use the JSON parser (with the JSON from the above code snippet):

// The callback function that will be executed once data is received from the server
var callback = function (result) {
    var johnny = JSON.parse(result);
    // Now, the variable 'johnny' is an object that contains all of the properties
    //from the above code snippet (the JSON example)
    alert(johnny.firstName + ' ' + johnny.lastName); // Will alert 'John Smith'
};

The JSON parser also offers another very useful method, stringify. This method accepts a JavaScript object as a parameter, and outputs back a string with JSON format. This is useful for when you want to send data back to the server:

var anObject = {name: "Andreas", surname : "Grech", age : 20};
var jsonFormat = JSON.stringify(anObject);
// The above method will output this: {"name":"Andreas","surname":"Grech","age":20}

The above two methods (parse and stringify) also take a second parameter, which is a function that will be called for every key and value at every level of the final result, and each value will be replaced by result of your inputted function. (More on this here)

Btw, for all of you out there who think JSON is just for JavaScript, check out this post that explains and confirms otherwise.


References

  • JSON.org
  • Wikipedia
  • Json in 3 minutes (Thanks mson)
  • Using JSON with Yahoo! Web Services (Thanks gljivar)
  • JSON to CSV Converter
  • Alternative JSON to CSV Converter
  • JSON Lint (JSON validator)
2 of 15
81

The Concept Explained - No Code or Technical Jargon

What is JSON? – How I explained it to my wifeTM

Me: “It’s basically a way of communicating with someone in writing....but with very specific rules.

Wife: yeah....?

Me: In prosaic English, the rules are pretty loose: just like with cage fighting. Not so with JSON. There are many ways of describing something:

• Example 1: Our family has 4 people: You, me and 2 kids.

• Example 2: Our family: you, me, kid1 and kid2.

• Example 3: Family: [ you, me, kid1, kid2]

• Example 4: we got 4 people in our family: mum, dad, kid1 and kid2.

Wife: Why don’t they just use plain English instead?

Me: They would, but remember we’re dealing with computers. A computer is stupid and is not going to be able to understand sentences. So we gotta be really specific when computers are involved otherwise they get confused. Furthermore, JSON is a fairly efficient way of communicating, so most of the irrelevant stuff is cut out, which is pretty hand. If you wanted to communicate our family, to a computer, one way you could do so is like this:

{
    "Family": ["Me", "Wife", "Kid1", "Kid2"] 
}

……and that is basically JSON. But remember, you MUST obey the JSON grammar rules. If you break those rules, then a computer simply will not understand (i.e. parse) what you are writing.

Wife: So how do I write in Json?

A good way would be to use a json serialiser - which is a library which does the heavy lifting for you.

Summary

JSON is basically a way of communicating data to someone, with very, very specific rules. Using Key Value Pairs and Arrays. This is the concept explained, at this point it is worth reading the specific rules above.

🌐
Postman
blog.postman.com › home › what is json?
What Is JSON? | Postman Blog
January 18, 2024 - JSON, which stands for “JavaScript ... use make it one of the most common formats for transferring data between a server and client—or between different parts of an application....
🌐
AWS
aws.amazon.com › what is cloud computing? › cloud comparisons hub › developer tools › what’s the difference between json and xml?
JSON vs XML - Difference Between Data Representations - AWS
4 weeks ago - JSON and XML are data representations used in data exchange between applications. JSON is an open data interchange format that is readable by both people and machines. JSON is independent of any programming language and is a common API output in a wide variety of applications.
🌐
Turing
turing.com › kb › what-is-json
JSON: Introduction, Benefits, Applications, and Drawbacks | Turing
JSON or JavaScript Object Notation is a lightweight, text-based, data-interchange format that follows JavaScript object syntax. JSON is used for data transportation and restoration in places of XML structures.
🌐
Medium
medium.com › @webstep › what-is-json-and-why-is-it-used-in-apis-a5e1f932b2dc
What is JSON, and why is it used in APIs? | by Webstep Technologies | Medium
September 4, 2024 - JSON (JavaScript Object Notation) is a lightweight data format that is easy for both humans to read and write, and for machines to parse and generate. It uses a simple syntax, similar to JavaScript, to represent structured data like objects, ...
🌐
Quora
quora.com › What-is-a-JSON-file-My-husband-says-he-found-JSON-files-on-my-phone-and-that-must-mean-I-m-hiding-something
What is a JSON file? My husband says he found JSON files on my phone and that must mean I’m hiding something. - Quora
Answer (1 of 14): a JSON file is a datafile that can represent any kind of data, e.g. a configuration of a program, user data or so. This does not mean anything, most apps use JSON files to store their data. Without looking at the files it is not even possible to say what the files are for. Yo...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › json
JSON Tutorial - GeeksforGeeks
January 13, 2026 - In a typical web application, JSON (JavaScript Object Notation) is used to transfer data between the server and the client (frontend). JSON is language-independent, which makes it ideal for communication between different technologies.
🌐
W3Schools
w3schools.com › js › js_json.asp
W3Schools.com
A common use of JSON is to read data from a web server, and display the data in a web page. For simplicity, this can be demonstrated using a string as input.
🌐
TheServerSide
theserverside.com › definition › JSON-Javascript-Object-Notation
What is JSON? - Definition from TechTarget.com
JSON (JavaScript Object Notation) is a text-based, human-readable data interchange format used to exchange data between web clients and web servers. The format defines a set of structuring rules for the representation of structured data.
🌐
YouTube
youtube.com › watch
What are JSON files (in less than 3 minutes)
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.