# HashSet&lt;T>

*noun*

say it: **“HASH-set”** **/ˈhæʃsɛt/**

A C# collection that keeps only unique values and quickly says whether one is in it.

## What is **HashSet&lt;T>** in C#?

**HashSet&lt;T>** — An unordered collection that keeps only unique values.

```csharp
class TagCollection
{
    HashSet<string> tags = new();
}
```

## In a sentence

- “I put the tags in a **HashSet**&lt;string>, so adding "sci-fi" twice keeps one.”

Level: Freelancer · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=4)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/hashset-t
