Presentation and parsing are different jobs

If a customer identifier changes while you are only trying to indent a response, check whether a parser read and rewrote its numbers. Formatting makes nesting readable; conversion moves interpreted values to another structure. Even with the same file extension, those operations preserve different things.

ToolSites JSON Formatter leaves numeric and string tokens as written instead of calculating their values. Conversion, comparison and tree tools interpret values, so they do not promise the same preservation. First decide whether you need whitespace changes or a transformation of fields and values.

Check with a large integer

{"customerId":9007199254740993,"amount":1250}

Format this example with JSON Formatter and check that customerId still ends in 3. Reading it into an ordinary JavaScript Number and serializing it can produce 9007199254740992. Some integers beyond 2 to the power of 53 cannot be distinguished by that number representation.

An identifier may be better transmitted as a string when it is not a quantity. Check the API contract before quoting a field that must be numeric. This site's conversion tools reject integers they cannot safely represent. Trimming digits to avoid that error would lose the original meaning.

Duplicate keys and quoted strings

{"status":"draft","status":"published"}
{"message":"line 1\nline 2"}

The first document repeats status. A source-preserving formatter can retain both occurrences, while many value parsers keep the last one. Do not use duplicate keys to represent business data: different consumers can handle them differently.

In the second document, backslash-n represents a newline inside a JSON string. Wrapping the entire document as one JSON string escapes backslashes and quotes again. More visible backslashes are not automatically an error; first distinguish a document from a string containing that document.

Keep CSV codes separate from quantities

code,quantity
0017,2

Leading zeros matter if 0017 is a product code; a quantity of 2 may instead need arithmetic. Cell notation alone does not define business types. ToolSites reads CSV cells as strings, so code becomes "0017" and quantity becomes "2" too. Explicitly convert only the fields your destination expects as numbers.

Three checks before handing data over

  1. Keep a copy of the source and compare representative identifiers, amounts, nulls and empty strings.
  2. Check field count, array order and number/string types. Valid syntax does not establish required API fields.
  3. Load a small sample into the actual receiving application first. Remove secrets and personal information from shared examples.

References and scope

Written by ToolSites from its own tool behavior and worked examples. The references below support the format definitions; they do not endorse this site.