🌐
Medium
medium.com › @V-Blaze › json-and-xml-in-sql-working-with-json-and-xml-data-49fdde19427c
JSON and XML in SQL: Working with JSON and XML Data | by Valentine Blaze | Medium
November 2, 2023 - JSON data is represented as key-value pairs, with nested structures and arrays. In SQL databases that support JSON, you can store JSON documents in dedicated columns or fields. XML data is structured using tags and attributes, forming a hierarchical tree-like structure.
🌐
GeeksforGeeks
geeksforgeeks.org › html › difference-between-json-and-xml
Difference Between JSON and XML - GeeksforGeeks
July 11, 2025 - JSON uses Key Value Structure and XML uses Tag based Structure to make platform independent formats.
Discussions

what is the difference between json and xml - Stack Overflow
To the moderator : If a simple, ... the format. ... hah hah @davidvanbrink I really don't think we're at that end of the spectrum - funny though: xkcd.com/915 ... The fundamental difference, which no other answer seems to have mentioned, is that XML is a markup language (as it actually says in its name), whereas JSON is a way of ... More on stackoverflow.com
🌐 stackoverflow.com
JSON vs XML
To answer your question about security, XML is "secure" because it's structure can be enforced with an XSD. If you need your data to be in a particular format, have required fields, or require certain data types for fields then you will want to XML as JSON cannot do that. XML is also transformable via XSLT, so if you have a need to present the data you could apply a map to generate that presentation output. However XML can be pretty verbose so if file size is a concern it could become a problem. If you just want the data to be structured, (de)serializable, and readable then JSON the way to go. JSON is much less verbose and would give you smaller data files. With Deserialization in C# the querying advantage of XML is basically lost. More on reddit.com
🌐 r/csharp
70
32
July 21, 2020
XML vs JSON vs Other: Which do you prefer for data storage and why?
There is not much difference between JSON and XML but JSON is much less verbose. Several things that would make XML can do better. Allows comments (not really needed in production). Allows validation through schema. (Probably the only real benefit over JSON). Allows CDATA (free text). (Not much of a big deal to encoded text in JSON). More on reddit.com
🌐 r/csharp
16
5
October 17, 2019
Can you consider XML, JSON or CSV files as databases ?

When people in the profession talk about databases they usually refer to database management systems. So in that sense a file is not a database management system.

More on reddit.com
🌐 r/Database
24
8
January 20, 2020
🌐
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
3 days ago - Because of their syntax and file size differences, you can also parse JSON faster than XML. Schema documentation describes the purpose of a file, showing what you should use it for. XML documents have a link to their schema in the header. The schema is also in XML format, which allows you to read what you should expect to find in the file.
🌐
Scribd
scribd.com › document › 894457445 › DBMS-Lecture12-1
Introduction to JSON and XML Formats | PDF | Json | Xml
JSON Syntax ➔Curly braces hold ... information for each item is available? Most expensive item in the data? XML - eXtensible Markup Language...
🌐
Quora
quora.com › Which-is-better-for-storing-data-SQL-JSON-or-XML
Which is better for storing data? SQL, JSON, or XML? - Quora
Typical use cases: legacy enterprise integrations, standardized industry schemas (e.g., UBL, HL7 v2/v3 variants), complex documents requiring mixed content and namespaces. ... Need transactions, complex joins, strict schema → choose SQL (relational DB). Need flexible, nested, evolving documents or web-native data interchange → choose JSON (document DB or JSON column). Need standardized document formats, namespaces, schema validation for legacy integrations → choose XML.
🌐
W3Schools
w3schools.com › js › js_json_xml.asp
JSON vs XML
XML is much more difficult to parse than JSON. JSON is parsed into a ready-to-use JavaScript object. For AJAX applications, JSON is faster and easier than XML:
🌐
Milvus
milvus.io › ai-quick-reference › what-are-the-differences-between-json-and-xml-document-databases
What are the differences between JSON and XML document databases?
JSON (JavaScript Object Notation) databases store data in a lightweight, key-value format that mirrors JavaScript objects, while XML (eXtensible Markup Language) databases use a hierarchical, tag-based structure.
🌐
Medium
medium.com › hackernoon › xml-vs-json-shootout-which-should-i-use-in-sql-server-7eefa4dc7553
XML vs JSON Shootout: Which Should I Use in SQL Server? | by Bert Wagner | HackerNoon.com | Medium
May 23, 2019 - XML is able to filter out 96 rows in 200ms and JSON accomplishes the same in 9ms. A final win for JSON. If you need to store and manipulate serialized string data in SQL Server, there’s no question: JSON is the format of choice.
🌐
AppMaster
appmaster.io › home › blog › json vs xml
JSON vs XML | AppMaster
November 11, 2022 - On the other hand, XML is more flexible than JSON, but it can be more challenging to write. XML is an open standard for storing and data interchange. It's a markup language for describing the structure and content of any XML file, such as documents, web pages, or databases. You can think of XML like HTML, but better: it allows you to attach additional information to nodes in your document without changing the underlying format.
Find elsewhere
🌐
Coursera
coursera.org › coursera articles › computer science and engineering › json vs. xml: what’s the difference?
JSON vs. XML: What’s The Difference? | Coursera
October 1, 2025 - JSON has become more popular than XML in recent years, with Google Trends showing search interest in JSON overtaking XML in 2015 [1]. XML has many advantages when it comes to communicating data across formats, databases, and businesses by putting data into a form that’s universally recognizable.
🌐
Astronomer
astronomer.io › blog › data-formats-101
Data Format Types: CSV vs JSON vs XML Explained
August 3, 2017 - It minimizes the extra formatting characters (so that there are only commas and newlines) and maps 1-to-1 to how it will eventually be presented in a database or spreadsheet (i.e. one additional “,” means one cell over). If you’re exporting from a relational database that already exists in a 2-dimensional space, a CSV is the most common formatting option. The main troublesome elements of CSVs are that: 1. Data cannot be easily nested like with JSON or XML, making objects and arrays more trouble than they’re worth.
🌐
Startup Rocket
startuprocket.com › articles › a-quick-introduction-to-xml-and-json
A quick introduction to XML and JSON
Moving forward with our web and mobile development tutorial series, here we'll be briefly introducing Extensible Markup Language (XML) and JavaScript Object Notation (JSON), both of which are commonly used with Application Programming Interfaces ...
🌐
DEV Community
dev.to › luca1iu › how-to-store-json-and-xml-in-sql-databases-491m
How to Store JSON and XML in SQL Databases - DEV Community
2 weeks ago - XML is a markup language that defines rules for encoding documents in a format that is both human-readable and machine-readable. It is widely used for data representation and exchange, especially in web services. Many modern SQL databases, such as PostgreSQL, MySQL, and SQL Server, provide native support for JSON data types.
🌐
Imaginary Cloud
imaginarycloud.com › blog › json-vs-xml
JSON vs XML: which one is faster and more efficient?
This article makes a detailed comparison between JSON vs XML and discusses which one is better. Find out their main differences and similarities
🌐
Sonra
sonra.io › home › xml › csv vs json vs xml – the best comparison guide 2026
CSV vs JSON vs XML - The Best Comparison Guide 2026
February 23, 2026 - JSON means JavaScript Object Notation. Finally, XML is Extensible Markup Language. The questions to ask yourself before you make this important decision are… ... In this article, I’ll explain the pros and cons of each format with real-world ...
🌐
Cisco Community
community.cisco.com › t5 › devnet-general-knowledge-base › xml-vs-json-vs-yaml › ta-p › 4729758
XML vs. JSON vs. YAML
December 10, 2022 - XML is a markup language, whereas JSON and YAML are data formats. XML uses tags to define the elements and stores data in a tree structure, whereas data in JSON is stored like a map with key/value pairs.
🌐
Juniata College
jcsites.juniata.edu › faculty › rhodes › dbms › xml.htm
XML and Databases
January 12, 2015 - Note that we could address JSON in the same way. It's just a different syntax of self-describing data. ... Doesn’t require a schema (but can be provided optionally for integrity purposes--to ensure certain components exist) ... For instance, HTML’s <table>…</table> means: render contents as a table; in XML: doesn’t mean anything
Top answer
1 of 6
177

The fundamental difference, which no other answer seems to have mentioned, is that XML is a markup language (as it actually says in its name), whereas JSON is a way of representing objects (as also noted in its name).

A markup language is a way of adding extra information to free-flowing plain text, e.g

Here is some text.

With XML (using a certain element vocabulary) you can put:

<Document>
    <Paragraph Align="Center">
        Here <Bold>is</Bold> some text.
    </Paragraph>
</Document>

This is what makes markup languages so useful for representing documents.

An object notation like JSON is not as flexible. But this is usually a good thing. When you're representing objects, you simply don't need the extra flexibility. To represent the above example in JSON, you'd actually have to solve some problems manually that XML solves for you.

{
    "Paragraphs": [
        {
            "align": "center",
            "content": [
                "Here ", {
                    "style" : "bold",
                    "content": [ "is" ]
                },
                " some text."
            ]
        }
    ]
}

It's not as nice as the XML, and the reason is that we're trying to do markup with an object notation. So we have to invent a way to scatter snippets of plain text around our objects, using "content" arrays that can hold a mixture of strings and nested objects.

On the other hand, if you have typical a hierarchy of objects and you want to represent them in a stream, JSON is better suited to this task than HTML.

{
    "firstName": "Homer",
    "lastName": "Simpson",
    "relatives": [ "Grandpa", "Marge", "The Boy", "Lisa", "I think that's all of them" ]
} 

Here's the logically equivalent XML:

<Person>
    <FirstName>Homer</FirstName>
    <LastName>Simpsons</LastName>
    <Relatives>
        <Relative>Grandpa</Relative>
        <Relative>Marge</Relative>
        <Relative>The Boy</Relative>
        <Relative>Lisa</Relative>
        <Relative>I think that's all of them</Relative>
    </Relatives>
</Person>

JSON looks more like the data structures we declare in programming languages. Also it has less redundant repetition of names.

But most importantly of all, it has a defined way of distinguishing between a "record" (items unordered, identified by names) and a "list" (items ordered, identified by position). An object notation is practically useless without such a distinction. And XML has no such distinction! In my XML example <Person> is a record and <Relatives> is a list, but they are not identified as such by the syntax.

Instead, XML has "elements" versus "attributes". This looks like the same kind of distinction, but it's not, because attributes can only have string values. They cannot be nested objects. So I couldn't have applied this idea to <Person>, because I shouldn't have to turn <Relatives> into a single string.

By using an external schema, or extra user-defined attributes, you can formalise a distinction between lists and records in XML. The advantage of JSON is that the low-level syntax has that distinction built into it, so it's very succinct and universal. This means that JSON is more "self describing" by default, which is an important goal of both formats.

So JSON should be the first choice for object notation, where XML's sweet spot is document markup.

Unfortunately for XML, we already have HTML as the world's number one rich text markup language. An attempt was made to reformulate HTML in terms of XML, but there isn't much advantage in this.

So XML should (in my opinion) have been a pretty limited niche technology, best suited only for inventing your own rich text markup languages if you don't want to use HTML for some reason. The problem was that in 1998 there was still a lot of hype about the Web, and XML became popular due to its superficial resemblance to HTML. It was a strange design choice to try to apply to hierarchical data a syntax actually designed for convenient markup.

2 of 6
27

They are both data formats for hierarchical data, so while the syntax is quite different, the structure is similar. Example:

JSON:

{
  "persons": [
    {
      "name": "Ford Prefect",
      "gender": "male"
    },
    {
      "name": "Arthur Dent",
      "gender": "male"
    },
    {
      "name": "Tricia McMillan",
      "gender": "female"
    }
  ]
}

XML:

<persons>
  <person>
    <name>Ford Prefect</name>
    <gender>male</gender>
  </person>
  <person>
    <name>Arthur Dent</name>
    <gender>male</gender>
  </person>
  <person>
    <name>Tricia McMillan</name>
    <gender>female</gender>
  </person>
</persons>

The XML format is more advanced than shown by the example, though. You can for example add attributes to each element, and you can use namespaces to partition elements. There are also standards for defining the format of an XML file, the XPATH language to query XML data, and XSLT for transforming XML into presentation data.

The XML format has been around for some time, so there is a lot of software developed for it. The JSON format is quite new, so there is a lot less support for it.

While XML was developed as an independent data format, JSON was developed specifically for use with Javascript and AJAX, so the format is exactly the same as a Javascript literal object (that is, it's a subset of the Javascript code, as it for example can't contain expressions to determine values).

🌐
HackerNoon
hackernoon.com › storing-json-and-xml-in-sql-databases-an-essential-guide
Storing JSON and XML in SQL Databases: An Essential Guide | HackerNoon
November 15, 2025 - Master how to store json and xml in sql databases with practical SQL examples. Learn Introduction and Understanding JSON and XML through hands-on exercises.
🌐
Hostman
hostman.com › tutorials › json vs. xml: comparing popular data exchange formats
JSON vs. XML: Comparing Popular Data Exchange Formats
March 31, 2025 - Understand the differences between JSON and XML, and learn which data exchange format is best suited for your needs.
Price   $
Address   1999 Harrison St 1800 9079, 94612, Oakland