# How many bits does "Nat" take?

**URL:** <https://forum.dfinity.org/t/how-many-bits-does-nat-take/11195>\
**Category:** Developers\
**Created:** [February 28, 2022, 11:11pm UTC](https://forum.dfinity.org/t/how-many-bits-does-nat-take/11195 "2022-02-28T23:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nakamotik](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nakamotik/32/3530_2.png) [@Nakamotik](https://forum.dfinity.org/u/Nakamotik)\
**Post date:** [February 28, 2022, 11:11pm UTC](https://forum.dfinity.org/t/how-many-bits-does-nat-take/11195/1 "2022-02-28T23:11:42Z")

</div>

Is it dynamic or fixed size?  
If it is dynamic, for small numbers(0-100) `Nat` will be more memory efficient than `Nat64`?

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [March 1, 2022, 12:02am UTC](https://forum.dfinity.org/t/how-many-bits-does-nat-take/11195/2 "2022-03-01T00:02:35Z")

</div>

Dynamic. I think if you need to just use small numbers that a nat8 would Use less logic, but but I’ll let a compiler person answer.

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [March 1, 2022, 2:15am UTC](https://forum.dfinity.org/t/how-many-bits-does-nat-take/11195/3 "2022-03-01T02:15:34Z")

</div>

This is my goto resource on this topic:

> [@Is there any document about the amount of memory occupied by the basic types of Motoko canister?](https://forum.dfinity.org/t/is-there-any-document-about-the-amount-of-memory-occupied-by-the-basic-types-of-motoko-canister/6442/5):
>
> Nat32, Char: 8 bytes Int64: 12 bytes Nat and Int: “free” if smaller than 2^30, else at least 20 bytes, up to arbitrary sizes Text and Blob: up to 8+n+3 bytes. opt: “free” unless you deal with the value ?…?null List is not a basic type. Probably 12\*n Free means that it’s stored inside the containing data structure without extra allocation.
