Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/encoding/base64.ts

The Deno Standard Library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.222.0/encoding/base64.ts";

Utilities for base64 encoding and decoding.

This module is browser compatible.

import {
  encodeBase64,
  decodeBase64,
} from "https://deno.land/std@0.222.0/encoding/base64.ts";

const encoded = encodeBase64("foobar"); // "Zm9vYmFy"

decodeBase64(encoded); // Uint8Array(6) [ 102, 111, 111, 98, 97, 114 ]

Functions

Decodes a base64-encoded string.

Converts data into a base64-encoded string.