JSON null, Missing Fields and Empty Strings: Choose the Right Meaning

Published September 5, 2026 · Reviewed by the json2py editorial team

Three values that look similarly empty to a person can mean very different things to software: a property that is absent, a property with null, and a property with an empty string. Making that distinction explicit is a simple way to prevent incorrect updates, confusing user interfaces and hard-to-debug integration failures.

A missing property means no value was supplied

When a key is absent, the sender may not know the value, may not support that field or may be intentionally leaving an existing server value untouched. In a partial update request, absence commonly means “do not change this field.” Do not silently turn absence into an empty string unless the API contract requires that behavior.

null usually means an explicit empty value

JSON null says that the key exists but has no value. In Python it becomes None. An API may use it to clear a nullable value, represent an unknown result or state that an optional relationship does not exist. The receiving code must decide whether null is allowed for each specific field.

An empty string is still text

The value "" is a string of length zero. It may be valid for a note field, but it is often a data-entry mistake for a name, email address or identifier. Treating it as null hides the distinction between someone explicitly providing blank text and no value being provided at all.

Use a field-by-field contract

There is no universal rule that makes null, absent and empty equivalent. Document each important field: whether it is required, nullable and allowed to be blank. A schema can express part of this contract, while application validation handles business rules such as whether a user may clear a profile value.

Test update behavior

For endpoints that create or update data, test all three cases separately. Confirm what the server stores, what it returns and what the user interface shows. This is especially important for patch-style requests, where a well-intentioned client can overwrite a value by sending null instead of omitting a field.

Before using an example: adapt it to the exact library, API and data contract in your project. Test with a small, non-sensitive sample before relying on the result in a live system.

Related reading

Continue with JSON Schema basics and the JSON Formatter. Technical examples are a starting point for understanding a format; the documentation for the software you use remains the final reference.