Spec exact
Follows the ECMAScript algorithms step by step: option read order, whitespace, padding, extra bits, partial writes before an error, TypeError versus SyntaxError.
Plate IThe ES2026 Uint8Array base64 and hex methods, in every runtime
hexowl gives you toBase64, fromBase64, toHex, fromHex, setFromBase64 and setFromHex with the exact behavior of the ECMAScript standard: same results, same errors, same whitespace rules. It uses the native methods when your runtime has them and a fast, dependency free implementation when it does not.
npm i hexowl
Type in the eyepiece. Each character of the base64 output lights up on the alphabet ring, joined in order.
Same results in every runtime
Node.jsBunDenoChromeFirefoxSafariEvery project ends up with a base64 helper. Most of them quietly accept garbage: they skip unknown characters, mix both alphabets, or turn bad input into zero bytes. ES2026 finally standardised strict, well defined methods on Uint8Array, but older Node.js versions and browsers do not have them yet. hexowl lets you write against the standard API today, get the standard errors today, and drop the library tomorrow without changing a single result.
Hover or focus an entry to find its star on the chart.
Follows the ECMAScript algorithms step by step: option read order, whitespace, padding, extra bits, partial writes before an error, TypeError versus SyntaxError.
When the runtime ships all six methods, hexowl simply calls them. You get engine speed and identical results.
A tuned pure JavaScript path everywhere else. In Node.js, large inputs go through Buffer, but only when the answer is provably the same.
About 4 KiB gzipped, tree shakeable named exports, no Buffer requirement, no globals touched.
Import functions, or call install() once to add only the methods your runtime is missing.
Hand written TypeScript declarations, an exports map for import and require, Node.js 18 and later, Bun, Deno and browsers.
This runs the real hexowl code that ships on npm, inlined into this page. When your browser has the native methods, their answer is shown next to it.
Each byte is a star on a 16 by 16 hex lattice: the row is the high nibble, the column the low nibble. Stars are joined in order.
Six functions mirror the six methods. Every option and error matches the standard. The full reference is in the README.
| API | Returns | Throws |
|---|---|---|
| toBase64(bytes, { alphabet, omitPadding }?) | string | TypeError |
| fromBase64(string, { alphabet, lastChunkHandling }?) | Uint8Array | TypeError, SyntaxError |
| setFromBase64(target, string, options?) | { read, written } | TypeError, SyntaxError |
| toHex(bytes) | string | TypeError |
| fromHex(string) | Uint8Array | TypeError, SyntaxError |
| setFromHex(target, string) | { read, written } | TypeError, SyntaxError |
| install() | string[] | |
| nativeSupport | boolean |
Median throughput in MB/s of raw bytes, higher is better. Measured on AMD Ryzen 7 7800X3D, Windows 10 (2026-12-04). In Node.js 24 there are no native methods, so hexowl uses its own code and Buffer. In Bun, hexowl calls the native methods.
Honest notes: plain Buffer is still faster than hexowl in Node.js, because hexowl validates input that Buffer accepts silently. For tiny inputs of 32 bytes, the fixed call overhead dominates for everyone.
Checked by running each option on Node.js 24, not copied from their docs. Versions: base64-js 1.5.1 and js-base64 3.9.8.
| Capability | hexowl | Buffer | atob / btoa | base64-js | js-base64 |
|---|---|---|---|---|---|
| Works on Uint8Array | Yes | Yes | No | Yes | Yes |
| base64url alphabet | Yes | Yes | No | Partly | Yes |
| Rejects invalid characters | Yes | No | Yes | No | Partly |
| Hex | Yes | Yes | No | No | No |
| Decodes into an existing buffer | Yes | Yes | No | No | No |
| The standard API, removable later | Yes | No | No | No | No |
| Runs in browsers without Buffer | Yes | Partly | Yes | Yes | Yes |
Partly means: base64-js decodes base64url but only encodes the standard alphabet; js-base64 skips invalid characters when decoding and offers a separate isValid check; Buffer is a Node.js API that some other runtimes emulate.
| Runtime | What hexowl uses |
|---|---|
| Node.js 18, 20, 22, 24 | pure JavaScript, Buffer for large inputs |
| Bun 1.3 | native methods |
| Deno 2.x | native methods |
| Browsers with the methods (Chrome 140, Firefox 133, Safari 18.2) | native methods |
| Browsers without the methods | pure JavaScript |
The ESM entry, comments and indentation stripped, gzipped at level 9. A real minifier makes it smaller still.
Still curious? The README covers every option and every error. Documentation
atob works on binary strings, not bytes, has no base64url and no streaming. The standard methods fix all of that, and hexowl makes them available everywhere.Plate VIIInpm i hexowl
Install hexowl, use the ES2026 methods everywhere, and remove it once every runtime you support has them. None of your results will change.
npm i hexowl