JSON Repair Guides

Step-by-step guides for fixing the most common JSON errors.

How to Decode Base64 Strings (and JWT Payloads)

Base64 is reversible encoding, not encryption. Decode it in one step, handle Unicode correctly, and read JWT sections that use Base64url.

Read guide →

URL Encoding: Percent-Encode Query Parameters and Paths

Percent-encoding replaces unsafe characters with %XX so arbitrary text is safe in a URL. Know which characters to escape and how to decode them back.

Read guide →

Convert YAML to JSON (and Avoid Indentation Errors)

Since YAML 1.2 every JSON document is valid YAML. Convert YAML config to JSON, and watch for indentation and type-inference traps.

Read guide →

Convert JSON to CSV: Flatten an Array of Objects

A JSON array of objects maps to a CSV table — one row per object, columns from the union of keys. The real work is quoting and handling nested values.

Read guide →

Convert JSON to XML: Root Elements, Attributes, and Arrays

XML needs a single root and represents lists as repeated elements. Map @-prefixed keys to attributes and #text to element text for a reversible conversion.

Read guide →

Escape JSON as a String Literal (and Decode Double-Encoded JSON)

Stringifying JSON wraps it in quotes and escapes the inner quotes and special characters, producing a JSON string literal you can safely embed elsewhere.

Read guide →

Fix Trailing Comma in JSON

A trailing comma after the last object property or array item is valid in some JavaScript contexts, but it is not valid JSON.

Read guide →

Fix Single Quotes in JSON

JSON strings and object keys must use double quotes. Single-quoted values are common in JavaScript snippets, Python-like output, and LLM responses.

Read guide →

Fix Unquoted Keys in JSON

Object keys like name, active, and profile must be quoted in valid JSON, even when the key looks like a normal identifier.

Read guide →

Repair LLM JSON Output

AI responses often look like JSON but include markdown fences, comments, Python-style literals, or JavaScript object syntax.

Read guide →

Fix JSON Parse Error: Expected Property Name

This error usually means a parser reached an object key that is not valid JSON: an unquoted key, a comment, a trailing comma, or JavaScript syntax inside a strict JSON document.

Read guide →

JSON vs JS Object Literal: The Key Differences

JSON looks like a JavaScript object literal, but it is a smaller data format with stricter syntax and no executable values.

Read guide →

Validate JSON Before API Requests

A quick validation pass before sending an API request can separate JSON syntax problems from authentication, schema, and backend errors.

Read guide →

JSON Formatter vs JSON Repair

A formatter makes valid JSON easier to read. A repair tool tries to turn almost-JSON into valid JSON before formatting it.

Read guide →

Fix JSON Unexpected Token Errors

Unexpected token means a strict JSON parser reached a character that cannot appear at that position in valid JSON.

Read guide →

JSON to JavaScript Object Converter

Strict JSON can be converted to a JavaScript object with JSON.parse. JavaScript object literals need cleanup before they are valid JSON.

Read guide →