🌐
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.
text-based open standard designed for human-readable data interchange
whitespace
object
combox respuesta json
JSON (JavaScript Object Notation, pronounced /ˈdʒeɪsən/ or /ˈdʒeɪˌsɒn/) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs … Wikipedia
Factsheet
JavaScript Object Notation
Filename extension .json
Internet media type application/json
Factsheet
JavaScript Object Notation
Filename extension .json
Internet media type application/json
🌐
Wikipedia
en.wikipedia.org › wiki › JSON
JSON - Wikipedia
March 6, 2005 - JSON (JavaScript Object Notation, pronounced /ˈdʒeɪsən/ or /ˈdʒeɪˌsɒn/) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializable values).
🌐
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.

🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › JSON
Working with JSON - Learn web development | MDN
JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or ...
🌐
Oracle
oracle.com › ai database
What is JSON?
April 4, 2024 - ... JSON is a popular data format often used by web developers for transferring data between a server and a web application. Because JSON is text-based, it’s easily read by humans and understood by computers...
🌐
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.
🌐
Spiceworks
spiceworks.com › spiceworks inc › soft-tech › json types, functions, and uses with examples - spiceworks inc
JSON Types, Functions, and Uses with Examples
December 16, 2025 - JSON (JavaScript Object Notation) is a file format used in object-oriented programming that uses human-readable language, text, and syntax to store and communicate data objects between applications.
🌐
MongoDB
mongodb.com › resources › languages › what-is-json
What Is JSON? | A Beginner’s Guide | MongoDB
JSON is a text-based, light-weight data interchange format used to transmit data from server to client in web applications. It’s a convenient method of data transport because of its similarity to JavaScript objects.
Find elsewhere
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.

🌐
JSON
json.org
JSON
ECMA-404 The JSON Data Interchange Standard. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd ...
🌐
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.
🌐
Amazon Web Services
aws.amazon.com › databases › amazon documentdb › what is json
What is JSON? - JSON Explained - AWS
5 days ago - Most popular uses cases for JSON document databases · A JSON document database is a great choice for content management applications, such as blogs and video platforms, because each entity can be stored as a single JSON document. If the data model needs to change, only the affected documents need to be updated with no need for schema updates and no database downtime required. JSON document databases are efficient and effective for storing catalog information.
🌐
Squarespace
developers.squarespace.com › what-is-json
What is JSON? — Squarespace Developers
JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.
🌐
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.
🌐
HubSpot
blog.hubspot.com › home › website › what are json files & how do you use them?
What Are JSON Files & How Do You Use Them?
February 9, 2022 - The most common use of JSON data and files is to read data from a server for a website or web application to display — and change data given the correct permissions. But, that is not the only thing it is used for.
🌐
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.
🌐
Reddit
reddit.com › r/learnprogramming › what is json and what does it have to do with javascript?
r/learnprogramming on Reddit: What is JSON and what does it have to do with Javascript?
March 31, 2022 -

Hi! I'm looking to dive back into Javascript after a 10+ year hiatus (learned some during college) in order to build out a basic piece of software using a WebSocket for a lighting control system. I notice that most of it can be done with Javascript, but every now and then there are JSON calls. Looking at JSON's wiki page, I notice it's an acronym "JavaScript Object Notation" so obviously has lots to do with Javascript, but apparently it's also " a language-independent data format." (whatever that means).

Any indications if I'll need to be proficient with JSON to work with the WebSocket? If so, any recommendations for resources to get started? Thank you!

Top answer
1 of 5
4
I notice it's an acronym "JavaScript Object Notation" so obviously has lots to do with Javascript, but apparently it's also " a language-independent data format." (whatever that means). It means that the syntax of JSON is based on the way you construct objects in JavaScript, but it exists independently from JS. It's a data exchange format. Similar to XML. It's just a way to use text to structure data. JSON isn't a language that really requires proficiency. For one thing, it's not a programming language; it doesn't convey logic. It's just data. And it's quite simple. There are only four data types in JSON: string, number, array, and object. Whether or not you have to be proficient with it to use WebSockets? Technically they aren't directly related. But JSON is an extremely common format to pass data over WebSockets (as well as HTTP endpoints as well).
2 of 5
3
JSON came from JavaScript but it has nothing to do with JavaScript anymore. Have you ever used XML before? JSON is basically used for most of the same sorts of things that XML was used for. JSON is basically a handy standard format to use when sending structured data from one program to another, or when saving data to a file, or something like that. That's it. By using JSON instead of making up your own format, you make it easy for anyone to parse. JSON specifies the syntax, but not the semantics. You can decide whatever data you want to put in it. Let's say you wanted to save a list of names to a file. Using JSON, you could do it like this: ["Candace", "Maya", "Ken", "Tobias"] It looks just like you're defining an array in JavaScript, and that's the idea. Let's say you needed names and ages. You could do it like this: [ { "name": "Candace", "age": 44 }, { "name": "Maya", "age": 19 }, { "name": "Ken", "age": 35 }, { "name": "Tobias", "age": 27 } ] Should you learn JSON? Yes, but it's really not that complicated. You could read the documentation in an hour and get the hang of reading and writing JSON in your favorite language in less than a day. Sure, there's more complexity to it sometimes. If you're working with really large amounts of data, people have created all sorts of tools for manipulating large JSON files, or doing queries or transformations. If you ever have a need for those, you can learn them.
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › what-is-json
What Is JSON? Syntax, Types and Uses Explained with Examples
JSON (JavaScript Object Notation) is a lightweight data-interchange format used to store and exchange data between servers and web applications. It is easy to read, write, and parse, making it ideal for APIs and real-time communication.
🌐
Codecademy
codecademy.com › article › what-is-json
What Is JSON? | Codecademy
Adopted by ECMA International, ... programming languages. JSON is heavily used to facilitate data transfer in web applications between a client, such as a web browser, and a server....