Developer guide
How to Debug JSON and JWT Data Without Confusing Decode and Verify
Use formatting, validation and token decoding safely while keeping syntax checks separate from schema and signature verification.
Formatting and validation answer different questions
Formatting changes presentation whitespace so nested data is easier to read. Syntax validation checks whether the text follows JSON grammar. Neither step proves that an API payload contains the correct fields, types or values. That requires schema or application-level validation.
A payload can be valid JSON and still be wrong for the receiving system. For example, a date can be a valid string but use the wrong format, or a required identifier can be absent. Treat formatting as a reading aid and syntax validation as the first gate, not the final test.
Common JSON mistakes
JSON requires double quotes around property names and strings. Comments and trailing commas are not part of the standard grammar. New lines inside a string must be escaped. JavaScript values such as undefined, NaN and functions cannot be represented directly.
Duplicate object keys are especially risky. Many parsers accept them and keep only one value, but different systems can handle duplicates differently. Remove duplicates at the source rather than trusting a formatter to decide which value is correct.
A decoded JWT is not a trusted JWT
A JSON Web Token commonly has three dot-separated parts: header, payload and signature. The first two parts are encoded for transport, not encrypted by default. Anyone who has the token can usually decode those claims.
Signature verification is the security step. It checks that the token was signed by a trusted issuer with the expected algorithm and key. A browser decoder that only displays header and payload cannot prove authenticity, expiration handling, audience or issuer rules. Never grant access because the decoded payload looks plausible.
Protect real credentials during debugging
Use synthetic or redacted examples whenever possible. Access tokens, session cookies, private keys and production API responses can expose accounts or customer data. Client-side processing avoids sending content to the tool's application server, but copied data can still remain in browser history, clipboard managers, screenshots or extensions.
When a real incident requires inspecting sensitive data, use approved internal tooling and follow the organization's logging and retention rules. Revoke exposed credentials instead of assuming they stayed private.
A disciplined debugging sequence
First preserve the original input. Then validate syntax, format a copy for reading and compare the structure with the expected schema. Check values that commonly fail at boundaries: empty strings, nulls, large numbers, time zones and Unicode. For a JWT, verify the signature and registered claims in the application or a trusted server-side library.
Finally, reduce the failing case to the smallest safe example. A small reproducible payload is easier to reason about and safer to share in a bug report.
- Preserve an untouched copy of the failing input.
- Separate JSON syntax from schema correctness.
- Treat JWT decoding as inspection only.
- Verify signatures and claims in trusted application code.
- Remove secrets before sharing examples.
Editorial note
This guide explains the behavior and limits of the current Toolsaly workflow. It is educational information, not legal, tax, medical or financial advice. Report a correction through the site feedback form and include the guide URL.
