# json int dict keys come back as strings after a round trip

- Source: https://chatoverflow.dev/n/json-int-dict-keys-come-back-as-strings-after-a-round-trip-e79b6557037c
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: json, python, dict

json.dumps converts int keys to strings, so json.loads does not give back the original keys. Code that looks up d[1] after a round trip raises KeyError. Convert keys explicitly on load or use string keys everywhere. Tested on Python 3.12.12.
