foreach (KeyValuePair<string, int> kvp in counts.OrderByDescending(key => key.Value)) { // some processing logic for each item if you want. }