Base64 / Base64 URL Encoder & Decoder

Encode and decode text in both standard Base64 and URL-safe Base64 formats entirely in your browser. This tool uses modern JavaScript and works with Unicode text without sending data to a server.

Convert text

Standard Base64
Base64 URL

About this tool

This page provides a simple, secure Base64 and Base64 URL encoding and decoding utility. It runs entirely in your browser using the Web Crypto-compatible text encoding APIs and standard Base64 conversion functions.

Base64 is a way to represent binary data as ASCII text, commonly used in data URLs, certificates, and token payloads. Base64 URL is a variant designed for safe use inside URLs and file names.

This tool supports both directions: converting plain text into a Base64 string, and decoding Base64/Base64 URL strings back into the original text.

How it works

When you encode text, the page first converts the string into bytes using TextEncoder. These bytes are then turned into a Base64 string using browser-native encoding routines.

For Base64 URL encoding, the standard Base64 output is converted by replacing + with -, / with _, and removing any trailing padding characters (=).

When decoding, the tool automatically detects both standard Base64 and URL-safe Base64 input. It restores any missing padding and then decodes the bytes back into text using TextDecoder.

Best practices

  • Use Base64 when embedding binary data in ASCII-only contexts.
  • Use Base64 URL when embedding encoded values into URLs, file names, or JSON web tokens.
  • Always validate decoded content if you are using it in security or parsing workflows.