PageSourceSearch

https://jsontoexcel.net/chunk-PJ3HN6PJ.js

js jsontoexcel.net collected 2026-10-02 02:02:18 UTC 16,790 bytes, 23 lines download raw bytes

1import{a as g}from"./chunk-FY3C2FL4.js";import{g as p}from"./chunk-25Q6C272.js";import{b as x}from"./chunk-RWDG3UKW.js";import"./chunk-WH7DPHUN.js";import"./chunk-2HQDRHHR.js";import{Pa as n,Qa as t,Qb as d,Ra as s,Tb as m,Ub as c,jb as e,qa as a,va as l}from"./chunk-K57J5MTO.js";var u=class o{constructor(r,i,S){this.meta=r;this.titleService=i;this.structuredData=S;this.titleService.setTitle("What is JSON? A Beginner's Guide | jsontoexcel.net"),this.meta.updateTag({name:"description",content:"Learn what JSON is, how it works, and why it is the most popular data format on the web. Includes syntax rules, real-world examples, and common use cases."}),this.structuredData.setArticleSchema("what-is-json")}static \u0275fac=function(i){return new(i||o)(a(m),a(c),a(x))};static \u0275cmp=l({type:o,selectors:[["app-blog-what-is-json"]],decls:319,vars:0,consts:[[1,"article-wrapper"],[1,"article-header"],[1,"article-breadcrumb"],["routerLink","/"],["routerLink","/blog/"],[1,"article-meta"],[1,"article-category"],[1,"article-byline"],["routerLink","/author/arslan-malik"],["datetime","2026-05-30"],[1,"article-content"],[1,"info-box"],[1,"article-cta"],[1,"article-footer"]],template:function(i,S){i&1&&(n(0,"article",0)(1,"header",1)(2,"nav",2)(3,"a",3),e(4,"Home"),t(),n(5,"span"),e(6,"\u203A"),t(),n(7,"a",4),e(8,"Blog"),t(),n(9,"span"),e(10,"\u203A"),t(),n(11,"span"),e(12,"What is JSON?"),t()(),n(13,"div",5)(14,"span",6),e(15,"Beginner"),t(),n(16,"span"),e(17,"\xB7"),t(),n(18,"span",7),e(19,"By "),n(20,"a",8),e(21,"Arslan Malik"),t()(),n(22,"span"),e(23,"\xB7"),t(),n(24,"time",9),e(25,"May 30, 2026"),t(),n(26,"span"),e(27,"\xB7"),t(),n(28,"span"),e(29,"7 min read"),t()(),n(30,"h1"),e(31,"What is JSON? A Beginner's Guide"),t(),n(32,"p"),e(33,"JSON is the language the web uses to send and receive data. Whether you are a developer, analyst, or just someone who keeps seeing "),n(34,"code"),e(35,".json"),t(),e(36," files, this guide explains everything you need to know."),t()(),n(37,"div",10)(38,"p"),e(39," JSON stands for "),n(40,"strong"),e(41,"JavaScript Object Notation"),t(),e(42,". Despite the name, it has nothing to do with JavaScript specifically \u2014 it is a lightweight, human-readable text format used to store and transmit data between systems. Today, virtually every web API, mobile app, and configuration file uses JSON. "),t(),n(43,"p"),e(44," If you have ever exported data from an app, called an API, or worked with a web service, you have almost certainly encountered JSON. Understanding it is one of the most practical skills you can have when working with data. "),t(),n(45,"h2"),e(46,"What Does JSON Look Like?"),t(),n(47,"p"),e(48,"Here is a simple example of a JSON object representing a person:"),t(),n(49,"pre")(50,"code"),e(51,`{
2  "name": "Sarah Chen",
3  "age": 34,
4  "isActive": true,
5  "email": "[email protected]",
6  "tags": ["analyst", "manager"],
7  "address": {
8    "city": "London",
9    "country": "UK"
10  }
11}`),t()(),n(52,"p"),e(53," Even without any technical background, you can read this and understand what data it contains. That readability is one of JSON's biggest strengths. "),t(),n(54,"h2"),e(55,"The Six JSON Data Types"),t(),n(56,"p"),e(57,"JSON supports exactly six types of values:"),t(),n(58,"table")(59,"thead")(60,"tr")(61,"th"),e(62,"Type"),t(),n(63,"th"),e(64,"Example"),t(),n(65,"th"),e(66,"Description"),t()()(),n(67,"tbody")(68,"tr")(69,"td")(70,"strong"),e(71,"String"),t()(),n(72,"td")(73,"code"),e(74,'"hello"'),t()(),n(75,"td"),e(76,"Text, always wrapped in double quotes"),t()(),n(77,"tr")(78,"td")(79,"strong"),e(80,"Number"),t()(),n(81,"td")(82,"code"),e(83,"42"),t(),e(84," or "),n(85,"code"),e(86,"3.14"),t()(),n(87,"td"),e(88,"Integer or decimal, no quotes"),t()(),n(89,"tr")(90,"td")(91,"strong"),e(92,"Boolean"),t()(),n(93,"td")(94,"code"),e(95,"true"),t(),e(96," or "),n(97,"code"),e(98,"false"),t()(),n(99,"td"),e(100,"Logical true/false, lowercase only"),t()(),n(101,"tr")(102,"td")(103,"strong"),e(104,"Array"),t()(),n(105,"td")(106,"code"),e(107,'["a", "b", "c"]'),t()(),n(108,"td"),e(109,"Ordered list of values in square brackets"),t()(),n(110,"tr")(111,"td")(112,"strong"),e(113,"Object"),t()(),n(114,"td")(115,"code"),e(116,'{"key": "value"}'),t()(),n(117,"td"),e(118,"Key-value pairs in curly braces"),t()(),n(119,"tr")(120,"td")(121,"strong"),e(122,"Null"),t()(),n(123,"td")(124,"code"),e(125,"null"),t()(),n(126,"td"),e(127,"Represents an empty or missing value"),t()()()(),n(128,"h2"),e(129,"JSON Syntax Rules"),t(),n(130,"p"),e(131,"JSON has strict formatting rules. Breaking any of them makes the file invalid:"),t(),n(132,"ul")(133,"li")(134,"strong"),e(135,"Keys must be strings"),t(),e(136," \u2014 always wrapped in double quotes. Single quotes are not allowed."),t(),n(137,"li")(138,"strong"),e(139,"Strings must use double quotes"),t(),e(140," \u2014 "),n(141,"code"),e(142,'"hello"'),t(),e(143," is valid, "),n(144,"code"),e(145,"'hello'"),t(),e(146," is not."),t(),n(147,"li")(148,"strong"),e(149,"No trailing commas"),t(),e(150," \u2014 "),n(151,"code"),e(152,"[1, 2, 3,]"),t(),e(153," is invali
11d JSON (the final comma causes an error)."),t(),n(154,"li")(155,"strong"),e(156,"No comments"),t(),e(157," \u2014 unlike JavaScript, JSON does not support "),n(158,"code"),e(159,"// comments"),t(),e(160," or "),n(161,"code"),e(162,"/* block comments */"),t(),e(163,"."),t(),n(164,"li")(165,"strong"),e(166,"No functions or undefined"),t(),e(167," \u2014 only the six data types listed above are valid."),t()(),n(168,"div",11)(169,"strong"),e(170,"Common mistake:"),t(),e(171," Many beginners write "),n(172,"code"),e(173,'{ name: "John" }'),t(),e(174," \u2014 this is valid JavaScript but invalid JSON. Keys must always be quoted: "),n(175,"code"),e(176,'{ "name": "John" }'),t(),e(177,". "),t(),n(178,"h2"),e(179,"JSON vs Plain Text vs XML"),t(),n(180,"p"),e(181,"Before JSON became dominant, XML was the standard way to exchange data between systems. JSON replaced it in most contexts because it is:"),t(),n(182,"ul")(183,"li")(184,"strong"),e(185,"More compact"),t(),e(186," \u2014 less verbose syntax means smaller file sizes"),t(),n(187,"li")(188,"strong"),e(189,"Easier to read"),t(),e(190," \u2014 humans can understand it without training"),t(),n(191,"li")(192,"strong"),e(193,"Faster to parse"),t(),e(194," \u2014 programming languages process it more efficiently"),t(),n(195,"li")(196,"strong"),e(197,"Natively supported"),t(),e(198," \u2014 every major programming language has built-in JSON support"),t()(),n(199,"p"),e(200,"Here is the same data in both formats to illustrate the difference:"),t(),n(201,"pre")(202,"code"),e(203,`// XML format
12<person>
13  <name>Sarah Chen</name>
14  <age>34</age>
15</person>
16
17// JSON format
18{
19  "name": "Sarah Chen",
20  "age": 34
21}`),t()(),n(204,"h2"),e(205,"Where is JSON Used?"),t(),n(206,"p"),e(207,"JSON appears in practically every part of modern software:"),t(),n(208,"h3"),e(209,"Web APIs"),t(),n(210,"p"),e(211," When you use an app on your phone that shows weather, stock prices, or social media posts, the server is almost certainly sending that data as JSON. REST APIs \u2014 the backbone of modern web development \u2014 use JSON as their default response format. "),t(),n(212,"h3"),e(213,"Configuration Files"),t(),n(214,"p"),e(215," Developers use JSON to store settings. Node.js projects use "),n(216,"code"),e(217,"package.json"),t(),e(218," to list dependencies. VS Code stores editor settings in "),n(219,"code"),e(220,"settings.json"),t(),e(221,". Many apps read their configuration from JSON files at startup. "),t(),n(222,"h3"),e(223,"Databases"),t(),n(224,"p"),e(225," Document databases like MongoDB and Firestore store records as JSON-like documents. PostgreSQL and MySQL both have native JSON column types that allow structured JSON storage inside relational tables. "),t(),n(226,"h3"),e(227,"Data Export and Import"),t(),n(228,"p"),e(229," When you export data from a CRM, analytics platform, or business tool, JSON is often one of the available formats. It preserves data types and nested structures that flat formats like CSV cannot represent cleanly. "),t(),n(230,"h2"),e(231,"How to Open and Read a JSON File"),t(),n(232,"p"),e(233,"JSON files have the "),n(234,"code"),e(235,".json"),t(),e(236," extension. You can open them with:"),t(),n(237,"ul")(238,"li")(239,"strong"),e(240,"Any text editor"),t(),e(241," \u2014 Notepad, TextEdit, VS Code, Sublime Text"),t(),n(242,"li")(243,"strong"),e(244,"A browser"),t(),e(245," \u2014 drag the file into Chrome or Firefox for a formatted view"),t(),n(246,"li")(247,"strong"),e(248,"Online JSON viewers"),t(),e(249," \u2014 tools that display JSON as an interactive tree"),t(),n(250,"li")(251,"strong"),e(252,"Excel"),t(),e(253," \u2014 via Power Query (Data \u2192 Get Data \u2192 From File \u2192 From JSON)"),t()(),n(254,"h2"),e(255,"Converting JSON to Other Formats"),t(),n(256,"p"),e(257," JSON is great for machines but not always convenient for humans who need to view or analyze data. The most common conversions are: "),t(),n(258,"ul")(259,"li")(260,"strong"),e(261,"JSON to Excel"),t(),e(262," \u2014 for data analysis, reporting, and sharing with non-technical colleagues"),t(),n(263,"li")(264,"strong"),e(265,"JSON to CSV"),t(),e(266," \u2014 for importing into databases or other tools"),t(),n(267,"li")(268,"strong"),e(269,"JSON to XML"),t(),e(270," \u2014 for legacy systems that require XML input"),t()(),n(271,"div",11)(272,"strong"),e(273,"Note:"),t(),e(274," Converting JSON to flat formats like CSV or Excel works best when the JSON contains a simple array of objects with consistent keys. Deeply nested structures require flattening first. "),t(),n(275,"h2"),e(276,"JSON vs JSONL (JSON Lines)"),t(),n(277,"p"),e(278," You may also encounter "),n(279,"code"),e(280,".jsonl"),t(),e(281," files. These are JSON Lines files \u2014 each line is a separate valid JSON object. This format is popular for large datasets and log files because you can process them line by line without loading the entire file into memory. "),t(),n(282,"pre")(283,"code"),e(284,`{"id": 1, "name": "Alice"}
22{"id": 2, "name": "Bob"}
23{"id": 3, "name": "Carol"}`),t()(),n(285,"h2"),e(286,"Validating JSON"),t(),n(287,"p"),e(288," If you are working with JSON and s
23omething is not parsing correctly, the problem is almost always a syntax error. Common causes include: "),t(),n(289,"ul")(290,"li"),e(291,"A missing or extra comma"),t(),n(292,"li"),e(293,"Unclosed curly brace or square bracket"),t(),n(294,"li"),e(295,"Single quotes instead of double quotes"),t(),n(296,"li"),e(297,"An unescaped special character inside a string"),t()(),n(298,"p"),e(299,' Use an online JSON validator (search "JSON validator") to paste your JSON and instantly identify the exact line and character causing the error. '),t(),n(300,"div",12)(301,"h3"),e(302,"Need to Convert JSON to Excel?"),t(),n(303,"p"),e(304,"Our free tool handles arrays, nested objects, and large files \u2014 all in your browser with no signup required."),t(),n(305,"a",3),e(306,"Convert JSON to Excel Now \u2192"),t()()(),s(307,"app-author-bio"),n(308,"footer",13)(309,"p"),e(310,"Published "),n(311,"time",9),e(312,"May 30, 2026"),t(),e(313," by "),n(314,"a",8),e(315,"Arslan Malik"),t()(),n(316,"p")(317,"a",4),e(318,"\u2190 Back to Blog"),t()()()())},dependencies:[d,p,g],styles:[".article-wrapper[_ngcontent-%COMP%]{max-width:760px;margin:32px auto;padding:48px 32px;background:#fff;border-radius:24px;box-shadow:0 24px 48px #0f172a14;color:#1f2937;line-height:1.8;font-family:Segoe UI,Inter,-apple-system,BlinkMacSystemFont,sans-serif}.article-header[_ngcontent-%COMP%]{margin-bottom:36px;border-bottom:1px solid #f1f5f9;padding-bottom:24px}.article-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:.85rem;color:#9ca3af;margin-bottom:16px}.article-breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#2563eb;text-decoration:none;font-weight:500}.article-breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline}.article-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:.85rem;color:#9ca3af;margin-bottom:16px}.article-byline[_ngcontent-%COMP%]{color:#64748b;font-weight:600}.article-byline[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#2563eb;text-decoration:none}.article-byline[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline}.article-meta[_ngcontent-%COMP%]{flex-wrap:wrap}.article-footer[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#2563eb;text-decoration:none}.article-footer[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline}.article-category[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#2563eb;background:#eff6ff;padding:4px 12px;border-radius:20px}.article-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0 0 16px;font-size:2.2rem;font-weight:700;color:#0f172a;line-height:1.25}.article-content[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:36px 0 16px;font-size:1.5rem;font-weight:700;color:#111827}.article-content[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:28px 0 12px;font-size:1.2rem;font-weight:600;color:#1f2937}.article-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 16px;font-size:1rem;color:#374151}.article-content[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%], .article-content[_ngcontent-%COMP%]   ol[_ngcontent-%COMP%]{margin:12px 0 20px 24px;padding:0}.article-content[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{margin-bottom:8px;color:#374151}.article-content[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#2563eb;text-decoration:none;font-weight:500}.article-content[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline}.article-content[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#111827}.article-content[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{background:#f1f5f9;color:#1e293b;padding:2px 6px;border-radius:4px;font-size:.9em;font-family:Cascadia Code,Fira Code,monospace}.article-content[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{background:#1e293b;color:#e2e8f0;padding:20px 24px;border-radius:12px;overflow-x:auto;font-size:.9rem;line-height:1.6;margin:16px 0 24px}.article-content[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{background:none;color:inherit;padding:0;font-size:inherit}.article-content[_ngcontent-%COMP%]   blockquote[_ngcontent-%COMP%]{border:1px solid #dbeafe;background:#f8fafc;padding:16px 20px;margin:16px 0 24px;border-radius:8px;color:#475569;font-style:italic}.article-content[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;margin:16px 0 24px;font-size:.95rem}.article-content[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background:#f8fafc;font-weight:600;text-align:left;padding:10px 14px;border:1px solid #e2e8f0;color:#1e293b}.article-content[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px 14px;border:1px solid #e2e8f0;color:#374151}.article-content[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:nth-child(2n){background:#fafafa}.info-box[_ngcontent-%COMP%]{background:#eff6ff;border:1px solid #bfdbfe;border-radius:12px;padding:16px 20px;margin:16px 0 24px;color:#1e40af;font-size:.95rem}.info-box[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#1e40af}.warning-box[_ngcontent-%COMP%]{background:#fffbeb;border:1px solid #fde68a;border-radius:12px;padding:16px 20px;margin:16px 0 24px;color:#92400e;font-size:.95rem}.article-cta[_ngcontent-%COMP%]{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:28px;margin-top:40px;text-align:center}.article-cta[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0 0 8px;font-size:1.2rem;font-weight:700;color:#0f172a}.article-cta[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 16px;color:#6b7280;font-size:.95rem}.article-cta[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{display:inline-block;background:#1e293b;color:#fff;text-decoration:none;padding:10px 24px;border-radius:10px;font-weight:600;font-size:.95rem;transition:background .2s ease}.article-cta[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{background:#334155;text-decoration:none}.article-footer[_ngcontent-%COMP%]{margin-top:40px;padding-top:24px;border-top:1px solid #f1f5f9;font-size:.9rem;color:#9ca3af}@media (max-width: 768px){.article-wrapper[_ngcontent-%COMP%]{margin:16px;padding:32px 20px}.article-header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.65rem}.article-content[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{font-size:1.3rem}.article-content[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{padding:16px;font-size:.82rem}}"]})};export{u as BlogWhatIsJsonPage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.