What Is the Difference Between Empty Text and Null?
From the earlier reference collection. Read the current software blog.
Empty text can assert that a value is known to contain nothing; null can signal that no value is available. Treating them as interchangeable erases useful information.
Two different statements
An empty string, often written as "", is a text value with zero characters. It can mean that a field was checked and intentionally left blank. Null is a marker indicating that there is no text value to provide, perhaps because it is unknown, unavailable, or not applicable. The exact meaning depends on the schema, so a system should define it explicitly.
Consider a contact record. An empty middle-name field may mean the person has no middle name, while null may mean the form never collected that information. Those cases can lead to different follow-up actions. A report that collapses both to blank cannot tell them apart.
Make the distinction actionable
Choose meanings that users and software can apply consistently. For a survey, an empty answer might mean the respondent deliberately submitted no text; null might mean they skipped the question. For a sensor record, an empty string is usually a poor representation of a missing reading because the value is numeric, not text. A status or missing-value reason may be clearer.
Avoid assigning extra meanings to null without a way to distinguish them. If null can mean both “not measured” and “not applicable,” downstream users cannot know which situation occurred. A separate status field or documented reason codes may be needed.
Preserve information in storage and exchange
A database, JSON API, spreadsheet, and CSV export may handle blank and null values differently. Test the full path: create a record, save it, export it, import it elsewhere, and inspect whether the distinction survives. For example, an export process that converts every null to an empty CSV cell may make unknown and known blank indistinguishable.
Document the rule alongside the field definition. State whether the field may be omitted, whether null is allowed, and what an empty string means. These are separate choices: an omitted field can mean “not supplied,” while an explicit null can be a deliberate statement that no value is available.
A practical rule
Use empty text when the content is text and the known content has no characters. Use null when the value itself is unavailable or unknown, and use a more specific status when the reason matters. Do not use an empty string as a universal missing-value token.
A useful design check is to ask what a reader should infer from each representation. If the answer differs, keep the representations distinct and test that clients preserve them. If the answer does not differ, choose one convention and document it. A small, explicit rule prevents blank fields from becoming ambiguous over time.