# JSON Copilot: Full Documentation > JSON Copilot is an online JSON formatter, validator, and editor with an AI copilot. The core tools (format, minify, validate, JSON Schema validation, tree view, and mind-map visualization) run in your browser. Standalone flattening and schema generation also run locally for free. Copilot actions in the editor use credits; cloud projects require an account. You get 1,000 free credits when you sign up. > > This file concatenates the full documentation (product overview, help articles, and What's New posts) into a single markdown document for one-shot ingestion. For a shorter curated index, see https://www.jsoncopilot.com/llms.txt. ## Product Overview JSON Copilot is an online JSON workspace at https://www.jsoncopilot.com. The tool lives at https://www.jsoncopilot.com/editor and is free to use without an account for core features: - Format & beautify, and minify JSON - Real-time syntax validation with detailed errors - JSON Schema validation - Collapsible tree view of nested structures - Interactive mind-map visualization of JSON structure - AI Copilot actions (require sign-in / credits): Explain JSON, Fix & Validate (repair invalid JSON), Flatten JSON, Generate JSON Schema, and Schema + AI descriptions Privacy: core formatting, validation, schema checks, tree view, and mind maps run in your browser, so your JSON never leaves your device. Only the data you send to the AI Copilot, or save to a project, is processed on the server. Chrome extension: JSON Copilot is also available as a Chrome extension that runs in the browser's side panel — the same formatter, validator, tree view, mind map, and AI Copilot, docked beside any tab so you can work with JSON without leaving your current page. The core tools run locally, and it's free with no sign-up to format or validate. See https://www.jsoncopilot.com/chrome-extension. Dedicated tool pages: every capability has its own landing page with a live, in-page tool plus a link into the full editor. The hub listing them all is [All JSON Tools](https://www.jsoncopilot.com/tools). Core tools (run in the browser, free) — [JSON Formatter](https://www.jsoncopilot.com/json-formatter), [JSON Validator](https://www.jsoncopilot.com/json-validator), [JSON Minifier](https://www.jsoncopilot.com/json-minifier), [JSON Viewer](https://www.jsoncopilot.com/json-tree-viewer), [JSON to Mind Map](https://www.jsoncopilot.com/json-to-mindmap), [JSON Diff](https://www.jsoncopilot.com/json-diff), [JSON Repair](https://www.jsoncopilot.com/json-repair), [JSON Merge](https://www.jsoncopilot.com/json-merge), [JSON Path Finder](https://www.jsoncopilot.com/json-path-finder). Converters (run in the browser, free) — [JSON to CSV](https://www.jsoncopilot.com/json-to-csv), [CSV to JSON](https://www.jsoncopilot.com/csv-to-json), [JSON to XML](https://www.jsoncopilot.com/json-to-xml), [XML to JSON](https://www.jsoncopilot.com/xml-to-json), [JSON to YAML](https://www.jsoncopilot.com/json-to-yaml), [YAML to JSON](https://www.jsoncopilot.com/yaml-to-json), [JSON to TypeScript](https://www.jsoncopilot.com/json-to-typescript), [JSON Escape/Unescape](https://www.jsoncopilot.com/json-escape), [Sort JSON](https://www.jsoncopilot.com/sort-json), [JSON to Excel](https://www.jsoncopilot.com/json-to-excel), [Excel to JSON](https://www.jsoncopilot.com/excel-to-json). Standalone [Flatten JSON](https://www.jsoncopilot.com/flatten-json) and [JSON Schema Generator](https://www.jsoncopilot.com/json-schema-generator) run locally, free without an account. [Explain JSON](https://www.jsoncopilot.com/explain-json) and [JSON to Documentation](https://www.jsoncopilot.com/json-to-documentation) show labeled example output; live AI actions run in the editor and use credits. Pricing in brief: a free tier with 1,000 signup credits, monthly subscriptions, and one-time credit packs. Copilot actions in the editor consume credits, including deterministic actions. Standalone tools are free. See https://www.jsoncopilot.com/pricing for current plans. ## Help & FAQ ### Features & Capabilities #### What is JSON Copilot? Source: https://www.jsoncopilot.com/faq/what-is-json-copilot JSON Copilot is an online JSON formatter, validator, and AI-powered editor that helps developers work with JSON data efficiently. Core features run client-side in your browser for free, while AI features use a credit-based system with server-side processing. ##### Core Features - **Format & Beautify:** Convert compact JSON into readable, indented format - **Minify:** Remove whitespace to reduce file size - **Validate:** Real-time syntax validation with detailed error messages - **Schema Validation:** Validate against JSON Schema - **Tree View:** Visual navigation of JSON structure ##### Why Choose JSON Copilot? ###### Client-Side Core Core formatting, validation, and schema features run entirely in your browser. ###### Fast & Reliable Instant JSON processing with a full code editor. Core features work without internet. ###### Developer-Friendly Professional code editor, keyboard shortcuts, dark mode. ###### Free Core Features Core formatting, validation, and schema features are free. AI features use a credit-based system with a free tier. ###### Quick Start - 1 Paste your JSON into the input editor - 2 Click **Format** to beautify or **Minify** to compress - 3 Use **Validate** to check for errors - 4 **Export** your formatted JSON or **Copy** to clipboard **See also:** [AI Copilot features](https://www.jsoncopilot.com/faq/ai-copilot-features), [credits and pricing](https://www.jsoncopilot.com/faq/credits-and-pricing), [What's New](https://www.jsoncopilot.com/whats-new) #### How do I use the tree view? Source: https://www.jsoncopilot.com/faq/how-to-use-tree-view The tree view provides a hierarchical, interactive visualization of your JSON data structure. It's perfect for exploring complex nested JSON, quickly navigating between objects and arrays, and understanding data relationships at a glance. ##### Visual JSON Explorer Click the "Tree View" tab to switch from raw JSON to an interactive hierarchical view with expand/collapse controls. ##### Tree View Features 1 ###### Expand & Collapse Nodes Click the arrow icons to expand or collapse objects and arrays. Quickly hide or show nested data. 2 ###### Copy Values Hover over any value and click the copy icon to copy individual values to your clipboard. 3 ###### Type Indicators Color-coded badges show data types: strings (green), numbers (blue), booleans (purple), null (gray). 4 ###### Search & Filter Use the search box to filter the tree view and highlight matching keys or values. ##### When to Use Tree View ###### Exploring APIs Quickly understand the structure of complex API responses. ###### Debugging Data Locate specific values in deeply nested JSON structures. ###### Large Files Navigate large JSON files without scrolling through thousands of lines. ###### Data Analysis Get a visual overview of data hierarchy and relationships. ##### Keyboard Shortcuts Press Cmd/Ctrl + J to quickly toggle between editor and tree view modes. ##### Pro Tip Use tree view in combination with the editor - edit in the code editor, then switch to tree view to verify your changes visually. **See also:** [Mind Map visualization](https://www.jsoncopilot.com/faq/json-mindmap-visualization), [Tree View announcement](https://www.jsoncopilot.com/whats-new/tree-view) #### What AI Copilot features are available? Source: https://www.jsoncopilot.com/faq/ai-copilot-features The AI Copilot helps you understand, analyze, and document your JSON using AI. Access it from the sidebar by clicking **AI Copilot**. AI actions use credits and send your JSON to our servers for processing. ##### Available AI Actions - **Explain JSON:** A human-readable explanation of each field: its purpose, type, and how it relates to others - **Flatten JSON:** Convert nested JSON into flat dot-notation key-value pairs. See [Flatten JSON](https://www.jsoncopilot.com/faq/how-to-flatten-json) for details - **JSON Schema:** Generate a JSON Schema from your data with inferred types, required fields, and constraints - **Schema + Describe:** Generate a JSON Schema with AI-written descriptions for each property - **Test Data:** Generate sample data and variations from your JSON for testing - **Fix & Validate:** Repair invalid JSON in one click. The AI quotes unquoted keys, removes trailing commas, and closes missing brackets, then returns valid JSON. See [Fix invalid JSON](https://www.jsoncopilot.com/faq/how-to-fix-json) for details **Coming soon:** Explain Structure (concise type and nesting overview), and more. ##### Action Details ###### [Explain JSON](https://www.jsoncopilot.com/faq/how-to-use-explain-json) AI writes a description for each field: its purpose, expected values, and how it relates to sibling and parent fields. Useful for onboarding, docs, and reviews. ###### [Flatten JSON](https://www.jsoncopilot.com/faq/how-to-flatten-json) Converts deeply nested JSON into flat dot-notation key-value pairs (e.g. `user.address.city`). Arrays use bracket notation (`items[0].name`). Browse the result as clickable property cards or copy the flat JSON output. ###### [JSON Schema](https://www.jsoncopilot.com/faq/how-to-generate-json-schema) Generates a valid JSON Schema from your data. The AI infers types, required fields, enum constraints, and array item schemas. Use the result to validate future payloads, generate documentation, or integrate with form libraries. ###### [Schema + Describe](https://www.jsoncopilot.com/faq/how-to-use-schema-describe) Generates a JSON Schema and writes an AI description for each property, so the structure ships with its own documentation. ###### [Fix & Validate](https://www.jsoncopilot.com/faq/how-to-fix-json) Repairs broken JSON: unquoted keys, single quotes, trailing commas, and missing brackets or braces. The AI returns valid, formatted JSON that you apply to the editor in one click, without changing your data. ##### Mind Map Sync Several actions (Explain JSON, Flatten, JSON Schema, Schema + Describe) have **bidirectional sync** with the mind map and editors. Click a property in the result to focus the matching node on the mind map and highlight the JSON in the Output tab, and vice versa. ##### How to Use AI Copilot - 1 Paste or type your JSON in the Input or Output tab - 2 Click **AI Copilot** in the left sidebar - 3 Select an action (e.g. Explain JSON, Flatten, JSON Schema) - 4 Click the action button and wait for the result. You can close the panel; results are saved to history. - 5 Review the result in the Copilot panel, then click fields to jump to them in the editor and mind map ##### History All AI actions are saved in your history. Access previous results from the **History** section in the AI Copilot sidebar. History is tied to your account and project. You can close the panel while an action is processing; the result will appear in history when it finishes. **Note:** AI features require an account and use credits. New accounts receive 1,000 free credits. You can purchase additional credits or subscribe to a plan for monthly credits. See [Credits & Pricing](https://www.jsoncopilot.com/faq/credits-and-pricing) for details. #### How do I use Explain JSON to understand my data? Source: https://www.jsoncopilot.com/faq/how-to-use-explain-json The **Explain JSON** action in AI Copilot describes more than structure. AI writes a human-readable description for every field, explaining its purpose, expected values, and how it relates to sibling and parent fields. Ideal for onboarding, documentation, and code reviews. ##### What You Get - **AI-written description** for every field explaining its purpose and meaning - **Type information** and current value shown alongside each description - **Relationships** between fields are explained so you understand the full context - **Clickable properties:** click any field to highlight it in the editor and mind map ##### When to Use It - **Onboarding:** Understand a new API or data format without reading source code or documentation - **Documentation:** Generate field-level documentation from a sample payload - **Code reviews:** Quickly grasp what each field represents in a complex JSON structure - **Debugging:** See what every field means when investigating unexpected data ##### How to Use - 1 Paste or type your JSON in the Input or Output tab - 2 Click **AI Copilot** in the left sidebar - 3 Select **Explain JSON** from the actions list - 4 Click **Explain** and wait for the AI to process your data - 5 Browse the result, clicking any property to jump to it in the editor and mind map ##### Good to Know - **Mind map sync:** Click a property in the result to focus the matching node on the mind map and highlight the JSON in the Output tab, and vice versa. - **History:** Results are saved in your AI Copilot history. You can close the panel while processing; the result will appear in history when it finishes. - **Related actions:** Use [Flatten JSON](https://www.jsoncopilot.com/faq/how-to-flatten-json) to convert nested structures into flat key-value pairs, or [JSON Schema](https://www.jsoncopilot.com/faq/how-to-generate-json-schema) to generate a schema from your data. **Note:** AI features require an account and use credits. New accounts receive 1,000 free credits. See [Credits & Pricing](https://www.jsoncopilot.com/faq/credits-and-pricing) for details. #### How do I generate a JSON Schema with AI descriptions? Source: https://www.jsoncopilot.com/faq/how-to-use-schema-describe The **Schema + Describe** action generates a JSON Schema and adds an AI-written `description` to each property. The descriptions cover what each field means and the values it expects, so the schema doubles as your reference. ##### What You Get - A valid **JSON Schema (Draft-07)** with inferred types, required fields, and constraints - **AI-written descriptions** on each property explaining its purpose and expected values - **Clickable properties** to jump between the schema, editor, and mind map - **Apply to validator:** one click to load the schema into the validation panel ##### When to Use It - **API documentation:** Generate a self-documenting schema for OpenAPI specs or developer portals - **Team onboarding:** Share a schema that explains what every field means without separate docs - **Data contracts:** Define documented data contracts between frontend and backend teams - **Code generation:** Use the described schema with tools that generate types or forms from JSON Schema ##### How to Use - 1 Paste or type your JSON in the Input or Output tab - 2 Click **AI Copilot** in the left sidebar - 3 Select **Schema + Describe** from the actions list - 4 Click **Generate** and wait for the AI to analyze and describe your data - 5 Browse the result with descriptions, copy the schema, or click **Apply to Validator** ##### Good to Know - **Mind map sync:** Click a property in the schema result to focus the matching node on the mind map and highlight the JSON in the Output tab, and vice versa. - **Just need the schema?** Use [JSON Schema](https://www.jsoncopilot.com/faq/how-to-generate-json-schema) for a faster result without descriptions. - **History:** Results are saved in your AI Copilot history. You can close the panel while processing; the result will appear in history when it finishes. **Note:** AI features require an account and use credits. New accounts receive 1,000 free credits. See [Credits & Pricing](https://www.jsoncopilot.com/faq/credits-and-pricing) for details. #### How do I fix invalid JSON? Source: https://www.jsoncopilot.com/faq/how-to-fix-json JSON Copilot fixes invalid JSON two ways. The validator flags each syntax error so you can correct it by hand, and the AI **Fix & Validate** action repairs the whole document in one click. Paste your broken JSON into the [editor](https://www.jsoncopilot.com/editor) and use whichever is faster. ##### Fix it in one click - Paste the broken JSON into the editor. - Open **AI Copilot** from the left sidebar and choose **Fix & Validate**. - The AI returns valid, formatted JSON. Click **Apply to Input** to replace your text. #### Common reasons JSON is invalid Problem Looks like Fix Unquoted key`name: "Ada"`Wrap the key in double quotes Single quotes`'Ada'`JSON requires double quotes Trailing comma`["a", "b",]`Remove the comma after the last item Missing bracket`{ "a": 1`Close the object or array Python literals`True / None`JSON uses `true` and `null` Comments`// note`Standard JSON has no comments For the full rules, see [JSON syntax rules](https://www.jsoncopilot.com/faq/json-syntax-rules). #### Fix it by hand with the validator The editor validates as you type and marks the exact line and column of each error with a message. Work down the list, fix each one, and the red markers clear when the JSON parses. This keeps everything in your browser and costs nothing. See [understanding validation errors](https://www.jsoncopilot.com/faq/understanding-validation-errors) for what each message means, or open the [JSON validator](https://www.jsoncopilot.com/json-validator). #### Fix it automatically with AI When a payload has several problems at once, the **Fix & Validate** action is faster. It repairs the syntax and returns valid JSON you can apply in one click. Here is a typical repair: Before ``` { name: 'Ada', "roles": ["admin", "editor",], "active": True } ``` After ``` { "name": "Ada", "roles": ["admin", "editor"], "active": true } ``` Fix targets syntax only — it quotes keys, removes trailing commas, and closes brackets, and is designed to leave your field names and values untouched. As with any AI action, review the result before applying it. It is an AI Copilot action, so it needs sign-in and uses credits priced by the size of your JSON. See [AI Copilot features](https://www.jsoncopilot.com/faq/ai-copilot-features) and [credits and pricing](https://www.jsoncopilot.com/faq/credits-and-pricing). Once the JSON is valid, [format it](https://www.jsoncopilot.com/faq/how-to-format-json) to clean up the indentation, or explore it in the [tree view](https://www.jsoncopilot.com/faq/how-to-use-tree-view). ### Usage & Getting Started #### How do I get started with JSON Copilot? Source: https://www.jsoncopilot.com/faq/getting-started-guide This guide gets you working with JSON Copilot in a few minutes, whether you're formatting JSON for the first time or exploring advanced features. ##### Quick Start Paste JSON → Click Format → Done. That's the whole first workflow. ##### Your First JSON Workflow 1 ###### Add Your JSON Paste JSON directly into the editor or use the "Import" button to load a file from your computer. Tip: Press Cmd/Ctrl + V to paste 2 ###### Format or Minify Click "Format" to beautify JSON with proper indentation, or "Minify" to compress for production use. Shortcuts: Cmd/Ctrl + Enter Format | Cmd/Ctrl + M Minify 3 ###### Explore & Edit Use the advanced code editor for powerful editing, or switch to Tree View to visually explore your JSON structure. 4 ###### Copy or Export Click "Copy" to copy to clipboard or "Export" to download as a .json file. Shortcut: Cmd/Ctrl + K Copy ##### Essential Features ###### Format & Beautify Transform messy, minified JSON into readable, properly indented code. ###### Minify & Compress Remove whitespace to reduce file size for production deployments. ###### Tree View Visualize JSON hierarchy with an interactive, collapsible tree structure. ###### Validation Real-time error detection highlights syntax issues as you type. ##### Customize Your Experience Click the Settings icon (gear) in the top right to customize: - **Theme:** Switch between light and dark mode - **Font Size:** Adjust editor font size for readability - **Indentation:** Choose 2 or 4 spaces for formatting - **Auto-Format:** Automatically format on paste ##### Need Help? Check out our other FAQ pages for detailed guides on specific features, or press ? to see all keyboard shortcuts. **See also:** [keyboard shortcuts](https://www.jsoncopilot.com/faq/keyboard-shortcuts), [formatting JSON](https://www.jsoncopilot.com/faq/how-to-format-json), [AI Copilot](https://www.jsoncopilot.com/faq/ai-copilot-features) #### What keyboard shortcuts are available? Source: https://www.jsoncopilot.com/faq/keyboard-shortcuts JSON Copilot combines the editor's keyboard shortcuts with custom app shortcuts for JSON operations. Use them to work faster without reaching for the mouse. ##### Two Layers of Shortcuts **Editor:** Standard shortcuts (formatting, navigation, editing) | **App Shortcuts:** JSON Copilot features (minify, copy, schema) ##### JSON Copilot Operations Format JSON Cmd/Ctrl + Enter Minify JSON Cmd/Ctrl + M Copy to Clipboard Cmd/Ctrl + K Toggle View (Text/Tree) Cmd/Ctrl + J Toggle Schema Panel Cmd/Ctrl + S Clear Editor Cmd/Ctrl + L ##### Editor Navigation Find Cmd/Ctrl + F Replace Cmd/Ctrl + H Go to Line Cmd/Ctrl + G Jump to Top Cmd/Ctrl + Home Jump to Bottom Cmd/Ctrl + End Fold/Unfold Cmd/Ctrl + Shift + [ / ] ##### Text Editing Undo Cmd/Ctrl + Z Redo Cmd/Ctrl + Shift + Z Select All Cmd/Ctrl + A Cut Line Cmd/Ctrl + X Copy Line Cmd/Ctrl + C Paste Cmd/Ctrl + V Delete Line Cmd/Ctrl + Shift + K Duplicate Line Cmd/Ctrl + Shift + D ##### Advanced Editing Add Cursor Above Cmd/Ctrl + Alt + ↑ Add Cursor Below Cmd/Ctrl + Alt + ↓ Select Next Match Cmd/Ctrl + D Multi-Cursor Alt + Click Comment Toggle Cmd/Ctrl + / Indent Cmd/Ctrl + ] Outdent Cmd/Ctrl + [ Move Line Up Alt + ↑ ##### Pro Tip Print this page or bookmark it as a reference. Most shortcuts work the same way across modern code editors, so they'll feel familiar if you already use one. #### How do I import and export JSON files? Source: https://www.jsoncopilot.com/faq/export-import-json-files JSON Copilot imports and exports JSON files in a few ways: load files from your computer, paste from the clipboard, or export your results. ##### Import Methods 1 ###### Paste from Clipboard Paste JSON directly into the editor using Cmd/Ctrl + V. This is the quickest way to start. 2 ###### Import from File Click the "Import" button in the toolbar to open a file picker, then select a .json file. JSON Copilot loads and validates the contents. ##### Export Methods ###### Copy to Clipboard Click the "Copy" button or press Cmd/Ctrl + K Perfect for pasting into code editors, emails, or documents. ###### Download as File Click the "Export" button to download your JSON as a .json file Saves to your Downloads folder with automatic file naming. ##### Automatic Validation ##### Instant Validation on Import When you import or paste JSON, JSON Copilot automatically validates the syntax. Invalid JSON triggers clear error messages with line numbers to help you fix issues quickly. ##### Supported File Types 📄 ###### .json Standard JSON files ⚙️ ###### .jsonc JSON with comments 📋 ###### .txt Plain text with JSON ##### Privacy Note File imports and exports happen entirely in your browser. These operations do not send data to any server. ##### Pro Tip You can import files one after another. JSON Copilot replaces the current content each time. To work with multiple JSON files at once, use browser tabs to keep several instances open. #### How do credits and pricing work? Source: https://www.jsoncopilot.com/faq/credits-and-pricing JSON Copilot's core features (formatting, validation, minification, schema checks, tree view) are completely free — no account, no credits, no upload. AI Copilot features use a credit-based system. ##### How Credits Work - Each AI action uses credits based on the complexity of your JSON - New accounts receive **1,000 free credits** at signup - Your credit balance is shown in the sidebar and on your profile page ##### Getting More Credits ###### Monthly Subscriptions Subscribe to a plan (Mini, Starter, Pro, or Ultra) to receive monthly credits that refresh each billing cycle. Higher tiers include more credits and additional features. ###### Credit Packs Purchase one-time credit packs if you prefer not to subscribe. Credits from packs are valid for 6 months. ###### What's Always Free? - JSON formatting and beautifying - JSON minification - Real-time syntax validation - JSON Schema validation - Tree view and JSON navigation - Import and export JSON files ##### View Plans Visit the [Pricing page](https://www.jsoncopilot.com/pricing) to compare subscription plans and credit packs. You can manage your subscription from your [Profile page](https://www.jsoncopilot.com/profile). #### What is JSON? Source: https://www.jsoncopilot.com/faq/what-is-json JSON (JavaScript Object Notation) is a lightweight, text-based format for storing and exchanging data. It represents data as **key-value pairs** and **ordered lists**, is easy for both people and machines to read, and is the most widely used data format for APIs and web applications today. ##### A quick example ``` { "name": "Ada Lovelace", "age": 36, "active": true, "roles": ["admin", "editor"], "address": { "city": "London" } } ``` ##### What JSON is made of - **Objects**: unordered collections of key-value pairs wrapped in curly braces `{ }` - **Arrays**: ordered lists of values wrapped in square brackets `[ ]` - **Values**: a string, number, `true`, `false`, `null`, object, or array - **Keys**: always strings wrapped in double quotes ##### Where JSON is used - REST and GraphQL APIs, the default way web services send and receive data - Configuration files such as `package.json` and `tsconfig.json` - NoSQL databases like MongoDB, and log/analytics events - Data exchange between almost any two systems or languages JSON looks like JavaScript objects, but it is a **language-independent** format. Virtually every programming language can read and write it. ##### Work with JSON instantly Paste any JSON into the [JSON Copilot editor](https://www.jsoncopilot.com/editor) to [format](https://www.jsoncopilot.com/json-formatter) it, [validate](https://www.jsoncopilot.com/json-validator) it, or explore it as a [tree or mind map](https://www.jsoncopilot.com/json-tree-viewer), all in your browser. New here? See [Getting Started](https://www.jsoncopilot.com/faq/getting-started-guide). #### What are the rules of JSON syntax? Source: https://www.jsoncopilot.com/faq/json-syntax-rules JSON has a small, strict set of syntax rules. Data is built from **objects** (`{ }`) and **arrays** (`[ ]`); keys must be double-quoted strings; and values can only be a string, number, `true`, `false`, `null`, object, or array. ##### Valid JSON ``` { "id": 1042, "title": "Hello", "tags": ["a", "b"], "published": true, "meta": null } ``` ##### The rules - Keys and string values use **double quotes**, not single quotes - Separate key-value pairs and array items with commas, but **no trailing comma** after the last one - Numbers are written plainly (`42`, `3.14`, `-1e5`) with no quotes - Use the literals `true`, `false`, and `null` (lowercase) - **Comments are not allowed** in standard JSON ##### Common mistakes - Trailing comma: `[1, 2, 3,]` - Single quotes: `{ 'name': 'Ada' }` - Unquoted keys: `{ name: "Ada" }` - Adding comments: `// like this` Not sure if your JSON is valid? Paste it into the [JSON validator](https://www.jsoncopilot.com/json-validator). It flags the exact line and reason for any error as you type. Learn more in [fixing validation errors](https://www.jsoncopilot.com/faq/understanding-validation-errors). #### What data types does JSON support? Source: https://www.jsoncopilot.com/faq/json-data-types JSON supports exactly **six data types**: **string**, **number**, **boolean**, **null**, **object**, and **array**. That small set is deliberate: it keeps JSON simple and portable across every programming language. ``` { "string": "hello", "number": 42.5, "boolean": true, "nothing": null, "object": { "nested": "value" }, "array": [1, 2, 3] } ``` ##### The six types explained - **String**: text in double quotes: `"hello"` - **Number**: integer or decimal, no quotes: `42`, `3.14`, `-1e10` - **Boolean**: `true` or `false` - **Null**: the empty value: `null` - **Object**: key-value pairs in `{ }` - **Array**: an ordered list in `[ ]` JSON has **no** built-in date, undefined, function, or comment types. Dates are usually stored as ISO strings like `"2026-01-15T10:00:00Z"`. Want to see the types in your own data? Paste it into the [tree viewer](https://www.jsoncopilot.com/json-tree-viewer), or read about [JSON syntax rules](https://www.jsoncopilot.com/faq/json-syntax-rules) and [JSON objects](https://www.jsoncopilot.com/faq/what-is-a-json-object). #### What is a JSON object? Source: https://www.jsoncopilot.com/faq/what-is-a-json-object A JSON object is an **unordered collection of key-value pairs** wrapped in curly braces `{ }`. Each key is a double-quoted string, followed by a colon, then its value. Objects are the main building block of almost every JSON document. ``` { "id": 7, "name": "Ada", "address": { "city": "London", "zip": "EC1A" } } ``` ##### Key things to know - Keys must be **double-quoted strings** and should be unique within the object - Values can be any JSON type, including another object (**nesting**) - Pairs are separated by commas, with **no trailing comma** - Order is not guaranteed to be meaningful; objects are conceptually unordered Objects and [arrays](https://www.jsoncopilot.com/faq/what-is-a-json-array) together form all JSON structures. Explore a nested object visually in the [tree viewer](https://www.jsoncopilot.com/json-tree-viewer) or as a [mind map](https://www.jsoncopilot.com/json-to-mindmap). #### What is a JSON array? Source: https://www.jsoncopilot.com/faq/what-is-a-json-array A JSON array is an **ordered list of values** wrapped in square brackets `[ ]` and separated by commas. Unlike object keys, array items have a position (index) that matters: the first item is index 0. ``` { "tags": ["news", "tech", "ai"], "scores": [98, 76, 100], "users": [ { "name": "Ada" }, { "name": "Alan" } ] } ``` ##### Key things to know - Items can be **any JSON type**, and commonly are objects (an array of records) - Items keep their **order**; position is meaningful - An array can be empty: `[]` - No trailing comma after the last item Arrays of objects are the typical shape of an API response. See how they relate to [JSON objects](https://www.jsoncopilot.com/faq/what-is-a-json-object), or flatten a deeply nested array with the [flatten tool](https://www.jsoncopilot.com/flatten-json). #### How do I open and read a JSON file? Source: https://www.jsoncopilot.com/faq/how-to-open-json-file A `.json` file stores plain text. Open it in a text editor to read its contents, or use a JSON viewer to format the text and expand nested objects. You do not need to convert the file or install a special application just to read it. #### Open a JSON file in your browser - Open the [JSON Copilot editor](https://www.jsoncopilot.com/editor). - Select **Import** in the toolbar and choose your `.json` file. You can also paste the text directly into the input panel. - Select **Format** to add indentation, or open the [tree viewer](https://www.jsoncopilot.com/json-tree-viewer) to expand and collapse objects and arrays. Importing, formatting, and tree navigation work without an account and process the file in your browser. AI actions and saving a cloud project are separate features that send data for processing or storage. #### Open a JSON file on Windows or Mac On Windows, right-click the file, choose **Open with**, and select Notepad or a code editor. On a Mac, Control-click the file and choose **Open With**, then TextEdit or a code editor. If double-clicking opens the wrong app, choose the editor explicitly; the file association does not tell you whether the JSON is valid. If you edit the file, save a copy as plain text with its `.json` extension. Rich text and typographic quotation marks are not valid JSON syntax. For example, the key `"name"` needs straight double quotes. #### Read and format JSON in VS Code Open the file in VS Code and choose **Format Document** from the editor context menu. VS Code supports JSON syntax highlighting, folding, and validation. If formatting fails, check the indicated syntax errors first. Its JSON with Comments mode also accepts comments, but standard JSON files do not. See the [official VS Code JSON guide](https://code.visualstudio.com/docs/languages/json) for editing and schema settings. #### What should the opened file look like? This is a small JSON object. The `name` value is a string, `active` is a boolean, and `orders` is an array containing another object. ``` { "name": "Ada", "active": true, "orders": [ { "id": 42, "total": 18.5 } ] } ``` The same data can be stored on one long line. That is minified JSON; formatting adds whitespace without changing the values. In the tree viewer, expand `orders`, then its first item, to find `total`. #### Open JSON as rows and columns in Excel Excel versions with the JSON Power Query connector can import it through **Data → Get Data → From File → From JSON**. Choose your file, then expand the records or lists into the columns you need. Availability depends on your Excel version and platform; see [Microsoft’s import instructions](https://support.microsoft.com/en-us/excel/import-data-from-data-sources-power-query). For an array of records, you can also use [JSON to Excel](https://www.jsoncopilot.com/json-to-excel) or [JSON to CSV](https://www.jsoncopilot.com/json-to-csv). Renaming `.json` to `.xlsx` or `.csv` does not convert the file. #### Why will the file not open or format? - **A syntax error:** trailing commas, single quotes, comments, or missing brackets can stop parsing. Use the [JSON validator](https://www.jsoncopilot.com/json-validator) to find the problem. - **A different format:** a file beginning with an HTML page or an error message may be a failed download. A `.jsonl` file contains separate JSON values on separate lines and must be read one record at a time. - **A large export:** formatting, tree views, and mind maps need memory beyond the original file size. Start with a smaller sample or a local streaming tool if the browser becomes slow. JSON’s text format and value types are defined in [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259). To understand the structure after opening your file, read about [JSON objects](https://www.jsoncopilot.com/faq/what-is-a-json-object) and [arrays](https://www.jsoncopilot.com/faq/what-is-a-json-array). ### Privacy & Security #### Is my JSON data safe and private? Source: https://www.jsoncopilot.com/faq/is-my-data-safe Yes — for all core features, your JSON stays in your browser. All core features (formatting, validation, minification, schema checks) run entirely in your browser. AI-powered features send your JSON to our servers for processing. ##### Client-Side Processing All essential JSON operations happen locally on your device: - **Formatting:** Processed locally, never sent to servers - **Minifying:** Performed in your browser - **Validation:** Syntax checking happens client-side - **Schema validation:** Validated locally using Ajv library ###### What This Means for You - • Core features (format, validate, minify, schema) run in your browser - • AI features send JSON to our servers for processing - • Projects and AI history are stored on our servers for authenticated users - • We do not use your data for AI model training ##### Best Practices for Maximum Privacy ###### For Sensitive Data - • Clear browser cache after use - • Use private browsing mode - • Don't share URLs with JSON data ###### Security Features - • No server-side storage for core features - • No analytics tracking of JSON content - • We never sell your data or share your JSON with advertisers — the service providers that run the product (AI, hosting, payments, analytics) are listed in our privacy policy - • Isolated browser environment **Technical Note:** JSON Copilot uses localStorage to remember your preferences (theme, indentation settings). For authenticated users, project data and AI history are stored on our servers. **See also:** [client-side processing](https://www.jsoncopilot.com/faq/client-side-processing) #### What does "client-side processing" mean? Source: https://www.jsoncopilot.com/faq/client-side-processing "Client-side processing" means core JSON operations (formatting, validation, minification, schema checks) happen directly in your web browser, on your device, rather than being sent to a remote server. AI Copilot features (such as Explain, Flatten, and Schema generation) do send your JSON to our servers for processing. ##### Core Processing Stays on Your Device When you format, validate, minify, or check JSON schema in JSON Copilot, it's processed entirely within your browser. AI Copilot features (such as Explain, Flatten, and Schema generation) require server-side processing and will send your JSON to our servers. ##### How It Works 1 ###### Browser-Based Engine JSON Copilot runs 100% in your browser using JavaScript. All formatting, minification, validation, and tree view generation happens on your device's CPU. 2 ###### No Network Requests Your JSON content is never transmitted over the network. Open your browser's Network tab and you'll see that no request carries your JSON — formatting, minifying, and validating all happen entirely on your device. (Any traffic you do see is ordinary page analytics, which never includes your JSON content.) 3 ###### Instant Results Because everything runs locally, operations are instant, with no waiting for server responses or network latency. ##### Client-Side vs Server-Side ###### Client-Side (JSON Copilot) - ✓ Data stays on your device - ✓ No internet required for core features - ✓ Instant processing - ✓ Complete privacy - ✓ No server-imposed file size limits - ✓ Free for core features - no server costs ###### Server-Side (Traditional) - ✗ Data uploaded to servers - ✗ Requires internet connection - ✗ Network latency delays - ✗ Privacy concerns - ✗ Upload size restrictions - ✗ May require payment ##### Security & Privacy Benefits ###### Client-Side Core Features Core operations (formatting, validation, minification, schema checks) never leave your browser, reducing exposure of sensitive data. ###### Server-Side AI Features AI features and saved projects are stored on our servers. Avoid using AI features with highly sensitive data. ###### No Logging For the client-side tools, we can't log what we never see — that JSON never reaches us or any third party. Only when you run an optional AI action does your JSON — with detected sensitive values masked — reach our servers and the AI provider. ###### Sensitive Data Safe In the core client-side tools, work confidently with API keys, credentials, or proprietary data — formatting, validating, and converting never upload anything. If you use AI actions, detected sensitive values are masked on your device before anything is sent. ##### Verify It Yourself You can confirm this yourself. Open your browser's Developer Tools → Network tab while using JSON Copilot, and you'll see that no request carries your JSON when you format, minify, or validate — any traffic you do see is ordinary page analytics, which never includes your JSON content. ##### Note on AI Features While core JSON operations are 100% client-side, AI Copilot features (when used) do require sending data to our servers. These features are clearly labeled, optional, and use a credit-based system. **See also:** [data privacy](https://www.jsoncopilot.com/faq/is-my-data-safe) ### Setup & Configuration #### Which browsers are supported? Source: https://www.jsoncopilot.com/faq/browser-compatibility JSON Copilot works on all modern browsers. It supports the latest versions of Chrome, Firefox, Safari, Edge, and other Chromium-based browsers, and is built with web standards and progressive enhancement for broad compatibility. ##### Fully Supported Browsers JSON Copilot is tested on the latest versions of all major browsers. Keep your browser up to date for the best experience. ##### Supported Browsers 🌐 ###### Google Chrome Version 90+ Recommended for best performance and features. 🦊 ###### Mozilla Firefox Version 88+ Excellent privacy features. Full functionality supported. 🧭 ###### Safari Version 14+ (macOS & iOS) Native macOS and iOS experience. 🌊 ###### Microsoft Edge Version 90+ Chromium-based. Full feature parity with Chrome. ⚡ ###### Brave Version 1.25+ Privacy-focused Chromium browser. Fully supported. 🎨 ###### Opera Version 76+ Chromium-based. Full compatibility. ##### Mobile Browser Support ###### iOS (iPhone/iPad) Safari 14+, Chrome 90+, Firefox 88+ Works great on all modern iOS browsers ###### Android Chrome 90+, Firefox 88+, Samsung Internet 14+ Full support on all modern Android browsers ##### Required Browser Features JSON Copilot requires these modern web features: ES6+ JavaScript LocalStorage API Fetch API CSS Grid & Flexbox File API ##### Performance Recommendations ###### Best Performance Chrome, Edge, or Brave on desktop for optimal editor performance and large file handling. ###### Privacy-Focused Firefox or Brave for enhanced privacy features while maintaining full functionality. ###### Mobile Users Use Chrome, Safari, or Firefox on mobile for full functionality. ###### macOS/iOS Native Safari for tight macOS/iOS integration and native performance. ##### Older Browsers Internet Explorer is not supported. If you're using an older browser version, please update to the latest version for security and performance improvements. ##### Cross-Browser Tested We test JSON Copilot across all major browsers for consistent functionality and appearance. If you hit a browser-specific issue, report it so we can fix it. #### How do I customize theme and settings? Source: https://www.jsoncopilot.com/faq/customize-theme-settings Customize the editor theme, font size, indentation, and more through the Settings panel. Your preferences are saved locally and persist across sessions. ##### Access Settings Click the gear icon in the top-right corner to open the Settings panel and customize your experience. ##### Theme Options ###### Light Mode Clean, bright interface perfect for well-lit environments. Easy on the eyes during daytime work. ###### Dark Mode Reduces eye strain in low-light conditions. Popular among developers for extended coding sessions. ##### Editor Customization ###### Font Size Adjust editor font size from 12px to 24px for optimal readability. 12px - Small 14px - Default 16px - Large 18px+ - Extra Large ###### Indentation Choose indentation style for formatted JSON. 2 Spaces 4 Spaces (Default) Tabs ###### Line Height Adjust spacing between lines for better readability. ###### Word Wrap Enable or disable automatic line wrapping for long lines. ###### Minimap Show or hide the code minimap for easier navigation in large files. ##### Behavior Settings ###### Auto-Format on Paste Automatically format JSON when pasting into the editor. ###### Auto-Save Automatically save your work to browser storage as you type. ###### Validation Mode Real-time validation or validate only on demand. ###### Default View Choose between Editor or Tree View as default on startup. ##### Keyboard Shortcuts View and customize keyboard shortcuts for common actions: - Format, Minify, Copy shortcuts - Editor navigation and text manipulation - Toggle between views ##### Reset Settings ##### Restore Defaults If something doesn't look right or you want to start fresh, click "Reset to Defaults" in the Settings panel to restore all original settings. ##### Local Settings All settings are stored locally in your browser using localStorage. Your preferences are not synced to any server. ### Advanced Topics #### Can JSON Copilot handle large JSON files? Source: https://www.jsoncopilot.com/faq/working-with-large-json-files JSON Copilot is built to handle large JSON files efficiently. With the code editor and client-side processing, you can work with files containing thousands of lines, deeply nested structures, and large arrays without noticeable slowdown. ##### Client-Side Processing Unlike server-based JSON formatters, JSON Copilot processes files locally in your browser. There are no server-imposed upload limits. Performance depends on your device's memory and browser capabilities. ##### Performance Capabilities Multi-MB ###### Large Files Handle files several megabytes in size 100K+ ###### Lines of Code Handle files with 100,000+ lines efficiently Deep ###### Nesting Navigate heavily nested structures easily ##### Tips for Large Files 1 ###### Use Tree View for Navigation For files with thousands of lines, switch to Tree View (Cmd/Ctrl + J) to navigate structure visually without scrolling through massive text blocks. 2 ###### Use Code Folding Click the arrows next to line numbers to collapse/expand sections. Focus on relevant parts by hiding large nested objects or arrays. 3 ###### Use Find (Cmd/Ctrl + F) Instead of scrolling, use the editor's search to jump directly to specific keys, values, or patterns in large files. 4 ###### Disable Minimap if Needed For extremely large files (50K+ lines), disable the minimap in Settings to free up screen space and improve rendering performance. 5 ###### Minify Before Sharing If you need to share or store large JSON, minify it to reduce file size by 60-80%, making transfers faster. ##### Performance Optimizations ###### Lazy Rendering The editor only renders visible lines, keeping large files fast and responsive. ###### Efficient Parsing Browser-native JSON.parse() handles large payloads efficiently without server round-trips. ###### Collapsible Tree View Tree View lets you collapse and expand nodes to focus on the parts of your JSON that matter. ###### Incremental Validation Validation runs incrementally as you type, avoiding full re-validation on every keystroke. ##### When You Might Hit Limits ##### Browser Memory Limits Very large files (10 MB+) may slow down the editor, and extremely large files can approach browser memory limits, especially on mobile devices or older computers. Workaround: Split very large files into smaller chunks, or use a desktop computer with more RAM for massive datasets. ##### Real-World Performance In practice, JSON Copilot handles most real-world JSON files easily, including large API responses, database exports, and configuration files. **See also:** [tree view](https://www.jsoncopilot.com/faq/how-to-use-tree-view), [mind map](https://www.jsoncopilot.com/faq/json-mindmap-visualization) #### How do I fix JSON validation errors? Source: https://www.jsoncopilot.com/faq/understanding-validation-errors JSON syntax errors are easier to fix when you can see them clearly. The editor provides real-time error detection with clear messages, line numbers, and suggestions. This guide covers common validation errors and how to fix them. ##### Real-Time Error Detection The editor highlights syntax errors as you type, with red squiggly underlines and detailed error messages when you hover. ##### Common JSON Errors & Fixes ###### ❌ Missing or Extra Comma ❌ Incorrect: ``` { "name": "Alice" "age": 30 } ``` ✅ Correct: ``` { "name": "Alice", "age": 30 } ``` Fix: Add comma between properties, but NOT after the last property. ###### ❌ Unquoted Keys ❌ Incorrect: ``` { name: "Alice", age: 30 } ``` ✅ Correct: ``` { "name": "Alice", "age": 30 } ``` Fix: All keys must be wrapped in double quotes. ###### ❌ Single Quotes Instead of Double ❌ Incorrect: ``` { 'name': 'Alice', 'age': 30 } ``` ✅ Correct: ``` { "name": "Alice", "age": 30 } ``` Fix: JSON requires double quotes (") not single quotes ('). ###### ❌ Trailing Comma ❌ Incorrect: ``` { "name": "Alice", "age": 30, } ``` ✅ Correct: ``` { "name": "Alice", "age": 30 } ``` Fix: Remove comma after the last property or array element. ###### ❌ Mismatched Brackets ❌ Incorrect: ``` { "items": [1, 2, 3} ] ``` ✅ Correct: ``` { "items": [1, 2, 3] } ``` Fix: Match opening [ with closing ], and opening { with closing }. ###### ❌ Comments in JSON ❌ Incorrect: ``` { // This is a comment "name": "Alice" } ``` ✅ Correct: ``` { "name": "Alice" } ``` Fix: Standard JSON doesn't support comments. Remove them or use JSONC format. ##### Error Location Tips ###### Check Line Numbers Error messages include line and column numbers - use Cmd/Ctrl + G to jump directly to the error location. ###### Bracket Matching Click next to a bracket - the editor highlights the matching bracket to help identify mismatched pairs. ###### Look Above the Error Missing commas often report errors on the next line. Check the line above for missing commas. ###### Use Format to Auto-Fix If JSON is valid but poorly formatted, use Format (Cmd/Ctrl + Enter) to reveal structure. ##### Quick Fix Workflow 1 Look for red squiggly underlines in the editor 2 Hover over the underline to read the error message 3 Apply the fix based on the error type 4 Verify the error disappears as you type ##### Pro Tip: Copy Valid JSON First If you're struggling with errors in manually typed JSON, try copying a small valid JSON example first, then modify it. This ensures the basic structure is correct. **See also:** [JSON Schema validation](https://www.jsoncopilot.com/faq/what-is-schema-validation) #### Can you use comments in JSON? Source: https://www.jsoncopilot.com/faq/json-comments No. **Standard JSON does not support comments**. The format was intentionally kept minimal for data interchange, so `//` and `/* */` will cause a parse error. There are, however, a few common workarounds. ##### This is invalid JSON ``` { // the user's name "name": "Ada" } ``` ##### Workarounds - **Use a "comment" key**: add a harmless field like `"_comment": "note here"` that your code ignores. - **Use JSONC or JSON5**: relaxed supersets that allow comments. Many tools (VS Code settings, `tsconfig.json`) use JSONC. - **Strip comments before parsing**: some loaders remove comments first, but standard `JSON.parse` will not. If you need comments for configuration humans edit by hand, consider [YAML](https://www.jsoncopilot.com/faq/json-vs-yaml), which supports them natively. Getting an error from a stray comment? The [JSON validator](https://www.jsoncopilot.com/json-validator) points to the exact line. #### How do I escape characters in JSON? Source: https://www.jsoncopilot.com/faq/how-to-escape-characters-in-json Inside a JSON string, certain characters must be **escaped with a backslash** so the parser does not misread them, most importantly the double quote and the backslash itself. Escaping lets you store quotes, newlines, tabs, and any Unicode character safely. ##### Escape sequences Sequence Meaning `\"`Double quote `\\`Backslash `\n`New line `\t`Tab `\r`Carriage return `\/`Forward slash (optional) `\uXXXX`Unicode character (hex) ##### Example ``` { "quote": "She said \"hello\"", "path": "C:\\Users\\me", "line": "first\nsecond" } ``` In code, you rarely escape by hand. `JSON.stringify()` (JS) or `json.dumps()` (Python) escapes everything correctly for you. See [parsing JSON in JavaScript](https://www.jsoncopilot.com/faq/how-to-parse-json-javascript). Unbalanced quotes or a stray backslash? The [validator](https://www.jsoncopilot.com/json-validator) flags the exact spot. #### How do I parse JSON in JavaScript? Source: https://www.jsoncopilot.com/faq/how-to-parse-json-javascript In JavaScript you parse JSON with the built-in **`JSON.parse()`**, which turns a JSON string into a JavaScript object. To go the other way, **`JSON.stringify()`** converts an object back into a JSON string. No library is needed. ``` // String -> object const obj = JSON.parse('{ "name": "Ada", "age": 36 }'); console.log(obj.name); // "Ada" // Object -> string const text = JSON.stringify(obj); // Pretty-printed with 2-space indent const pretty = JSON.stringify(obj, null, 2); ``` ##### Handle invalid JSON safely `JSON.parse` throws a `SyntaxError` on malformed input, so wrap it in a try/catch: ``` try { const data = JSON.parse(input); } catch (err) { console.error("Invalid JSON:", err.message); } ``` ##### Fetching JSON from an API ``` const res = await fetch("/api/users"); const data = await res.json(); // parses automatically ``` Before parsing, make sure the JSON is valid by pasting it into the [validator](https://www.jsoncopilot.com/json-validator). Reading data in another language? See [JSON in Python](https://www.jsoncopilot.com/faq/how-to-read-json-in-python). #### How do I read JSON in Python? Source: https://www.jsoncopilot.com/faq/how-to-read-json-in-python Python reads JSON with the built-in **`json`** module. Use `json.load()` to read from a file and `json.loads()` to parse a string. JSON objects become Python dictionaries and JSON arrays become lists. ``` import json # Read from a file with open("data.json") as f: data = json.load(f) # Parse from a string data = json.loads('{ "name": "Ada", "age": 36 }') print(data["name"]) # Ada ``` ##### Writing JSON back out ``` # Object -> string (pretty-printed) text = json.dumps(data, indent=2) # Write to a file with open("out.json", "w") as f: json.dump(data, f, indent=2) ``` Tip: remember the difference. `load`/`dump` work with **files**, while `loads`/`dumps` (with an "s") work with **strings**. Invalid JSON raises `json.JSONDecodeError`, so check your data in the [validator](https://www.jsoncopilot.com/json-validator) first. Using JavaScript instead? See [parsing JSON in JavaScript](https://www.jsoncopilot.com/faq/how-to-parse-json-javascript). #### JSON vs XML: what is the difference? Source: https://www.jsoncopilot.com/faq/json-vs-xml JSON and XML both store structured data, but JSON is a lightweight **data format** while XML is a verbose **markup language**. For most modern web APIs, JSON is smaller, faster to parse, and easier to read, which is why it has become the default. XML still appears in enterprise, financial, and document-heavy systems. Aspect JSON XML TypeData formatMarkup language SyntaxKey-value pairs & arraysNested tags SizeSmaller / less verboseLarger (open + close tags) CommentsNot supportedSupported Best forWeb APIs, configsDocuments, enterprise systems ###### JSON example ``` { "user": { "name": "Ada" } } ``` ###### XML example ``` Ada ``` ##### When to use which - **Choose JSON** for web/mobile APIs, microservices, and config, where speed and simplicity win. - **Choose XML** for highly structured documents, mixed content, or systems that mandate it (many banking/enterprise integrations). Working with JSON? [Format](https://www.jsoncopilot.com/json-formatter) and [validate](https://www.jsoncopilot.com/json-validator) it in your browser, or learn [what JSON is](https://www.jsoncopilot.com/faq/what-is-json). #### JSON vs YAML: what is the difference? Source: https://www.jsoncopilot.com/faq/json-vs-yaml JSON and YAML can represent the same data, but they serve different goals. JSON is compact and ubiquitous for **data interchange** (APIs); YAML is indentation-based and built for **human-friendly configuration** files. In fact, JSON is technically a subset of YAML, so most YAML parsers can read JSON. Aspect JSON YAML StructureBraces & bracketsIndentation (whitespace) CommentsNot supportedSupported (`#`) ReadabilityGoodExcellent for configs Best forAPIs, data exchangeConfig (Docker, Kubernetes, CI) ###### JSON ``` { "name": "app", "ports": [80, 443] } ``` ###### YAML ``` name: app ports: - 80 - 443 ``` ##### When to use which - **Choose JSON** for API payloads and anything programs exchange, since it is universal and unambiguous. - **Choose YAML** for config files humans edit often (Docker Compose, Kubernetes, GitHub Actions), where comments and readability matter. Need to tidy up JSON first? [Format](https://www.jsoncopilot.com/json-formatter) or [minify](https://www.jsoncopilot.com/json-minifier) it in your browser, or read [JSON vs XML](https://www.jsoncopilot.com/faq/json-vs-xml). #### JSON vs CSV: what is the difference? Source: https://www.jsoncopilot.com/faq/json-vs-csv JSON and CSV both hold tabular-ish data, but they suit different jobs. **CSV** is a flat, spreadsheet-friendly grid of rows and columns. **JSON** is hierarchical and can represent nested, complex structures that CSV cannot do cleanly. Aspect JSON CSV StructureNested / hierarchicalFlat rows & columns Data typesTyped (number, bool, null…)Everything is text SizeLarger (repeats keys)Very compact Best forAPIs, nested dataSpreadsheets, simple tables ###### JSON ``` [ { "name": "Ada", "age": 36 }, { "name": "Alan", "age": 41 } ] ``` ###### CSV ``` name,age Ada,36 Alan,41 ``` ##### When to use which - **Choose JSON** when data is nested, typed, or comes from an API. - **Choose CSV** for simple flat tables you'll open in Excel or Google Sheets. Working with nested JSON? [Flatten it](https://www.jsoncopilot.com/flatten-json) to a single level, or compare with [JSON vs XML](https://www.jsoncopilot.com/faq/json-vs-xml). ## What's New