# Map key is a atom or string

**URL:** <https://forum.elixirforum.com/t/map-key-is-a-atom-or-string/13285>\
**Category:** Questions\
**Tags:** maps, phoenix\
**Created:** [March 24, 2018, 6:06pm UTC](https://forum.elixirforum.com/t/map-key-is-a-atom-or-string/13285 "2018-03-24T18:06:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Nicd](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nicd/32/2357_2.png) [@Nicd](https://forum.elixirforum.com/u/Nicd)\
**Post date:** [March 24, 2018, 7:16pm UTC](https://forum.elixirforum.com/t/map-key-is-a-atom-or-string/13285/5 "2018-03-24T19:16:31Z")

</div>

To elaborate a bit, the _reason_ why map keys from external sources (like user input) are strings, is that atoms are not garbage collected and there is a set maximum amount of atoms available in the system. If you exceed that amount, the VM will crash. So that’s why you shouldn’t create atoms from user input for example.

---

_[View the full topic](https://forum.elixirforum.com/t/map-key-is-a-atom-or-string/13285)._
