Fast Forgiving Base64 Decoding with SIMD Instructions

On the Internet, we use the Base64 format to represent binary data (e.g., images or cryptographic keys) as text. The ES2026 JavaScript standard, following the WHATWG forgiving-base64 rules, requires decoders to ignore ASCII whitespace while rejecting other non-alphabet characters. Prior SIMD Base64 decoders assume whitespace-free input. We present a block-oriented decoding algorithm that removes whitespace inside the SIMD loop: clean 64-character blocks are decoded directly, while blocks with ignorable characters are compacted into a small stack buffer. We provide implementations for x64 (SSSE3 through AVX-512 VBMI2), ARM NEON, and LoongArch. Our C++ decoder reaches up to 94GB s − 1 on recent AMD Zen 5 processors. In Node.js 25, integration of our decoder raises Uint8Array.fromBase64 throughput by up to 6 × compared with Node.js 19. The implementation has been adopted by major browsers and JavaScript runtimes.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Architecture and Code Optimization
Published
2026-10-15
DOI
https://doi.org/10.1145/3859286
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fast Forgiving Base64 Decoding with SIMD Instructions

Daniel Lemire A
ACM Transactions on Architecture and Code Optimization
Parallel Computing and Optimization Techniques
article

Fast Forgiving Base64 Decoding with SIMD Instructions

Daniel Lemire A
article en

Abstract

On the Internet, we use the Base64 format to represent binary data (e.g., images or cryptographic keys) as text. The ES2026 JavaScript standard, following the WHATWG forgiving-base64 rules, requires decoders to ignore ASCII whitespace while rejecting other non-alphabet characters. Prior SIMD Base64 decoders assume whitespace-free input. We present a block-oriented decoding algorithm that removes whitespace inside the SIMD loop: clean 64-character blocks are decoded directly, while blocks with ignorable characters are compacted into a small stack buffer. We provide implementations for x64 (SSSE3 through AVX-512 VBMI2), ARM NEON, and LoongArch. Our C++ decoder reaches up to 94GB s − 1 on recent AMD Zen 5 processors. In Node.js 25, integration of our decoder raises Uint8Array.fromBase64 throughput by up to 6 × compared with Node.js 19. The implementation has been adopted by major browsers and JavaScript runtimes.

ACM Transactions on Architecture and Code Optimization
Université TÉLUQ (CA)
Openalex Percentile: Top 9%
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.