The fastest Base64 library for React Native β powered by simdutf SIMD C++ and Nitro Modules.
Processes a 1.3MB image 26x faster than atob/btoa and 1.8x faster than react-native-quick-base64.
| iPhone | Android |
|---|---|
![]() |
![]() |
Most React Native base64 libraries hit the same bottlenecks:
- π’ Pure JS (
base64-js) β slow. No native acceleration. β οΈ atob/btoaβ fast for tiny strings, falls apart on binary data at scale.β οΈ String-based native β crosses the JSI bridge as UTF-16, doubling memory for binary payloads.
react-native-nitro-base64 uses SIMD instructions (AVX-512 on x86, NEON on Apple Silicon) to process 64 bytes per CPU instruction, and exposes ArrayBuffer/Uint8Array APIs that bypass string marshaling entirely.
Tested against
react-native-quick-base64@3.0.0
| Library | Time | vs. nitro-base64 |
|---|---|---|
β‘ nitro-base64 decodeBuffer / fromByteArray |
0.06ms | β |
| react-native-quick-base64 | 0.11ms | 1.8x slower |
| atob / btoa (Hermes) | 1.04ms | 17x slower |
| Library | Time | vs. nitro-base64 |
|---|---|---|
β‘ nitro-base64 decodeBuffer / fromByteArray |
7.5ms | β |
| react-native-quick-base64 | 13.6ms | 1.8x slower |
| atob / btoa (Hermes) | 203ms | 26x slower |
yarn add react-native-nitro-base64
yarn add react-native-nitro-modulesThen follow Nitro's setup guide for autolinking.
Call install() once before your app mounts:
// index.js
import { install } from 'react-native-nitro-base64';
import { AppRegistry } from 'react-native';
import App from './src/App';
import { name as appName } from './app.json';
install();
AppRegistry.registerComponent(appName, () => App);| Function | Input β Output | Notes |
|---|---|---|
encode(str, urlSafe?) |
string β base64 string | URL-safe optional |
decode(base64) |
base64 string β string | Auto-detects standard & URL-safe |
encodeBuffer(ArrayBuffer, urlSafe?) |
ArrayBuffer β base64 string | π Zero-copy, fastest for images |
decodeBuffer(base64) |
base64 string β ArrayBuffer | π Zero-copy, fastest for images |
fromByteArray(Uint8Array, urlSafe?) |
Uint8Array β base64 string | Drop-in for react-native-quick-base64 |
toByteArray(base64) |
base64 string β Uint8Array | Drop-in for react-native-quick-base64 |
Images are binary data. Sending binary through a JS string crosses the JSI bridge as UTF-16, doubling memory. ArrayBuffer skips that entirely β raw bytes go straight to C++.
import { encodeBuffer, decodeBuffer } from 'react-native-nitro-base64';
// Upload image to API
const response = await fetch(imageUri);
const buffer = await response.arrayBuffer();
const base64 = encodeBuffer(buffer); // β "iVBORw0KGgo..."
// Decode API response for <Image> component
const buffer = decodeBuffer(base64String); // β ArrayBufferimport { encode, decode } from 'react-native-nitro-base64';
const encoded = encode('Hello World!'); // "SGVsbG8gV29ybGQh"
const decoded = decode(encoded); // "Hello World!"
// URL-safe for JWT / URL params
const token = encode(payload, true);Drop-in replacement for react-native-quick-base64. Same API, faster engine.
import { fromByteArray, toByteArray } from 'react-native-nitro-base64';
// SHA-256 hash β base64
const hash = new Uint8Array(await crypto.subtle.digest('SHA-256', data));
const encoded = fromByteArray(hash);
// base64 β text
const bytes = toByteArray(base64String);
const text = new TextDecoder().decode(bytes);| Platform | Engine |
|---|---|
| iOS | C++ (simdutf, NEON SIMD) |
| Android | C++ (simdutf, NEON / AVX2 SIMD) |
MIT
- simdutf β SIMD-accelerated Unicode & Base64
- Nitro Modules β JSI native module framework

