How to Convert a Dictionary to a List of Tuples in Python

To convert a dictionary to a list of tuples in Python, wrap its items() view in list(). Each key-value pair becomes one (key, value) tuple, in the dictionary’s insertion order:

prices = {"Latte": 4.75, "Bagel": 3.25}
list(prices.items())   # [('Latte', 4.75), ('Bagel', 3.25)]

Every snippet below was run on Python 3.12.5 with a small coffee shop menu, and the outputs are copied straight from the console.

You’ll also see the comprehension and zip() versions, sorting, dict to tuple, nested dicts, and the trip back.

Convert a dictionary to a list of tuples with items()

items() doesn’t return a list. It returns a dict_items view, and list() takes a fixed copy of it:

menu = {"Latte": 4.75, "Bagel": 3.25, "Cold Brew": 5.45, "Muffin": 2.95}

pairs = list(menu.items())
print(pairs)
print(type(menu.items()).__name__, "->", type(pairs).__name__)

view = menu.items()
menu["Scone"] = 3.65            # the view sees the new key, the list doesn't
print(len(view), len(pairs))

Output:

[('Latte', 4.75), ('Bagel', 3.25), ('Cold Brew', 5.45), ('Muffin', 2.95)]
dict_items -> list
5 4
Command Prompt output of Python list(menu.items()) turning a price dictionary into a list of key-value tuples
The menu becomes four (name, price) tuples; after a fifth key is added, the view shows 5 items while the saved list still has 4.

So the view tracks the dict and your list doesn’t. For keys or values alone, see converting a dictionary to a list in Python.

Other ways to build the list: comprehension, zip() and map()

All four give you the same list. I use the comprehension when I want to change each pair on the way in:

menu = {"Latte": 4.75, "Bagel": 3.25, "Cold Brew": 5.45}

loop = []
for name, price in menu.items():
    loop.append((name, price))

comp = [(name, price) for name, price in menu.items()]
zipped = list(zip(menu.keys(), menu.values()))
mapped = list(map(tuple, menu.items()))

print(loop == comp == zipped == mapped)
print([(name.upper(), f"${price:.2f}") for name, price in menu.items()])

Output:

True
[('LATTE', '$4.75'), ('BAGEL', '$3.25'), ('COLD BREW', '$5.45')]

zip(d.keys(), d.values()) works because both views follow the same order, but items() says it more clearly. Looping over pairs is covered in iterating through tuples in Python.

How do I sort the list of tuples by key or value?

sorted() on items() sorts by key. Pass key=itemgetter(1) or a lambda to sort by value instead:

from operator import itemgetter

menu = {"Latte": 4.75, "Bagel": 3.25, "Cold Brew": 5.45, "Muffin": 2.95}

print(sorted(menu.items()))                                   # by key, A-Z
print(sorted(menu.items(), key=itemgetter(1)))                # by price, low to high
print(sorted(menu.items(), key=lambda kv: kv[1], reverse=True)[:2])   # two priciest

Output:

[('Bagel', 3.25), ('Cold Brew', 5.45), ('Latte', 4.75), ('Muffin', 2.95)]
[('Muffin', 2.95), ('Bagel', 3.25), ('Latte', 4.75), ('Cold Brew', 5.45)]
[('Cold Brew', 5.45), ('Latte', 4.75)]
Command Prompt output of Python sorted() on dictionary items, sorting the list of tuples by key, by price and in reverse
Sorting by key puts Bagel first; sorting by price puts the Muffin first, and the reverse slice returns the two most expensive drinks.

These sorting rules apply to any list of pairs, not just dictionary items; sorting a list of tuples in Python goes further.

Convert a dictionary to a tuple instead of a list

If you want a tuple rather than a list, tuple() takes the same views:

from itertools import chain

menu = {"Latte": 4.75, "Bagel": 3.25, "Cold Brew": 5.45}

print(tuple(menu.items()))        # tuple of (key, value) tuples
print(tuple(menu))                # keys only
print(tuple(menu.values()))       # values only
print(tuple(chain.from_iterable(menu.items())))   # one flat tuple

snapshot = {tuple(menu.items()): "Oct 21, 2026 menu"}   # hashable, so it works as a key
print(list(snapshot.values()))

Output:

(('Latte', 4.75), ('Bagel', 3.25), ('Cold Brew', 5.45))
('Latte', 'Bagel', 'Cold Brew')
(4.75, 3.25, 5.45)
('Latte', 4.75, 'Bagel', 3.25, 'Cold Brew', 5.45)
['Oct 21, 2026 menu']
Command Prompt output of Python converting a dictionary to a tuple of pairs, a tuple of keys, a tuple of values and one flat tuple
tuple(menu) gives only the keys; chain.from_iterable() flattens the pairs into one tuple of names and prices.

Because a tuple of tuples is hashable (if its items are), it can be a dict key or a set member, which a list can’t. More on that shape in a tuple of tuples in Python.

Turn a nested dictionary into a list of row tuples

With a dict of dicts, you pull the inner fields into each tuple, giving rows ready for CSV writers or database inserts:

orders = {
    "Emily": {"state": "TX", "total": 128.40},
    "James": {"state": "NY", "total": 86.15},
    "Olivia": {"state": "CA", "total": 214.99},
}

rows = [(name, info["state"], info["total"]) for name, info in orders.items()]
for name, state, total in rows:
    print(f"{name:<7} {state}  ${total:.2f}")

print(list(orders["Olivia"].items()))

Output:

Emily   TX  $128.40
James   NY  $86.15
Olivia  CA  $214.99
[('state', 'CA'), ('total', 214.99)]
Command Prompt output of Python flattening a nested dictionary of customer orders into row tuples with state and USD totals
Each customer becomes a (name, state, total) row, printed with totals in dollars and cents.

The for name, state, total in rows line is tuple unpacking; unpacking a tuple in Python explains it.

Convert the list of tuples back to a dictionary

dict() accepts any list of two-item tuples, but only the last of any repeated key survives:

pairs = [("Latte", 4.75), ("Bagel", 3.25), ("Latte", 4.95)]

print(dict(pairs))                      # duplicate key: the last value wins

Output:

{'Latte': 4.95, 'Bagel': 3.25}

Your round trip is lossless only when keys are unique. Other tuple shapes are handled in converting a tuple to a dict in Python.

Dictionary to list of tuples methods compared

CodeResultBest for
list(d.items())List of (key, value)The default choice
[(k, v) for k, v in d.items()]List of changed pairsTransforming on the way
tuple(d.items())Tuple of pairsHashable, read-only data

If you’re working with dicts and tuples a lot, try these next:

Frequently asked questions

How do I convert a dictionary to a list of tuples in Python?

Use list(d.items()). It returns one (key, value) tuple per entry, in insertion order.

How do I convert a dictionary to a tuple?

Use tuple(d.items()) for pairs, tuple(d) for keys or tuple(d.values()) for values.

Is dict.items() already a list?

No. It’s a dict_items view that updates when the dict changes. Wrap it in list() for a fixed copy.

How do I sort a dictionary’s items by value?

Use sorted(d.items(), key=lambda kv: kv[1]), and add reverse=True for highest first.

How do I turn a list of tuples back into a dictionary?

Pass it to dict(). If a key repeats, the last tuple with that key wins.

Where is dict.items() documented?

See dict.items() and dictionary view objects in the Python docs.