JSON Guides & Tutorials
Practical guides for every JSON task — from parsing basics in JavaScript and Python to schema validation, format conversions, and debugging. All free, with real code examples.
JSON Basics
- What is JSON?JSON data types, syntax rules, and parsing in JavaScript and Python.
- JSON Syntax ReferenceComplete syntax rules: strings, numbers, objects, arrays, and common errors.
- JSON ExamplesObjects, arrays, nested structures, and real-world API patterns.
- JSON ArraysSyntax, nested arrays, arrays of objects, and element access.
- JSON ObjectsKey-value pairs, nested objects, and property access patterns.
- How to Validate JSONFix syntax errors and understand syntax vs schema validation.
- Fix Invalid JSONRepair trailing commas, bad quotes, and unquoted keys.
- JSON Trailing Comma ErrorFind and fix the most common JSON syntax mistake.
JavaScript
- JSON.parse in JavaScriptParse JSON safely with try/catch, revivers, and edge cases.
- JSON.stringify TutorialPretty printing, replacers, toJSON behavior, and circular refs.
- JavaScript Object to JSONConvert JS objects to JSON strings with edge-case handling.
- JSON to JavaScript ObjectParse JSON strings into JavaScript objects safely.
- Parse Nested JSONAccess deeply nested values safely after parsing.
- JSON.parse ErrorsFix trailing commas, single quotes, and malformed input.
- Pretty Print JSON in JSFormat JSON with indentation in browsers and Node.js.
- Fetch JSON with fetch()GET and POST JSON: async/await, error handling, and Node.js.
Python
Format Comparisons
- JSON vs YAMLSyntax differences and when to use each format.
- YAML vs JSONConfig readability, comments, strictness, and tooling fit.
- JSON vs XMLAPIs, documents, schemas, and migration tradeoffs.
- JSON vs BSONText interchange vs binary for MongoDB and APIs.
- JSON vs NDJSONSingle documents vs line-delimited records for logs.
- CSV vs JSONFlat tables vs structured objects and when to convert.
- TOML vs JSONConfig format tradeoffs: comments, strictness, and nesting.
- TOML vs YAMLReadable config formats: type safety and ecosystem fit.
Conversions
- JSON to XML TutorialConvert objects, arrays, and nulls to well-formed XML.
- XML to JSON TutorialMap XML elements and repeated tags to JSON structures.
- JSON to YAML TutorialConvert JSON to readable YAML for configs and manifests.
- JSON to TOML TutorialMap JSON objects to TOML tables and config files.
- JSON to CSV TutorialFlatten JSON arrays into spreadsheet-ready rows.
- CSV to JSON TutorialConvert CSV rows into typed JSON objects.
- JSON to TypeScriptInfer interfaces from API payloads and nested objects.
JSON Schema
- JSON Schema TutorialValidate structure with type, required, enum, and format.
- JSON Schema ExamplesCopy-paste snippets for required fields, enums, and arrays.
- Required FieldsUse required correctly for objects, nested objects, and arrays.
- JSON Schema EnumRestrict values with string enums and nullable patterns.
- Array of Objects SchemaValidate arrays with items, required fields, and nesting.
- JSON Schema vs TypeScriptRuntime vs compile-time validation — when to use each.
- Validate JSON Schema OnlineTest schemas against real data with required fields and enums.
Tools & Workflows
- Pretty Print JSON OnlineFormat and beautify JSON with indentation and validation.
- Minify JSON OnlineCompress JSON by removing whitespace to reduce file size.
- Format JSON in VS CodeFormat on Save, Prettier, and workspace settings.
- Escape JSON StringsEscape backslashes, quotes, and control characters.
- Compare Two JSON FilesFind structural differences between JSON files or responses.
- JSON Diff TutorialHow structural JSON diff works and how to read results.
- Decode a JWT TokenRead JWT headers, payloads, claims, and expiry timestamps.
- Base64 ExplainedHow Base64 works: JWTs, data URIs, and HTTP auth.
- Base64 in JavaScriptbtoa/atob, Node.js Buffer, Unicode, data URIs, and HTTP auth.
- JSONPath Cheat SheetWildcards, slices, recursive descent, and filter expressions.
- URL Encode & DecodePercent encoding: safe characters, JS and Python examples, and common mistakes.