---
title: "Discussion on \"Uint8Array toBase64 and toHex: Stop Round-Tripping Bytes Through btoa\" | Hashnode"
description: "Discussion on \"Uint8Array toBase64 and toHex: Stop Round-Tripping Bytes Through btoa\". Every codebase that touches binary data has the same little helper buried in a utils folder. It takes a Uint8Array, spreads it into String.fromCharCode, hands the result to btoa, and hopes for the bes"
url: "https://hashnode.com/posts/uint8array-tobase64-and-tohex-stop-round-tripping-bytes-through-btoa/6ab64a239dc5c4c057be1536"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Uint8Array toBase64 and toHex: Stop Round-Tripping Bytes Through btoa](https://grimicorn.hashnode.dev/uint8array-tobase64-and-tohex-stop-round-tripping-bytes-through-btoa?utm_source=hashnode&utm_medium=feed)

Every codebase that touches binary data has the same little helper buried in a utils folder. It takes a Uint8Array, spreads it into String.fromCharCode, hands the result to btoa, and hopes for the bes

Sep 25 · 5 min read · grimicorn.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-apis](https://hashnode.com/tag/web-apis)
-   [#node](https://hashnode.com/tag/node)
-   [#performance](https://hashnode.com/tag/performance)

## Written by

[Dan Holloran](https://hashnode.com/@grimicorn)

@grimicorn · St. Louis, MO

  
[View profile](https://hashnode.com/@grimicorn)

Full-stack web developer since 2012 · Vue · React · Laravel · danholloran.me

Senior Full Stack Developer with 14+ years building performant, scalable web applications. Passionate about architecture, mentorship, and finding the right tool for the job.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
