Need help with your JSON?
Try our JSON Formatter tool to automatically identify and fix syntax errors in your JSON. JSON Formatter tool
Case Sensitivity Issues in JSON Formatting
Yes. JSON is case-sensitive where most developers trip over it: object member names are matched exactly, string values preserve their original case, and the literal names true, false, and null must be written in lowercase. If an app or framework treats userId and UserId as equivalent, that is the app's behavior, not JSON's.
That distinction matters when you are formatting payloads, debugging API responses, or cleaning up exported data. A formatter can make case problems obvious, but it cannot guess which spelling a producer or consumer actually intended.
Quick Answer
- Object keys are case-sensitive:
"name"and"Name"are different members. - String values are case-sensitive:
"ON"and"on"are different strings. - Literal names are lowercase only:
true,false, andnullare valid;True,FALSE, andNULLare not. - Framework behavior can differ: case-insensitive model binding is an application feature, not part of the JSON format.
What Counts as Case-Sensitive in JSON
Keys and String Values
In JSON objects, member names are strings. That means "status", "Status", and "STATUS" are three different names, not stylistic variations of the same field.
Valid JSON with Case-Distinct Keys
{
"user": "Ava",
"User": "Liam",
"role": "Admin",
"roleLabel": "admin"
}This is valid JSON. The two user fields are distinct keys, and the two role-related strings keep their original case.
The Literal Names true, false, and null
JSON's boolean and null literals are not flexible. They must appear exactly as lowercase true, false, and null. Any other capitalization makes the document invalid JSON.
Invalid JSON
{
"enabled": True,
"archived": FALSE,
"deletedAt": NULL
}A formatter or parser should reject this because the literal names use the wrong case.
A Small Exception People Miss
Not every letter inside JSON is locked to one case. Number exponents can use e or E, and hexadecimal digits in Unicode escapes can be upper or lower case. That does not change the rule for keys or for the literal names above.
{
"small": 1e3,
"large": 1E3,
"slash": "\u002f",
"slashAgain": "\u002F"
}What the Specs Mean in Practice
The JSON standards define syntax, not how every runtime should map incoming JSON onto language objects or database columns. In practice, that means two things:
- JSON itself does not do case folding or treat similar-looking keys as equivalent.
- A library may offer case-insensitive property binding for convenience, but that is a layer on top of JSON, not a rule of the format.
This is why one system may happily deserialize UserId into a userId field while another leaves it unmatched. The JSON document did not change. The consumer's mapping rules did.
Common Real-World Failures
1. Case-Only Key Mismatches
This is the most common failure behind the query "is JSON case sensitive". The payload is valid, but the receiving code looks up the wrong casing and gets undefined, null, or a missing field error.
const payload = {
"CustomerID": 42,
"customerName": "Acme Corp"
};
payload.customerId; // undefined
payload.CustomerID; // 42
payload.CustomerName; // undefined2. Mixed Naming Conventions Between Systems
One service emits snake_case, another expects camelCase, and a third exposes PascalCase. Even when every document is valid JSON, the integration breaks if you assume keys will be normalized automatically.
3. Blind Key Normalization
Lowercasing every key can hide inconsistency, but it can also destroy information. If a payload contains both userId and UserId, a naive normalization step creates a collision.
Why automatic lowercasing is risky
{
"userId": 123,
"UserId": 456
}This JSON is valid because the keys are different strings. If you force every key to lowercase, one value will overwrite the other.
4. Confusing Case-Sensitive Keys with Duplicate Keys
These are related but different problems. Exact duplicate names such as two "userId" members are an interoperability problem. Different-case names such as "userId" and "UserId" are distinct keys, but they are easy for humans to mistake as duplicates during review.
Safer Ways to Handle Inconsistent Casing
Validate First, Map Second
The safest approach is to validate raw JSON as-is, then map external field names into your internal model explicitly. That lets you detect conflicts before data is lost.
function mapUser(payload) {
const aliases = ["userId", "UserId"];
const present = aliases.filter((key) => key in payload);
if (present.length > 1) {
throw new Error(`Conflicting user id keys: ${present.join(", ")}`);
}
return {
userId: payload.userId ?? payload.UserId ?? null,
};
}Document the Exact Field Names
If you publish an API or a configuration format, show the precise expected spelling in examples. Saying "send user id" is not enough when userId, UserId, and userid mean different things to many consumers.
Normalize Only at the Boundary
If you must support multiple casings for compatibility, do it in one boundary layer with collision checks. Avoid spreading case-insensitive lookups throughout the rest of the codebase.
How a JSON Formatter Helps
A formatter will not magically fix wrong casing, but it is still useful because it can:
- Expose near-duplicate keys that differ only by case once the structure is indented clearly.
- Reject invalid literals such as
TrueandNULLduring validation. - Make schema review easier when you need to compare the exact spelling of nested keys.
- Help you spot whether the problem is in the JSON itself or in the consumer's mapping logic.
Debugging Checklist
- Validate the JSON first to rule out invalid literals such as
TrueorNULL. - Search for keys that differ only by case, especially in large payloads and merged exports.
- Compare the payload against the exact field names in your API docs or schema.
- Check whether your parser, serializer, or framework has optional case-insensitive binding enabled.
- Handle aliases in one mapping layer instead of lowercasing the entire document blindly.
Bottom Line
JSON is case-sensitive where it matters most to developers: keys and string values keep their exact case, and true, false, and null are lowercase only. That is the short answer to "is JSON case sensitive".
If your application behaves as though casing does not matter, that behavior comes from a tool or framework on top of JSON. Treat it as a compatibility feature, not as a property of the format itself.
Need help with your JSON?
Try our JSON Formatter tool to automatically identify and fix syntax errors in your JSON. JSON Formatter tool