Base64 Encoder & Decoder
Encode text and files to Base64 or decode Base64 strings back to their original form. Supports standard and URL-safe variants, image preview, data URIs, and JWT inspection. 100% private — nothing leaves your browser.
How to use the Base64 encoder and decoder
Select Encode to Base64 or Decode from Base64 using the tabs at the top. Paste or type your text into the left panel — the result appears instantly in the right panel as you type.
To encode a file, click File or drop any file onto the input panel. The tool reads it using the browser's FileReader API and displays the Base64 output immediately. File size is limited to 10 MB.
The Swap button moves the output to the input and flips the mode, so you can verify a roundtrip in two clicks. When you paste a valid data URI (data:image/png;base64,…) in decode mode, an image preview panel appears automatically. When you paste a JWT, the header and payload are decoded and displayed side by side.
Standard vs URL-safe Base64
Standard Base64 (RFC 4648) uses the characters A–Z, a–z, 0–9, +, and /, with = padding to make the length a multiple of 4. This is the most common variant — used in email attachments (MIME), HTTP Basic Auth, and data URIs.
URL-safe Base64 replaces + with - and/ with _, and omits the = padding. This variant is safe to embed in URLs and filenames without percent-encoding. It is used in JWTs, OAuth tokens, and many modern APIs.
The decoder auto-detects URL-safe characters — you can paste either variant in decode mode without manually switching.
Features
- Standard and URL-safe variants — switchable with one click
- Real-time output — result updates instantly as you type
- Unicode support — correctly encodes emoji, accented letters, and all non-ASCII text
- File upload — drag and drop or click to upload any file up to 10 MB
- Image preview — auto-displays PNG, JPEG, GIF, WebP, SVG, BMP decoded from Base64
- Data URI parser — detects and extracts the MIME type from data URI strings
- JWT inspector — auto-detects JWTs and decodes header and payload side by side
- Size stats — input size, output size, overhead percentage, and character count
- Swap button — move output to input and flip encode↔decode in one click
- Copy and Download output with one click
- Operation history — last 5 conversions saved in localStorage
- 100% private — all processing runs in your browser, nothing is transmitted
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It converts every 3 bytes of binary data into 4 characters, producing a string that is roughly 33% larger than the original.
Base64 is used whenever binary data needs to be stored or transferred over systems that handle only text — for example, embedding images in HTML or CSS as data URIs, encoding file attachments in email, passing tokens in HTTP headers, or storing binary blobs in JSON APIs.
Frequently asked questions
What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and / which have special meaning in URLs (query string delimiter and path separator). URL-safe Base64 replaces these with - and _ and drops the= padding, making it safe to use directly in URLs and filenames. JWTs always use the URL-safe variant.
Does Base64 encoding encrypt my data?
No. Base64 is an encoding scheme, not encryption. It is fully reversible by anyone who has the encoded string — no key or password is needed to decode it. Do not use Base64 to protect sensitive data. Use proper encryption (AES, RSA) if you need confidentiality.
How do I decode a Base64 image?
Switch to Decode from Base64 mode and paste the Base64 string or the full data URI (data:image/png;base64,…) into the input. If the decoded bytes represent a PNG, JPEG, GIF, WebP, or SVG image, a preview panel appears automatically. You can download the image from there.
How do I decode a JWT?
Switch to Decode from Base64 mode and paste the full JWT (the three dot-separated segments). The tool auto-detects the JWT structure and shows the header and payload decoded as JSON in the JWT Inspector panel. Note that this only decodes the data — it does not verify the signature.
Why does my decoded text look wrong?
This usually means the Base64 string encodes binary data rather than UTF-8 text. If you're encoding an image or a binary file, the decoded output will not be readable as text. Use the image preview panel or download the decoded bytes as a file instead.
Is my data private?
Yes. All encoding and decoding runs entirely in your browser using built-in JavaScript APIs (btoa, atob,TextEncoder, TextDecoder). Nothing is ever sent to any server. Your text and files never leave your device.