Base64 Decode & Encode

Online Base64 decoder and encoder — convert Base64 to text, encode text or files to Base64, with Base64URL support.

Free online Base64 decoder and Base64 encoder — paste a Base64 string to instantly decode Base64 to text, encode any text to Base64, or drop an image or file to get its Base64 data URI. Handles both standard Base64 and Base64URL (used in JWTs and OAuth). No data is sent to a server.

Examples:

Mode

Variant

Output format

Quick reference

Hello
SGVsbG8=
Hello
→ URL-safe: SGVsbG8
3 bytes
→ 4 Base64 chars
Size
≈ 33% larger
File Input

Drop a file here

or click to browse — images, PDFs, any file type

Click or drop another file to replace

URL-safe
Reading file…

chars · ~% larger than input

Frequently asked questions

Base64 is used to safely transmit binary data through systems that only handle ASCII text. The most common uses are: embedding images in HTML/CSS as data:…;base64,… URIs; HTTP Basic Authentication headers; binary fields in JSON payloads; JWT token encoding (all three parts are Base64URL); and MIME email attachments. The common thread is that you need binary data to survive a text-only channel.
No — Base64 is encoding, not encryption. Anyone can decode a Base64 string without a key; this tool proves it. Base64 converts binary to printable ASCII so it survives text-only protocols; it provides zero confidentiality. If you need to protect data, encrypt it first (AES-GCM, RSA-OAEP, etc.), then Base64-encode the ciphertext if the channel requires ASCII.
Standard Base64 uses + and /, which are reserved in URLs. Base64URL replaces + with - and / with _, and omits the = padding. This makes Base64URL safe for URL query strings, path segments, filenames, and HTTP headers without percent-encoding. Use it for JWTs, OAuth PKCE, and URL-safe identifiers.
Base64 processes input in 3-byte groups, producing 4 characters. When the input isn't a multiple of 3 bytes, one or two = characters are appended so the output length is a multiple of 4, signalling how many real bytes were in the last group. Base64URL omits padding because the decoder can calculate the original length from the string length alone. This tool adds missing padding automatically when decoding.
Base64 is exactly 4/3 × the original size (≈ 33% larger). Three input bytes always produce four Base64 characters. A 300-byte input becomes 400 characters; a 1 MB binary file becomes ≈ 1.33 MB of Base64 text (plus MIME line breaks if added). The size increase meta bar at the bottom of the output panel shows the exact percentage for your current input.
Switch this tool to File mode and drop any file onto the drop zone — it reads the file entirely in your browser and outputs either a full data URI (data:image/png;base64,…) or the raw Base64 string. No file is uploaded to a server. For code: Python uses base64.b64encode(open('f','rb').read()); PHP uses base64_encode(file_get_contents('f')); Node.js uses fs.readFileSync('f').toString('base64').
Yes — Base64 decoding requires no key or secret. It is a fully reversible, publicly-known encoding that any decoder can invert. This tool demonstrates that: paste any Base64 string and the original content is immediately visible. If you need your data to remain confidential, encrypt it with a key (AES-GCM, ChaCha20-Poly1305, etc.) before encoding.
Common reasons: (1) Standard vs Base64URL+ becomes - and / becomes _ in the URL-safe variant. (2) Padding — some encoders omit the trailing =. (3) MIME line breaks — RFC 2045-compliant encoders insert a newline every 76 characters; others produce a single string. (4) Input encoding — the same text encoded as UTF-8 vs Latin-1 produces different bytes and therefore different Base64. All variants decode correctly here — the decode mode normalizes URL-safe characters, strips whitespace, and restores missing padding automatically.