Practical articles for developers working with JSON, YAML, and API data.
All articles
The "Unexpected token <" error means JSON.parse received an HTML page (a 404, login redirect, or wrong URL), not JSON. Here's why, with broken/fixed fetch examples.
Read article →The "Unexpected token u" error means you called JSON.parse(undefined). Learn why undefined becomes "undefined", how to guard against it, and a safe-parse helper.
Read article →An unterminated string in JSON means an opening quote has no closing quote — usually an unescaped quote, a raw newline, or truncated data. Broken and fixed examples.
Read article →A bad escaped character in JSON means a backslash is followed by something JSON does not allow. See the full list of valid escapes, plus fixes for \x, paths, and \u.
Read article →This error means there is extra content after a complete JSON value — concatenated objects, NDJSON parsed as one blob, or trailing junk. How to find and fix the extra data.
Read article →Pretty print, format, and beautify mean the same thing for JSON. Learn why, what actually differs (minify, validate, tree view), and how to pretty print JSON online.
Read article →See JSON as an interactive, collapsible tree. Expand and collapse any object or array to navigate large, nested payloads — in your browser, with no upload.
Read article →A YAML formatter re-indents and normalizes YAML so it is readable and diff-friendly. Learn the indentation rules, type traps, and when to format vs convert to JSON.
Read article →Convert XML to JSON the right way: how attributes, text nodes, repeated elements, and namespaces map to JSON — with conventions, edge cases, and JS/Python code.
Read article →Convert JSON to XML: choosing a root element, mapping @-prefixed keys to attributes, turning arrays into repeated elements, and escaping — in JS, Python, and online.
Read article →Convert JSON to CSV and CSV to JSON — in JavaScript, Python, and online. Covers the array-of-objects mapping, quoting rules, nested values, and type coercion.
Read article →Validate JSON syntax with JSON.parse, Python's json.loads, jq, or in your browser — and learn how to check structure and types with JSON Schema.
Read article →JSON.stringify converts a value to a JSON string. Learn the space and replacer arguments, the toJSON hook, and the values it silently drops or throws on.
Read article →JSON vs YAML compared: syntax, types, comments, and gotchas like the Norway problem. YAML is a JSON superset — here's when to use each and how to convert.
Read article →A JWT is three Base64url sections. Learn how to decode the header and payload in JavaScript and Python — and why decoding a token is not the same as verifying it.
Read article →JSON Patch (RFC 6902) sends explicit operations; JSON Merge Patch (RFC 7396) overlays a partial object. Compare both with examples and pick the right one.
Read article →Convert CSV and XML to JSON in JavaScript, Python, and the browser. Covers the array-of-objects mapping, XML attribute handling, and the type-coercion gotchas.
Read article →A practical jq tutorial: install it, pretty-print and minify, select fields, filter arrays with select, transform with map, plus copy-paste command recipes.
Read article →Learn how to convert JSON to TypeScript interfaces — manually, with online tools, and in code. Covers nested objects, optional fields, arrays, nullable types, and keeping types in sync with your API.
Read article →JSON Schema is a vocabulary for describing the structure and constraints of JSON data. Learn the core keywords, see real-world examples, and validate JSON in JavaScript, Python, and your browser.
Read article →Minifying JSON removes all unnecessary whitespace to reduce file size and speed up API responses. Learn how to minify JSON in JavaScript, Python, the command line, and your browser — and when not to bother.
Read article →JSON viewers and JSON formatters look similar but serve different purposes. Learn when to use each tool, what features to look for, and how to choose the right one for your workflow.
Read article →Getting "[object Object] is not valid JSON" or "expected a JSON object, array or literal"? Learn why these errors happen, how to correct JSON syntax, fix trailing commas, and repair broken JSON automatically.
Read article →Trailing commas, single quotes, unquoted keys, Python literals, markdown fences — online JSON fixers handle them all. Learn how repair parsers work, when to use them, and how to keep sensitive data private.
Read article →Copy-pasteable JSON examples covering every data type, nested structures, REST API responses, config files, date formats, and GeoJSON — with common error patterns and their fixes.
Read article →Format JSON with JSON.stringify in JavaScript, json.dumps in Python, jq on the command line, or instantly in your browser. Includes sorting keys, converting YAML and CSV to JSON, and real before/after examples.
Read article →JSON (JavaScript Object Notation) is the universal data interchange format. Learn the six data types, the grammar rules that make JSON strict, where .json files are used, and how to parse JSON in any language.
Read article →JWT tokens, API keys, PII, and database exports are routinely pasted into online formatters. Here's what happens to that data on the server side — and why browser-native tools are the safer choice.
Read article →Raw tabs, newlines, null bytes, and ANSI escape codes inside a JSON string trigger this error. Learn why the JSON spec forbids them, how they sneak in, and how to strip or escape them.
Read article →That lowercase "o" is the second character of "[object Object]". You passed a JavaScript object to JSON.parse() instead of a string. Here's every variant of this mistake and the one-line fix for each.
Read article →The parser hit the end of the string before the structure was complete. Causes range from truncated API responses to unclosed brackets and empty strings. Five patterns, five fixes.
Read article →Base64-encoded strings look scrambled, but anyone can decode them in one function call. Learn what Base64 actually is, why it gets confused with encryption, and what to use when you genuinely need to protect data.
Read article →A plain text diff misses key-reordering and whitespace noise. Learn how a proper JSON diff works: LCS line diffing, semantic tree comparison, key normalisation, and the tradeoffs of each approach.
Read article →Many developers treat JS object literals as JSON. They're not the same: single quotes, unquoted keys, trailing commas, undefined, NaN — here's every difference with examples.
Read article →A single stray comma after the last item in a JSON object or array causes a SyntaxError. Learn why JSON forbids trailing commas, where they come from, and how to remove them.
Read article →"Unexpected token '<'" or "Unexpected token u in JSON at position 0" — these errors stop your app cold. Here's what each variant means and exactly how to fix it.
Read article →JSON.parse() is unforgiving — one stray comma and your app crashes. Learn the most common broken-JSON patterns, how to catch errors gracefully, and when automatic repair is safe.
Read article →The reviver's new context.source argument plus JSON.rawJSON() lets you parse 64-bit IDs without precision loss, verify canonical form, and lock down LLM JSON output — all at native speed. A practical walkthrough now that the API is Baseline 2025.
Read article →