# Is there a Ansible filter to convert humain size to bytes? Example convert 1.0 MB, 976.6 KiB… =\> bytes integer value?

**URL:** <https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362>\
**Category:** Ansible Project\
**Created:** [May 1, 2017, 12:10pm UTC](https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362 "2017-05-01T12:10:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephane\_Klein1](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Stephane\_Klein1](https://forum.ansible.com/u/Stephane_Klein1)\
**Post date:** [May 1, 2017, 12:10pm UTC](https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362/1 "2017-05-01T12:10:04Z")

</div>

Hi,

is there a Ansible filter to convert humain size to bytes? Example convert 1.0 MB, 976.6 KiB… in bytes integer value?

Best regards,  
Stéphane

---

<div class="post-metadata">

**Author:** ![Stephane\_Klein1](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Stephane\_Klein1](https://forum.ansible.com/u/Stephane_Klein1)\
**Post date:** [May 1, 2017, 12:52pm UTC](https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362/2 "2017-05-01T12:52:31Z")

</div>

I found that [https://groups.google.com/d/msg/ansible-devel/IcGOAvbIOh8/4IK94VBHBAAJ](https://groups.google.com/d/msg/ansible-devel/IcGOAvbIOh8/4IK94VBHBAAJ)

Why don’t add this filter in Ansible build-in filters?

---

<div class="post-metadata">

**Author:** ![Stephane\_Klein1](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Stephane\_Klein1](https://forum.ansible.com/u/Stephane_Klein1)\
**Post date:** [May 1, 2017, 1:07pm UTC](https://forum.ansible.com/t/is-there-a-ansible-filter-to-convert-humain-size-to-bytes-example-convert-1-0-mb-976-6-kib-bytes-integer-value/24362/3 "2017-05-01T13:07:27Z")

</div>

human\_to\_bytes filter already exists in Ansible build-in filters but it’s not documented.

[https://github.com/ansible/ansible/blob/09f4242ce425333521c633d2cf274b4b103ba658/test/integration/targets/filters/tasks/main.yml#L74](https://github.com/ansible/ansible/blob/09f4242ce425333521c633d2cf274b4b103ba658/test/integration/targets/filters/tasks/main.yml#L74)

I have created an issue about this information missing in documentation: [https://github.com/ansible/ansible/issues/24165](https://github.com/ansible/ansible/issues/24165)

Best regards,  
Stéphane
