Base64 Encoder & Decoder
Instantly encode any text or file to Base64, or decode Base64 back to readable text. No data ever leaves your browser.
All encoding/decoding happens in your browser
How to use Base64 Encoder & Decoder
The Base64 Encoder / Decoder converts binary data or plain text to and from Base64 encoding — a scheme that represents arbitrary bytes using only 64 printable ASCII characters. It is widely used to embed images inline in CSS, transmit binary attachments over text-based protocols such as email (MIME) and JSON, and store compact binary data in cookies and JWTs.
- Choose the operation: Encode (text or file → Base64) or Decode (Base64 → text).
- For encoding, paste plain text into the input or upload a binary file.
- For decoding, paste a Base64 string into the input field.
- Select the variant if needed: standard Base64 or URL-safe Base64 (- and _ instead of + and /).
- Click Convert and copy the result from the output panel.
Your data never leaves your device — 100% private processing.
How Base64 encoding works
Base64 takes every 3 bytes of input (24 bits) and splits them into four 6-bit groups, each mapped to one of 64 printable characters (A–Z, a–z, 0–9, +, /). Because 3 input bytes become 4 output characters, the encoded size is always 133% of the original. If the input length is not divisible by 3, one or two = padding characters are appended to make the output length a multiple of 4.
Standard vs URL-safe Base64
Standard Base64 uses + and / which have special meaning in URLs (query-string separator and path separator), so embedding standard Base64 in a URL requires percent-encoding. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, making the encoded value safe to use directly in URL paths and query strings without additional encoding. JWTs use URL-safe Base64 without padding characters.
| Variant | Characters 62–63 | Padding | Use case |
|---|---|---|---|
| Standard (RFC 4648 §4) | + and / | = required | MIME, email, file embedding |
| URL-safe (RFC 4648 §5) | - and _ | Optional | JWT, URL parameters, filenames |
| MIME | + and / | = with line breaks | Email attachments (76-char lines) |
Glossary
- Base64
- A binary-to-text encoding scheme using 64 printable ASCII characters to represent arbitrary bytes.
- Padding
- The = characters appended to Base64 output to make its length a multiple of 4.
- MIME
- Multipurpose Internet Mail Extensions — a standard that uses Base64 to encode binary email attachments.
- URL-safe Base64
- A variant that substitutes + with - and / with _ to avoid conflicts with URL syntax.
- Data URI
- A URL prefixed with data: that embeds file content (often Base64-encoded) directly in HTML or CSS.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use Base64 Encoder & Decoder?
- No installation — use directly from any browser
- Handles large inputs without crashing or timeouts
- Syntax highlighting and formatted output for readability
- Copy to clipboard shortcut for fast workflow integration
Common use cases
- Validate and format JSON responses from APIs
- Encode/decode Base64 strings during debugging
- Generate UUIDs for database seeds or test data
- Minify CSS or JavaScript before deployment
- Diff two code snippets to spot regressions
Related Developer Tools
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Includes syntax highlighting, error detection, and a collapsible tree view — free, private, in-browser.
Password Generator
Generate strong, secure, random passwords instantly. Uses the Web Crypto API — nothing is sent to any server, so your passwords stay private.
Regex Tester
Test and debug regular expressions online. See live matches, capture groups, and replace output. Free, private, instant.
URL Encoder / Decoder
Encode and decode URLs and URL components online. Convert special characters to percent-encoding and back instantly — free, private, and fast.
HTML Encoder / Decoder
Encode and decode HTML entities online. Escape <, >, &, and quote characters for safe HTML display. Free, instant, and private — runs in your browser.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes online. Hash text or files privately in your browser.
Explore all Developer Tools.