# base58-js

> A light weight universal JavaScript base58 encoder / decoder.

Latest version **3.0.3** (published 2025-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install base58-js
pnpm add base58-js
yarn add base58-js
bun add base58-js
```

## Health

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

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

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2025-06-24 |
| First published | 2021-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | pur3miish |
| Maintainers | pur3miish |
| Keywords | base58, decode, encode, blockchain, bitcoin |

## Links

- npm: https://www.npmjs.com/package/base58-js
- Repository: https://github.com/pur3miish/base58-js
- Homepage: https://github.com/pur3miish/base58-js#readme
- Issues: https://github.com/pur3miish/base58-js/issues
- npm.io page: https://npm.io/package/base58-js

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 3.0.3 (latest) — 2025-06-24
- 3.0.2 — 2025-01-13
- 3.0.0 — 2025-01-10
- 2.0.0 — 2023-02-21
- 2.0.0-beta.0 — 2023-02-21
- 1.0.5 — 2022-10-27
- 1.0.4 — 2022-06-16
- 1.0.3 — 2022-06-16
- 1.0.2 — 2022-06-13
- 1.0.1 — 2022-06-13
- 1.0.1-beta.0 — 2022-06-13
- 1.0.0 — 2021-01-18
- 1.0.0-rc — 2021-01-14

## README

![base58 logo](https://raw.githubusercontent.com/pur3miish/base58/main/static/base58.svg)

# base58-js

[![NPM Package](https://img.shields.io/npm/v/base58-js.svg)](https://www.npmjs.org/package/base58-js) [![CI status](https://github.com/pur3miish/base58-js/workflows/CI/badge.svg)](https://github.com/pur3miish/base58-js/actions) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/pur3miish/base58-js/blob/main/LICENSE)

A lightweight (~560 bytes) [universal JavaScript](https://en.wikipedia.org/wiki/Isomorphic_JavaScript) Base58 encoder and decoder.

---

## Installation

Install [`base58-js`](https://npm.im/base58-js) via npm:

```bash
npm install base58-js
```

## Requirements

Supported environments:

- [Node.js](https://nodejs.org) versions `^16` || `>=17.0.0` .
- Browsers matching the [Browserslist](https://browsersl.ist) query [`> 0.5%, not OperaMini all, not dead`](https://browsersl.ist/?q=%3E+0.5%25%2C+not+OperaMini+all%2C+not+dead).

## Usage Examples

**Convert Base58 to binary**

```js
import { base58_to_binary } from "base58-js";

const bin = base58_to_binary("6MRy");
console.log(bin);
```

> Logged output will be Uint8Array(3) [15, 239, 64].

**Convert binary to base58**

```js
import { binary_to_base58 } from "base58-js";

const str = binary_to_base58([15, 239, 64]);
console.log(str);
```

> The logged output was Thequickbrownfoxjumpedoverthea1zydog.

## Exports

Deep imports from the ECMAScript modules are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):

- [`index.js`](./index.js)
- [`create_base58_map.js`](./create_base58_map.js)
- [`binary_to_base58.js`](./binary_to_base58.js)
- [`base58_to_binary.js`](./base58_to_binary.js)
- [`base58_chars.js`](./base58_chars.js)

## TypeScript Support

This package includes type definitions via [TypeScript JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) for excellent IntelliSense and type checking.

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