# Convert datatype

**URL:** <https://discourse.nodered.org/t/convert-datatype/62061>\
**Category:** Dashboard\
**Created:** [2 May 2022 12:45 UTC](https://discourse.nodered.org/t/convert-datatype/62061 "2022-05-02T12:45:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TDatema](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@TDatema](https://discourse.nodered.org/u/TDatema)\
**Post date:** [2 May 2022 12:45 UTC](https://discourse.nodered.org/t/convert-datatype/62061/1 "2022-05-02T12:45:59Z")

</div>

Hey,

Is there any way to convert datatype UInt8 to UInt16?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [2 May 2022 14:42 UTC](https://discourse.nodered.org/t/convert-datatype/62061/2 "2022-05-02T14:42:16Z")

</div>

as a uint8 fits inside a uint16, the question is why?

- uint8 1 == uint16 1
- uint8 2 == uint16 2  
...
- uint8 255 == uint16 255

PS, there is no concept of uint8 in JavaScript. there is only [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type) (and [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#bigint_type))

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 June 2022 14:43 UTC](https://discourse.nodered.org/t/convert-datatype/62061/3 "2022-06-01T14:43:10Z")

</div>

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