Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings back to plain text. Works entirely in your browser.
About Base64 Encoding
Base64 is an encoding scheme that represents binary data as a sequence of printable ASCII characters. It takes every 3 bytes of binary input and encodes them as 4 printable characters using a 64-character alphabet (A–Z, a–z, 0–9, +, /). The encoded output is approximately 33% larger than the original.
Encoding vs encryption
Base64 is not encryption. It is a reversible encoding that transforms data into a printable format. Anyone can decode a Base64 string with no key or password. It provides no security or confidentiality — it is purely a data representation format.
Common use cases
- HTTP Basic Authentication — Credentials are sent as
Authorization: Basic <base64(username:password)>. The Base64 can be trivially decoded, so HTTPS is required. - Data URIs — Embedding images, fonts, or other binary files directly in HTML or CSS:
src="data:image/png;base64,...". - Email attachments — MIME encoding for email attachments uses Base64 to safely transmit binary data through text-based email systems.
- JWT tokens — JWT headers and payloads are Base64URL-encoded (a variant that uses
-and_instead of+and/to be URL-safe). - JSON payloads — Embedding binary content (certificates, images, keys) within JSON, which only supports text values.
URL-safe Base64
Standard Base64 uses + and / characters that have special meaning in URLs. URL-safe Base64 (Base64URL) replaces these with - and _. Use URL-safe Base64 when the encoded value will appear in a URL or HTTP header.