This was intended as a meme but is actually a good representation of what "Null" is. In C#, when you declare string s = "My shit"; it means that "s" is a reference to a memory location that holds the data "My shit". string s = null; means that the reference "s" exists but it's not pointing to any object, as in it holds nothing. Answer from abd53 on reddit.com
null
/nŭl/
adjective
  1. Having no legal force; invalid.
    render a contract null and void.
  2. Of no consequence, effect, or value; insignificant.
  3. Amounting to nothing; absent or nonexistent.
    a null result.
from The American Heritage® Dictionary of the English Language, 5th Edition. More at Wordnik
🌐
Merriam-Webster
merriam-webster.com › dictionary › null
NULL Definition & Meaning - Merriam-Webster
November 4, 2025 - The meaning of NULL is having no legal or binding force : invalid. How to use null in a sentence. Did you know?
🌐
Dictionary.com
dictionary.com › browse › null
NULL Definition & Meaning | Dictionary.com
1 week ago - Null definition: without value, effect, consequence, or significance.. See examples of NULL used in a sentence.
🌐
Wikipedia
en.wikipedia.org › wiki › Null
Null - Wikipedia
1 month ago - Null character, the zero-valued ASCII character, also designated by NUL, often used as a terminator, separator or filler.
Discussions

What is Null?
This was intended as a meme but is actually a good representation of what "Null" is. In C#, when you declare string s = "My shit"; it means that "s" is a reference to a memory location that holds the data "My shit". string s = null; means that the reference "s" exists but it's not pointing to any object, as in it holds nothing. More on reddit.com
🌐 r/learnprogramming
60
34
July 5, 2024
c# - What does null! statement mean? - Stack Overflow
Basically, I try to dig into new c# 8 features. One of them is NullableReferenceTypes. Actually, there're a lot of articles and information about it already. E.g. this article is quite good. But I didn't find any information about this new statement null! Can someone provide me an explanation ... More on stackoverflow.com
🌐 stackoverflow.com
What is /r/null?

"null" is commonly used in software to mean nothing.

r/null is a gimmick subreddit with a stylesheet that makes it look like an empty page.

More on reddit.com
🌐 r/OutOfTheLoop
4
2
June 25, 2014
ELI5: What is Null?
Suppose I send you a letter and ask you a question. a) If you send me back the letter with nothing written on it --> empty string b) If you don't send anything back --> NULL EDIT: To incorporate what u/glutier said: In scenario a, I would be able to compare your answer with others (and maybe group you with others who have no opinion on the matter). Whereas in scenario B, I cannot assume anything about your response and therefore cannot compare you to anyone. More on reddit.com
🌐 r/explainlikeimfive
3
2
February 20, 2013
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Null
Null - Glossary | MDN
In computer science, a null value represents a reference that points, generally intentionally, to a nonexistent or invalid object or address. The meaning of a null reference varies among language implementations.
🌐
Cambridge Dictionary
dictionary.cambridge.org › us › dictionary › english › null
NULL | definition in the Cambridge English Dictionary
2 weeks ago - NULL meaning: 1. having no legal force: 2. with no value or effect: 3. (of a set or matrix) containing nothing…. Learn more.
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › csharp › language-reference › keywords › null
null keyword - C# reference | Microsoft Learn
March 30, 2024 - The null keyword is a literal that represents a null reference, one that does not refer to any object. null is the default value of reference-type variables.
🌐
Wolfram Language
reference.wolfram.com › language › ref › Null.html
Null—Wolfram Documentation
Null is a symbol used to indicate the absence of an expression or a result. When it appears as a complete output expression, no output is printed.
🌐
Vocabulary.com
vocabulary.com › dictionary › null
Null - Definition, Meaning & Synonyms | Vocabulary.com
Null means having no value; in other words null is zero, like if you put so little sugar in your coffee that it’s practically null. Null also means invalid, or having no binding force.
🌐
Oxford English Dictionary
oed.com › dictionary › null_adj
null, adj. meanings, etymology and more | Oxford English Dictionary
There are 13 meanings listed in OED's entry for the adjective null, one of which is labelled obsolete.
🌐
Wiktionary
en.wiktionary.org › wiki › null
null - Wiktionary, the free dictionary
Since no date of birth was entered for the patient, his age is null.
Top answer
1 of 8
505

TL;DR

The key to understanding what null! means is understanding the ! operator. You may have used it before as the "not" operator. However, since C# 8.0 and its new "nullable-reference-types" feature, the operator got a second meaning. It can be used on a type to control Nullability, it is then called the "Null Forgiving Operator".

Basically, null! applies the ! operator to the value null. This overrides the nullability of the value null to non-nullable, telling the compiler that null is a "non-null" type.


Typical usage

Assuming this definition:

class Person
{
    // Not every person has a middle name. We express "no middle name" as "null"
    public string? MiddleName;
}

The usage would be:

void LogPerson(Person person)
{
    Console.WriteLine(person.MiddleName.Length);  // WARNING: may be null
    Console.WriteLine(person.MiddleName!.Length); // No warning
}

This operator basically turns off the compiler null checks for this usage.

Technical Explanation

The groundwork that you will need to understand what null! means.

Null Safety

C# 8.0 tries to help you manage your null-values. Instead of allowing you to assign null to everything by default, they have flipped things around and now require you to explicitly mark everything you want to be able to hold a null value.

This is a super useful feature, it allows you to avoid NullReferenceExceptions by forcing you to make a decision and enforcing it.

How it works

There are 2 states a variable can be in - when talking about null-safety.

  • Nullable - Can be null.
  • Non-Nullable - Cannot be null.

Since C# 8.0 all reference types are non-nullable by default. Value types have been non-nullable since C# 2.0!

The "nullability" can be modified by 2 new (type-level) operators:

  • ! = from Nullable to Non-Nullable
  • ? = from Non-Nullable to Nullable

These operators are counterparts to one another. The Compiler uses the information that you define with these operators to ensure null-safety.

Examples

? Operator usage.

This operator tells the compiler that a variable can hold a null value. It is used when defining variables.

  • Nullable string? x;

    • x is a reference type - So by default non-nullable.
    • We apply the ? operator - which makes it nullable.
    • x = null Works fine.
  • Non-Nullable string y;

    • y is a reference type - So by default non-nullable.
    • y = null Generates a warning since you assign a null value to something that is not supposed to be null.

Nice to know: Using object? is basically just syntactic sugar for System.Nullable<object>

! Operator usage.

This operator tells the compiler that something that could be null, is safe to be accessed. You express the intent to "not care" about null safety in this instance. It is used when accessing variables.

string x;
string? y;
  • x = y
    • Illegal! Warning: "y" may be null
    • The left side of the assignment is non-nullable but the right side is nullable.
    • So it does not work, since it is semantically incorrect
  • x = y!
    • Legal!
    • y is a reference type with the ? type modifier applied so it is nullable if not proven otherwise.
    • We apply ! to y which overrides its nullability settings to make it non-nullable
    • The right and left side of the assignment are non-nullable. Which is semantically correct.

WARNING The ! operator only turns off the compiler-checks at a type-system level - At runtime, the value may still be null.

Use carefully!

You should try to avoid using the Null-Forgiving-Operator, usage may be the symptom of a design flaw in your system since it negates the effects of null-safety you get guaranteed by the compiler.

Reasoning

Using the ! operator will create very hard to find bugs. If you have a property that is marked non-nullable, you will assume you can use it safely. But at runtime, you suddenly run into a NullReferenceException and scratch your head. Since a value actually became null after bypassing the compiler-checks with !.

Why does this operator exist then?

There are valid use-cases (outlined in detail below) where usage is appropriate. However, in 99% of the cases, you are better off with an alternative solution. Please do not slap dozens of !'s in your code, just to silence the warnings.

  • In some (edge) cases, the compiler is not able to detect that a nullable value is actually non-nullable.
  • Easier legacy code-base migration.
  • In some cases, you just don't care if something becomes null.
  • When working with Unit-tests you may want to check the behavior of code when a null comes through.

Ok!? But what does null! mean?

It tells the compiler that null is not a nullable value. Sounds weird, doesn't it?

It is the same as y! from the example above. It only looks weird since you apply the operator to the null literal. But the concept is the same. In this case, the null literal is the same as any other expression/type/value/variable.

The null literal type is the only type that is nullable by default! But as we learned, the nullability of any type can be overridden with ! to non-nullable.

The type system does not care about the actual/runtime value of a variable. Only its compile-time type and in your example the variable you want to assign to LastName (null!) is non-nullable, which is valid as far as the type-system is concerned.

Consider this (invalid) piece of code.

object? null;
LastName = null!;
2 of 8
37

null! is used to assign null to non-nullable variables, which is a way of promising that the variable won't be null when it is actually used.

I'd use null! in a Visual Studio extension, where properties are initialized by MEF via reflection:

[Import] // Set by MEF
VSImports vs = null!;
[Import] // Set by MEF
IClassificationTypeRegistryService classificationRegistry = null!; 

(I hate how variables magically get values in this system, but it is what it is.)

I also use it in unit tests to mark variables initialized by a setup method:

public class MyUnitTests
{
    IDatabaseRepository _repo = null!;

    [OneTimeSetUp]
    public void PrepareTestDatabase()
    {
        ...
        _repo = ...
        ...
    }
}

If you don't use null! in such cases, you'll have to use an exclamation mark every single time you read the variable, which would be a hassle without benefit.

Note: cases where null! is a good idea are fairly rare. I treat it as somewhat of a last resort.

🌐
Processing
processing.org › reference › null.html
null / Reference / Processing.org
Special value used to signify the target is not a valid data element. In Processing, you may run across the keyword null when trying to access data which is not there.
🌐
Safe
docs.safe.com › fme › html › FME-Form-Documentation › FME-Terminology › Confluence-Topics › null__NULL__Null___null_.htm
null, NULL, Null,
In both cases, it means that “we don’t know, yet, what value this has.” Any data type can be null, including numeric, string, Boolean, and so forth.
🌐
The Broken Script Wiki
the-broken-script.fandom.com › wiki › Null
null (MobIsmissingID) | The Broken Script Wiki | Fandom
4 days ago - null (also known as MobIsmissingID) is a pitch-black Soul entity with a Minecraft skin that joins the player's world in The Damaged Java Script. null has a simplistic appearance. He is a 1.89-block tall, pitch-black entity that resembles a Minecraft ...
🌐
Fandom
forsaken2024.fandom.com › wiki › NULL
NULL
4 days ago - NULLNULL was a user that was lost in an unrevealed lore important area known as "The Null Zone" and became corrupted in the process.
🌐
NHTSA
nhtsa.gov › vehicle › null › null › null
Vehicle Detail Search - null null null | NHTSA
Search for vehicle using all available options, one page at a time. Full Vehicle Detail Search - null null null
🌐
X
x.com › expo2025_null2
Expo2025 「null²(ヌルヌル)」シグネチャーパビリオン公式 (@expo2025_null2) / X
January 16, 2024 - 2025年日本国際博覧会(大阪・関西万博)のシグネチャープロジェクト落合陽一プロデューサー「null²(ヌルヌル)」の公式アカウントです。Expo2025公式アカウント
🌐
Null Furniture
nullfurniture.com
Null Furniture
We supply living room, occasional, and accent tables. Our business is built around "small scale." Family owned and operated. Our furniture is designed for smaller living spaces where space may be at a premium.