Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text instantly.
What Is the Base64 Encoder / Decoder?
The Base64 Encoder/Decoder converts text and binary data to Base64 encoding — a binary-to-text scheme that represents binary data using 64 printable ASCII characters. Enter text or Base64 to encode or decode instantly. Supports standard Base64 and URL-safe Base64 variants.
Formula
How to Use
For encoding: enter plain text or paste binary data. The tool converts it to Base64 using the standard 64-character alphabet (A-Z, a-z, 0-9, +, /). For decoding: paste a Base64 string and click Decode to get the original text. URL-safe mode replaces + with − and / with _.
Example Calculation
Encode 'Hello': H=72, e=101, l=108, l=108, o=111. Binary: 01001000 01100101 01101100 → groups of 6 bits: 010010 000110 010101 101100 → 18, 6, 21, 44 → SGVs. Full 'Hello' → 'SGVsbG8='. Decode 'SGVsbG8=' → 'Hello'.
Understanding Base64 Encoder / Decoder
Base64 encoding converts arbitrary binary data into a stream of printable ASCII characters, enabling binary data to be safely transmitted through systems designed for text. The name comes from using a 64-character alphabet (A-Z, a-z, 0-9, +, /) — exactly 6 bits can select one of 64 characters, so every 3 bytes (24 bits) maps to exactly 4 Base64 characters.
The 33% size overhead (every 3 bytes becomes 4 characters) is the main drawback of Base64. For large binary files, this overhead is significant. However, for the use case of embedding small images or binary blobs in JSON/XML/email, the ability to transmit binary through text-only channels outweighs the size cost.
Base64 is ubiquitous in web development: data URIs (background-image: url('data:image/png;base64,...')), JWT (JSON Web Tokens) use Base64url for header and payload encoding, certificate files (.pem) contain Base64-encoded DER data between BEGIN/END markers, and most API authentication tokens are Base64-encoded credentials. Understanding Base64 is a fundamental web development skill.
Frequently Asked Questions
What is Base64 used for?
Base64 is used to encode binary data (images, files, encryption keys) for transmission in text-based systems: email attachments (MIME), data URIs in web pages (inline images), JSON payloads with binary fields, HTTP Basic Auth headers, and API keys.
Why does Base64 end with = or ==?
Base64 processes 3-byte groups. If the input length isn't a multiple of 3, padding characters (=) fill the last group to make it a complete 4-character Base64 group. One = means 1 padding byte; two == means 2 padding bytes.
Does Base64 encrypt data?
No. Base64 is encoding, not encryption. It is trivially reversible — anyone can decode Base64 instantly. It obfuscates data slightly but provides zero security. Do not use Base64 as security.
What is URL-safe Base64?
Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces + with − and / with _, making the encoded string safe to include in URLs without percent-encoding.
Is this tool free?
Yes, completely free with no account required.