# @ethersproject/base64

> Base64 coder.

Latest version **5.8.0** (published 2025-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ethersproject/base64
pnpm add @ethersproject/base64
yarn add @ethersproject/base64
bun add @ethersproject/base64
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.8.0 |
| Published | 2025-02-26 |
| First published | 2019-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8716 |
| Author | Richard Moore |
| Maintainers | ricmoo |
| Keywords | Ethereum, ethers |

## Links

- npm: https://www.npmjs.com/package/@ethersproject/base64
- Repository: https://github.com/ethers-io/ethers.js
- Homepage: https://github.com/ethers-io/ethers.js#readme
- Issues: https://github.com/ethers-io/ethers.js/issues
- Funding: https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2
- npm.io page: https://npm.io/package/@ethersproject/base64

## Dependencies (1)

- [@ethersproject/bytes](https://npm.io/package/@ethersproject/bytes.md) ^5.8.0

## Recent versions

- 5.8.0 (latest) — 2025-02-26
- 5.7.0 — 2022-08-19
- 5.6.1 — 2022-05-24
- 5.6.0 — 2022-03-10
- 5.5.0 — 2021-10-20
- 5.4.0 — 2021-06-26
- 5.3.0 — 2021-06-01
- 5.2.0 — 2021-05-20
- 5.1.0 — 2021-03-30
- 5.0.9 — 2021-03-08
- 5.0.8 — 2021-02-01
- 5.0.7 — 2021-01-08
- 5.0.6 — 2020-11-24
- 5.0.5 — 2020-11-18
- 5.0.4 — 2020-10-03
- … 22 more at https://npm.io/package/@ethersproject/base64/versions

## README

Base64 Coder
============

function decode(textData: string): Uint8Array
---------------------------------------------

Decodes a base64 encoded string into the binary data.

```javascript
import * as base64 from "@ethersproject/base64";

let encodedData = "...";
let data = base64.decode(encodedData);
console.log(data);
// { Uint8Array: [] }
```

function encode(data: Arrayish): string
---------------------------------------

Decodes a base64 encoded string into the binary data.

```javascript
import * as base64 from "@ethersproject/base64";

let data = [ ];
let encodedData = base64.encode(data);
console.log(encodedData);
// "..."
```

License
=======

MIT License

---
_Source: https://npm.io/package/@ethersproject/base64 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
