What is Base64 Encoder Decoder?
Base64 Encoder Decoder — A Base64 Encoder/Decoder is a free tool that encodes text into Base64 format and decodes Base64 strings back into readable text.
Loading your tools...
Encode text to Base64 or decode Base64 strings back to plain text. Supports standard and URL-safe Base64 with UTF-8 encoding. All processing runs locally — no data uploaded.
Base64 Encoder Decoder: Paste text to encode it to Base64, or paste a Base64 string to decode it back to plain text. Supports UTF-8 encoding. Copy the result with one click. Useful for API payloads, data URIs, and email encoding.
Loading Tool...
Base64 Encoder Decoder — A Base64 Encoder/Decoder is a free tool that encodes text into Base64 format and decodes Base64 strings back into readable text.
Choose encode or decode mode.
Paste text or Base64 input into the editor.
Enable URL-safe handling when required.
Copy the output for your implementation workflow.
API request/response debugging
JWT-related base64url checks
Data URI generation and inspection
Encoding checks in integration tests
Base64 is a binary-to-text encoding scheme defined in RFC 4648. It converts arbitrary binary data into a 64-character ASCII alphabet (A-Z, a-z, 0-9, +, /) so the data can travel safely through text-only channels — email, HTTP headers, JSON payloads, XML, terminal output. It is NOT encryption. Anyone can decode Base64 in milliseconds without a key. Base64 provides encoding, not protection. If you need confidentiality, encrypt with AES first, then optionally Base64-encode the ciphertext for transport.
Base64 reads input 3 bytes (24 bits) at a time, splits those 24 bits into four 6-bit chunks, and looks each chunk up in the 64-character alphabet. When the input length isn't a multiple of 3, the encoder pads with = characters: one = for input ending in 1 byte short, two == for ending 2 bytes short. Size expansion: Base64 output is always 4/3 ≈ 1.33× the input size (plus padding). So a 1 MB image becomes a 1.33 MB Base64 string — important for choosing whether to embed images as data URIs vs separate file requests.
| Variant | Alphabet | Padding | Use case |
|---|---|---|---|
| Standard Base64 | A-Z a-z 0-9 + / | Yes (=) | Email (MIME), data URIs, PEM certificates, generic encoding |
| Base64URL | A-Z a-z 0-9 - _ | Often stripped | JWT, OAuth tokens, URL query strings, filenames |
URL-safe replaces + → - and / → _ because + means "space" in URL query strings and / is a path separator. JWT spec (RFC 7515) requires Base64URL and forbids the = padding.
data:image/png;base64,iVBORw0KG... — embed images directly in HTML / CSS / MarkdownAuthorization: Basic dXNlcjpwYXNz (Base64 of "user:pass")+ / or - _ characters.btoa(text) / atob(b64) (ASCII-only; for UTF-8 use TextEncoder + btoa)Buffer.from(text).toString("base64") / Buffer.from(b64, "base64").toString()base64.b64encode(b"text") / base64.b64decode(b64)echo -n text | openssl base64echo -n text | base64 / echo b64 | base64 -dbase64_encode($text) / base64_decode($b64)base64.StdEncoding.EncodeToString([]byte(text))All produce identical output for the same input — Base64 is fully cross-platform. If output differs between tools, check for line-break handling (some add line breaks every 76 chars per MIME; others don't) and padding behavior.
Encode and decode Base64. Convert string to Base64, Base64 to image (with preview), PDF, hex, or file. URL-safe mode for JWT.