Skip to main content
DEVELOPER

Base64 Encode / Decode

Encode plain text to Base64 or decode Base64 strings back to readable UTF-8 text. Supports multi-byte Unicode characters, emojis, and URL-safe formatting according to RFC 4648. All conversions execute locally in your browser.

Successfully encoded to Base64 with full UTF-8 Unicode support.
74 chars
104 chars

Full UTF-8 Unicode and Binary Support

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation. It is ubiquitous in data URIs, HTTP Basic Auth, and email MIME attachments.

Legacy browser implementations using window.btoa fail on any character outside Latin-1. Castov Base64 uses the modern TextEncoder interface to ensure every Unicode symbol, emoji, and non-Latin character encodes cleanly.

RFC 4648 URL-Safe Mode for Web Tokens and Parameters

Standard Base64 contains plus (+) and slash (/) characters that require percent-encoding when placed inside URLs. URL-Safe Base64 replaces these characters with minus (-) and underscore (_).

This format is essential when working with JSON Web Tokens (JWT), OAuth2 authorization codes, and file storage identifiers.

How to use this tool

  1. Select either Encode or Decode mode depending on your desired operation.
  2. Paste your text or Base64 string into the input field.
  3. Optionally toggle URL-Safe to use RFC 4648 URL and filename safe characters (- and _).
  4. Click Copy to copy the converted result to your clipboard.

Examples

Base64 standard and URL-safe encoding examples.

Plain Text Encoding

Hello World

Base64
SGVsbG8gV29ybGQ=
URL-Safe
SGVsbG8gV29ybGQ

Unicode & Emojis

Castov 🚀

Base64
Q2FzdG92IPCfmYA=
Decoded
Castov 🚀

Frequently Asked Questions

Does this tool support emojis and international UTF-8 characters?
Yes. Unlike basic btoa/atob implementations that throw errors on multi-byte characters, our tool uses TextEncoder and TextDecoder to support full UTF-8 Unicode including emojis and Arabic.
What is URL-Safe Base64 (RFC 4648)?
Standard Base64 uses + and / which have special meanings in URLs and file systems. URL-safe Base64 substitutes + with - and / with _, making the string safe for query parameters and JWT tokens.
Is my data transmitted to any external server?
Never. All encoding and decoding runs 100% client-side in your browser using standard Web APIs.
How does padding work in Base64?
Base64 strings represent data in 6-bit chunks. When the input byte length is not a multiple of 3, = characters are appended as padding. In URL-safe mode, padding characters can be safely trimmed.
Can I swap the input and output quickly?
Yes. Click the Swap button to instantly flip the input and output values and switch between encoding and decoding modes.