# Additional struct packed byte type: 24-bit

**URL:** <https://discuss.python.org/t/additional-struct-packed-byte-type-24-bit/104869>\
**Category:** Ideas\
**Tags:** stdlib, builtins\
**Created:** [November 13, 2025, 9:53pm UTC](https://discuss.python.org/t/additional-struct-packed-byte-type-24-bit/104869 "2025-11-13T21:53:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tristan-Peters](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/tristan-peters/32/32293_2.png) [@Tristan-Peters](https://discuss.python.org/u/Tristan-Peters)\
**Post date:** [November 13, 2025, 9:53pm UTC](https://discuss.python.org/t/additional-struct-packed-byte-type-24-bit/104869/1 "2025-11-13T21:53:38Z")

</div>

I understand the 8, 16, 32, 64, and 128 bit data types in structs matches C libraries, but sometimes 24 bit numbers are stored in raw data that needs to be pulled from a structure.

StackOverflow has a few topics on 24-bit ints from bytes. Doing from\_bytes and to\_bytes feels heavy-handed, especially iterating over large struct arrays and dealing with signed/unsigned.

It would be beneficial to include 24-bit numbers in the structure packing/unpacking. Is this the right place to request this as a feature?
