Double-escaped text usually means one JSON string was stored inside another string. The visible reverse soliduses belong to different parser layers, so repeatedly decoding until text looks familiar is not a safe rule.
Count boundaries, not backslashes
Start with the producer and destination formats. A newline in raw text becomes \n inside the first JSON string. If that entire string is serialized as another JSON string, the reverse solidus is itself escaped and appears as \\n in the outer representation. A log viewer may add another display layer. Count the actual serialization boundaries and preserve a known input fixture rather than deciding from the number of visible slashes alone.
Decode exactly one reviewed layer
EscapeJSON performs one pass and shows the result as plain text. If the result is another quoted JSON string, it remains visible until you deliberately choose to reuse it. This prevents a log fragment, path or template containing intentional reverse soliduses from being recursively transformed. After each pass, compare the result with the expected producer contract before crossing the next boundary or treating the text as structured JSON.
Verify the destination and layer count
Compare the result with the producer and destination contracts. JSON escaping protects only one JSON string grammar; it does not sanitize HTML, SQL, JavaScript, shell input or another parser. Decode one reviewed layer at a time, reject malformed Unicode, and keep a known fixture for important integrations.