NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #2374 most downloaded on npm
Yet another Base64 transcoder in pure-JS
Latest stable
3.9.7
Last release 10 days ago
18 Nov 2026
Ships unpredictably
gaps range from 2 weeks to 1.5 years
Most releases are documented
notes for 41 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
79 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
toUint8Array() is faster on platforms without Uint8Array.fromBase64: the bytes are written straight into the resulting Uint8Array ([#198]). See benchm
toUint8Array() is faster on platforms without Uint8Array.fromBase64:
the bytes are written straight into the resulting Uint8Array ([#198]).
See benchmark/ in the repository for the numbers.isValid() now returns false for data lengths of 4n+1 such as 'Z', which cannot encode a whole number of bytes ([#197]).
isValid() now returns false for data lengths of 4n+1 such as 'Z',
which cannot encode a whole number of bytes ([#197]).extendUint8Array() and extendBuiltins() no longer cause infinite recursion on platforms with native Uint8Array.prototype.toBase64 ([#194]).
Your coding agent can read these notes before it upgrades. Set up the MCP server →
extendUint8Array() and extendBuiltins() no longer cause infinite
recursion on platforms with native Uint8Array.prototype.toBase64 ([#194]).The return type of toUint8Array() is narrowed to an ArrayBuffer-backed Uint8Array, so the result is accepted where a BufferSource is expected, such as
toUint8Array() is narrowed to an ArrayBuffer-backed
Uint8Array, so the result is accepted where a BufferSource is expected,
such as Web Crypto and Blob ([#189], [#193]).A typo in the low-surrogate range of the UTF-8 encoder ([#181], [#192]).
util/sync-version.js rewrites js-base64@X.Y.Z CDN URLs in README.md to the package.json version; wired into the npm "version" lifecycle hook so releas
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
base64.js and base64.mjs are now built from base64.ts with Rollup,
and the version is taken from package.json. No API changes.Native Uint8Array.prototype.toBase64 and Uint8Array.fromBase64 are used where available.
Uint8Array.prototype.toBase64 and Uint8Array.fromBase64 are used
where available.node's Buffer is no longer used. TextEncoder, TextDecoder, atob and btoa are available on node as well, so every platform now takes the same code path
Buffer is no longer used. TextEncoder, TextDecoder, atob
and btoa are available on node as well, so every platform now takes the
same code path.btoa() throws on non-Latin1 input on the Buffer code path as well ([#191]).
btoa() throws on non-Latin1 input on the Buffer code path as well
([#191]).decode() preserves a leading BOM (U+FEFF) on the TextDecoder code path ([#190]).
decode() preserves a leading BOM (U+FEFF) on the TextDecoder code path
([#190]).atobPolyfill() allocates less and is faster ([#186], [#187]).
atobPolyfill() allocates less and is faster ([#186], [#187]).isValid() takes unknown instead of any ([#179]).The presence of atob and btoa is no longer cached at load time, which crashed in Web Workers ([#174]).
atob and btoa is no longer cached at load time, which
crashed in Web Workers ([#174]).base64.d.mts is added so that the type declarations of the ES module no longer masquerade as CommonJS ([#172]).
base64.d.mts is added so that the type declarations of the ES module no
longer masquerade as CommonJS ([#172]).toUint8Array() is faster ([#166], [#167]).
toUint8Array() is faster ([#166], [#167])."sideEffects": false in package.json, for better tree shaking ([#163]).
"sideEffects": false in package.json, for better tree shaking ([#163]).Nothing published for this version
Handling of the padding = in URL-safe encoding and in isValid().
= in URL-safe encoding and in isValid().Nothing published for this version
base64.js is ES5-compatible again, hence it runs on IE11 ([#146], [#147]).
base64.js is ES5-compatible again, hence it runs on IE11 ([#146], [#147]).Nothing published for this version
exports map in package.json ([#140]).
exports map in package.json ([#140]).### Added - isValid().
isValid().toUint8Array() has an explicit return type.
toUint8Array() has an explicit return type.TextEncoder and TextDecoder are used where available.
TextEncoder and TextDecoder are used where available.encode() and decode() no longer rely on encodeURIComponent() and decodeURIComponent(), which raised URIError on some inputs ([#130]).
encode() and decode() no longer rely on encodeURIComponent() and
decodeURIComponent(), which raised URIError on some inputs ([#130]).fromUint8Array() failed on platforms without a global btoa ([#124]).
fromUint8Array() failed on platforms without a global btoa ([#124]).atobPolyfill() and btoaPolyfill() are exported, so the pure-JS versions can be used even where native ones exist.
atobPolyfill() and btoaPolyfill() are exported, so the pure-JS versions
can be used even where native ones exist.Nothing published for this version
Pure-JS atob() and btoa() are back as the last resort.
atob() and btoa() are back as the last resort.Object.assign() is avoided to make transpiling to ES5 easier.
Object.assign() is avoided to make transpiling to ES5 easier.Native Buffer is used on node again (until 3.9.0).
Buffer is used on node again (until 3.9.0).atob() no longer coerces its argument to a string.
version.atob() no longer coerces its argument to a string.VERSION. Use version instead.base64.ts is excluded from the npm package ([#122]).
base64.ts is excluded from the npm package ([#122]).Nothing published for this version
UMD wrapper of base64.js ([#120]).
base64.js ([#120]).The global object is no longer modified unless needed.
### Fixed - atob() and btoa() on browsers.
atob() and btoa() on browsers.Named exports such as import { encode, decode } from 'js-base64', which makes the ES module tree-shakable ([#117]).
import { encode, decode } from 'js-base64', which
makes the ES module tree-shakable ([#117]).Nothing published for this version
module field in package.json ([#115]).
module field in package.json ([#115]).Nothing published for this version
base64.mjs, a native ES module.
base64.mjs, a native ES module.Nothing published for this version
TextEncoder and TextDecoder are no longer required.
TextEncoder and TextDecoder are no longer required.Nothing published for this version
Rewritten with ES2015 features, so legacy browsers like IE are no longer supported out of the box. base64.js became ES5-compatible again in 3.7.0.
base64.js became ES5-compatible again in 3.7.0.encodeURL(), an alias of encodeURI().base64.min.js is back in the package.
base64.min.js is back in the package.toUint8Array() could not decode URL-safe input ([#112]).
toUint8Array() could not decode URL-safe input ([#112]).Nothing published for this version
fromUint8Array() and toUint8Array().
fromUint8Array() and toUint8Array().The use of node's Buffer, and with it eval() ([#109]).
Buffer, and with it eval() ([#109]).base64.min.js (restored in 2.6.4).Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.