Three formats cause most of the silent integration bugs I see: JSON that will not parse, Base64 that decodes into garbage, and timestamps read in the wrong timezone. Each one looks trivial. Each one produces an error that shows up nowhere near its cause.
JSON, and the four rules that break
| Rule | What it does to you |
|---|---|
| No trailing commas | The single most common hand-written JSON error |
| Double quotes only | Single quotes and bare keys are invalid |
| No comments | Any comment syntax kills the parse |
| Strict literals | undefined, NaN, Infinity and hex numbers are all invalid |
The parser tells you where the grammar broke. That is not where the mistake is. An error at position 412 is usually the stray comma at 408. Read the position, then look at the ten characters before it, not after. This one habit cuts debugging time in half.
Beautify before you reason about it
Most "the API is broken" tickets are shape mismatches. The payload arrives as an array where the client expected an object, or one level deeper than the code assumes, and nobody can see it because the whole thing is on one line. Pretty-print it and the problem announces itself.
A JSON formatter validates, beautifies and minifies in one step, and when the payload is invalid it points at the exact offset. That is what you need when debugging a webhook you cannot reproduce locally.
Two things that produce no error at all
Duplicate keys. JSON allows them syntactically, and nearly every parser silently keeps the last one. Two entries with the same key means data disappears with no warning whatsoever. You will never spot it in minified output.
Number precision. Large integer IDs blow past JavaScript's safe integer range and get rounded on parse. If a database ID comes out different on the client than it was on the server, this is why. Send those values as strings and stop thinking about it.
Base64 and URL encoding are not the same thing
People use these interchangeably and then wonder why authentication fails.
Base64 turns arbitrary binary into text so it can cross a text-only channel. It exists for transport. It is not encryption and gives you zero confidentiality.
URL encoding percent-escapes characters that are unsafe inside a URL. It exists to preserve URL structure, not to represent binary data.
Put them together badly and you get a very specific bug. Base64 encode a string and drop it into a URL path without further encoding, and the + and / characters break the parse. That is exactly why URL-safe Base64 exists, swapping in - and _. Knowing which variant a system expects eliminates a whole family of Basic Auth failures.
When decoded output is unreadable
Three causes, in order of likelihood. The input got truncated. The padding was stripped somewhere. The wrong variant was used. Padding matters more than people realise: a Base64 string whose length is not a multiple of four is malformed, and some libraries reject it silently instead of throwing.
Timestamps: the unit, then the timezone
Unix time counts seconds from 1970-01-01 UTC. The value is unambiguous. The interpretation never is, because half the systems you touch store milliseconds and half store seconds, and everyone has a different opinion about which timezone to render into.
Two rules prevent nearly all of it:
- Store UTC, render local. Convert at the presentation layer. Never convert at storage.
- Check the unit before converting. Ten digits is seconds, thirteen is milliseconds. Feed milliseconds into a seconds converter and you get a date roughly fifty thousand years out, which is a memorable symptom once you have seen it once.
A timestamp converter lets you check both directions and confirm the unit immediately, instead of debugging it inside code where the error surfaces three layers away from the input.
Is pasting data into an online formatter safe?
Depends entirely on what you paste and how the tool works. A formatter that runs in the browser never sends your input anywhere, and that is genuinely safe. One that posts to a server has your payload sitting in somebody's logs.
Practical rule: use these freely for structure, public API samples and configuration. For anything with credentials, tokens, customer records or personal data, use a client-side tool or redact first. The formatting logic is not the risk. Retention is.
Questions that come up
Why does my JSON work in JavaScript but fail validation?
You are passing an object literal, not JSON text. Objects allow single quotes, bare keys, trailing commas and comments. JSON allows none of them.
Is Base64 encryption?
No. Anyone can reverse it with no key. Never use it to protect anything.
Does minifying change the data?
No. Whitespace only. Semantics are identical, which is why it is safe to do in production.