How to sort a list by property in C#
To sort a list of objects by a property in C#, use LINQ OrderBy() / OrderByDescending() or List.Sort() with a lambda. LINQ returns a new sorted sequence while List.Sort() sorts in place.
OrderBy() is the idiomatic choice when using LINQ elsewhere in your code. List.Sort() is marginally faster for large in-place sorts because it avoids allocating a new sequence.
On this page
Sort by a Single Property with LINQ
Sort Descending
Sort by Multiple Properties
Use ThenBy() / ThenByDescending() to break ties with a secondary key.
Sort in Place with List.Sort()
List.Sort() mutates the original list and avoids allocating a new collection; it is useful when memory pressure matters.
Sort by String Property: Case-Insensitive
Sort by Nullable Property
Handle null values explicitly so they sort to the beginning or end as needed.
Implement IComparable for Default Sort Order
If the same type is sorted repeatedly, implement IComparable<T> to define a natural ordering that List.Sort() uses automatically.
OrderBy vs List.Sort: Quick Comparison
OrderBy() | List.Sort() | |
|---|---|---|
| Returns | New IOrderedEnumerable<T> | void (in-place) |
| Original list | Unchanged | Modified |
| Chaining | ThenBy(), ThenByDescending() | Pass Comparison<T> |
| LINQ pipeline | Yes (composes naturally) | No |
| Allocation | New sequence object | None |
| Best for | LINQ queries, functional style | Performance-critical in-place sorts |
Take It Further

The most comprehensive book covering C# 12 and .NET 8 from scratch to production.
C# 12 and .NET 8: Modern Cross-Platform Development · Mark J. Price
Get it on Amazon →As an Amazon Associate I earn from qualifying purchases.
Related Articles
Sort with LINQ OrderBy() in C# to get a new sorted sequence without modifying the original. Use ThenBy() for secondary sort keys.
Use LINQ Select() in C# to project each element into a new form. Transforms a collection with a lambda and returns a new IEnumerable with the results.
Sort a C# list with Sort() for in-place modification, or LINQ OrderBy() for a new sorted sequence that leaves the original list unchanged.
foreach is more readable for simple collection traversal. for loops provide index access, reverse iteration, and custom step sizes for more control in C#.