# file64

> Convert Base64 to Blob/File and Blob/File to Base64.

Latest version **1.0.6** (published 2026-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install file64
pnpm add file64
yarn add file64
bun add file64
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2026-07-28 |
| First published | 2023-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 30.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Author | Mark |
| Maintainers | remarkablemark |
| Keywords | base64, base64-to-blob, base64-to-file, blob, blob-to-base64, decode, encode, file, file-to-base64 |

## Links

- npm: https://www.npmjs.com/package/file64
- Repository: https://github.com/encrypit/file64
- Homepage: https://github.com/encrypit/file64#readme
- Issues: https://github.com/encrypit/file64/issues
- npm.io page: https://npm.io/package/file64

## 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

- 1.0.6 (latest) — 2026-07-28
- 1.0.5 — 2025-07-03
- 1.0.4 — 2024-09-05
- 1.0.3 — 2023-10-29
- 1.0.2 — 2023-07-12
- 1.0.1 — 2023-06-25
- 1.0.0 — 2023-06-25
- 0.0.0 — 2023-06-25

## README

# file64

[![NPM](https://nodei.co/npm/file64.png)](https://nodei.co/npm/file64/)

[![NPM version](https://img.shields.io/npm/v/file64.svg)](https://www.npmjs.com/package/file64)
[![build](https://github.com/encrypit/file64/actions/workflows/build.yml/badge.svg)](https://github.com/encrypit/file64/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/encrypit/file64/branch/master/graph/badge.svg?token=IKmG72W8c6)](https://codecov.io/gh/encrypit/file64)

Convert [Base64](https://developer.mozilla.org/docs/Glossary/Base64) to [Blob](https://javascript.info/blob)/File and Blob/File to Base64.

## Installation

[NPM](https://www.npmjs.com/package/file64):

```sh
npm install file64
```

[Yarn](https://yarnpkg.com/package/file64):

```sh
yarn add file64
```

## Usage

Convert Base64 to Blob:

```ts
import { base64ToBlob } from 'file64';

const blob = await base64ToBlob('data:text/plain;base64,YQ==');
```

Convert Base64 to File:

```ts
import { base64ToFile } from 'file64';

const file = await base64ToFile('data:text/plain;base64,YQ==', 'file.txt');
```

Convert Blob to Base64:

```ts
import { blobToBase64 } from 'file64';

const blob = new Blob(['a'], { type: 'text/plain' });
const base64 = await blobToBase64(blob);
```

Convert File to Base64:

```ts
import { fileToBase64 } from 'file64';

const file = new File(['a'], 'file.txt', { type: 'text/plain' });
const base64 = await fileToBase64(file);
```

## Release

Release is automated with [Release Please](https://github.com/googleapis/release-please).

## License

[MIT](https://github.com/encrypit/file64/blob/master/LICENSE)

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