How to format and validate JSON
Work through invalid syntax, large numeric IDs, duplicate keys, and nested JSON strings without changing the data you meant to keep.
Find the first syntax problem
Start with a copy of your payload. JSON object keys and string values use double quotes; comments, trailing commas, and undefined are not JSON. A JavaScript object literal can look almost right while still failing a JSON parser.
The invalid example below has three separate problems. Quote the property name, use double quotes around the string value, then remove the trailing comma. In ADEMN, Format or Validate reports the line and column of a syntax error. Fix the first problem and run the check again; an error later in the file may be caused by an earlier missing quote or comma.
{name: 'ADEMN',}{"name":"ADEMN"}Choose a reading format without changing values
Format adds indentation; Minify removes unnecessary whitespace. Neither operation should alter the characters inside a string. Load the example, select Format, and switch between two and four spaces to see the same structure with a different layout.
Use the tree view to explore an object or a long array. Keep the original input until you have checked the result. Copy and download produce JSON text, while the tree is a reading aid. Syntax validation only checks grammar: it does not prove that a required API field exists or that a field has the expected business meaning.
{"customer":"Sample shop","items":[{"sku":"A-10","quantity":2}],"note":"Keep two spaces"}{
"customer": "Sample shop",
"items": [
{
"sku": "A-10",
"quantity": 2
}
],
"note": "Keep two spaces"
}Keep large IDs and duplicate keys visible
An identifier is often a sequence of characters rather than a quantity to calculate. The example contains a number beyond JavaScript’s safe integer range. A formatter that parses it into an ordinary JavaScript Number and serializes it again can change the digits. ADEMN formats the original numeric text, so this example keeps the value 9007199254740993.
For data exchanged across applications, a quoted identifier is safer when exact digits matter. Duplicate keys are another interoperability problem: ADEMN preserves both occurrences, but another parser may retain only the last. Resolve which value was intended in the source system; pretty-printing does not make that ambiguity disappear.
{"orderId":9007199254740993,"status":"queued","status":"sent"}{"orderId":"9007199254740993","status":"sent"}Distinguish a JSON string from a nested object
Some APIs place serialized JSON inside a string field. In the example, PageData is a string whose contents happen to look like an array. Keep escapes shows its encoded characters. Turning it off makes string values easier to read, but the field remains a string; it is not converted into an array.
The reading view can contain decoded quotes or line breaks that are not valid JSON text on their own. Copy, download, and Use as input retain the escapes needed for valid JSON. If you need to inspect the inner array as data, copy its decoded contents into a separate input and validate that contents independently. The separate Escape and Unescape actions apply to an outer quoted JSON string, not an arbitrary field transformation.
{"PageData":"[{\"type\":\"config\",\"title\":\"Home\"}]"}[{"type":"config","title":"Home"}]Check the output before using it
Compare a few important values with the original, then validate the copied output in the receiving application. For an API request, use its schema or documented field rules in addition to syntax validation. A grammatically valid string may still be the wrong type for a field that expects an array.
ADEMN processes this payload in your browser, and file import is limited to 2 MB. That does not make a public screenshot, clipboard, or downloaded file private. Use the sample or redacted data when reporting an issue and keep credentials out of material you share.