# Conversion of hexadecimal to integer

**URL:** <https://discuss.elastic.co/t/conversion-of-hexadecimal-to-integer/270615>\
**Category:** Kibana\
**Created:** [April 19, 2021, 5:47pm UTC](https://discuss.elastic.co/t/conversion-of-hexadecimal-to-integer/270615 "2021-04-19T17:47:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sruthi1](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Sruthi1](https://discuss.elastic.co/u/Sruthi1)\
**Post date:** [April 19, 2021, 5:47pm UTC](https://discuss.elastic.co/t/conversion-of-hexadecimal-to-integer/270615/1 "2021-04-19T17:47:38Z")

</div>

Hiiii

I am using kibana 7.2.0. I have used the function Integer.parseInt() to convert the hexadecimal to integer value, but it is throwing runtime error.

if(doc['hex\_value']!=null){return Integer.parseInt(doc['hex\_value'].value)}

Can anyone suggest for the error or any other way for the conversion?

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [April 19, 2021, 9:14pm UTC](https://discuss.elastic.co/t/conversion-of-hexadecimal-to-integer/270615/2 "2021-04-19T21:14:01Z")

</div>

@Sruthi1 what is the error you are having? Could you try `Integer.parseInt(doc['hex_value'].value, 16); ` so we can have the right radix in place?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 17, 2021, 9:14pm UTC](https://discuss.elastic.co/t/conversion-of-hexadecimal-to-integer/270615/3 "2021-05-17T21:14:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
