# What changed in js-base64

> 8 changes in js-base64 3 from its official release notes, upgrade guides and advisories: 2 breaking. Each one cited. Sources checked 2026-11-28. HTML: https://unstale.sh/npm/js-base64/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## js-base64 3

### Breaking changes

- isValid() now returns false for data lengths of 4n+1, which cannot encode a whole number of bytes. (3.9.6) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#396---2026-11-01)
- btoa() now throws on non-Latin1 input on the Buffer code path as well. (3.8.1) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#381---2026-07-09)

### Performance

- toUint8Array() is faster on platforms without Uint8Array.fromBase64 because bytes are written straight into the resulting Uint8Array. (3.9.7) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#397---2026-11-18)
- The library uses the native method where available. (3.9.1) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#391---2026-07-15)

### Fixes and other changes

- No longer causes infinite recursion on platforms with native Uint8Array.prototype.toBase64. (3.9.5) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#395---2026-10-27)
- The return type is narrowed to an ArrayBuffer-backed Uint8Array, allowing the result to be used where a BufferSource is expected, such as Web Crypto and Blob. (3.9.4) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#394---2026-09-19)
- Corrected a typo in the low-surrogate range, fixing UTF-8 encoding behavior. (3.9.3) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#393---2026-08-17)
- decode() preserves a leading BOM (U+FEFF) on the TextDecoder code path. (3.8.0) — [release notes](https://github.com/dankogai/js-base64/blob/8a4af24d126e685e97ac3387960641828818abbd/CHANGELOG.md#380---2026-06-26)
