Base64 Encode / Decode

Encode plain text to Base64 or decode Base64 strings back to text.

Advertisement

Base64 Encode / Decode — Complete Guide

Base64 is a binary-to-text encoding scheme that converts binary data into a set of 64 printable ASCII characters. It was designed to allow binary data to be safely transmitted over systems that only handle text, like email, HTML, and JSON APIs.

How Base64 Works

Base64 takes every 3 bytes (24 bits) of input and converts them to 4 Base64 characters. The character set uses A–Z (26), a–z (26), 0–9 (10), + (1), / (1) = 64 characters. The output is always a multiple of 4 characters, padded with = if needed. This means Base64 output is about 33% larger than the original input.

URL-Safe Base64

Standard Base64 uses + and / characters, which have special meanings in URLs. URL-safe Base64 replaces + with - and / with _, making it safe for use in URLs and filenames without encoding.

Common Uses of Base64

Is Base64 Encryption?

No! Base64 is encoding, not encryption. Anyone can decode a Base64 string with a single operation — no key required. Never use Base64 to hide sensitive information like passwords or personal data. Use proper encryption algorithms like AES for security.