Temp Mail Logo

Temp Mail safeguards your privacy while keeping your inbox free from spam.

⟺ Encode · Decode · URL-safe · File Support

Base64 Encoder / Decoder

Free online Base64 encoder and decoder — encode text or files to Base64, decode Base64 strings back to text instantly. Supports standard and URL-safe Base64. No software, no signup, runs entirely in your browser.

✓ Base64 decode online✓ URL-safe Base64✓ File encoding✓ Unicode / UTF-8✓ No signup✓ 100% private
Text to Encode
Base64 Output
Output appears here...
What is Base64

Free Base64 encoder and decoder — encode, decode, convert

Base64 is a binary-to-text encoding scheme that converts binary or text data into a string of 64 printable ASCII characters. It is not encryption — anyone can decode a Base64 string instantly. Its purpose is purely to make binary data safe for transmission over text-only channels like email, JSON APIs, and HTML attributes.

This free online Base64 decoder and encoder runs entirely in your browser using the native btoa() and atob() JavaScript functions. Nothing is sent to any server. Both standard Base64 and URL-safe Base64 (RFC 4648) are supported.

What this tool does
Standard Base64
Uses A-Z, a-z, 0-9, +, / (64 chars) plus = padding. Safe for MIME email, JSON, and data URLs but not for direct URL embedding.
URL-safe Base64
Replaces + with -, / with _, removes = padding. Safe to embed in URLs, filenames, JWTs, and cookies without percent-encoding.
Encoding process
Every 3 bytes of input are split into four 6-bit groups, each mapped to a Base64 character. Output is ~33% larger than input. Each set of 3 raw bytes maps to exactly 4 Base64 characters, and padding = signs are added to complete the final group if needed. Base64 encoding is standardised in RFC 4648 and is supported natively in every modern browser and server-side language.
Decoding process
Four Base64 characters are converted back into three bytes. Padding (=) fills out incomplete final groups. Result is the original data. The decoder reverses the mapping: each group of 4 Base64 characters is converted back to 3 bytes of original data. If the encoded string has missing padding (= signs), most decoders will fail -- this tool adds padding automatically before decoding.
When to use Base64
🖼️
Inline images
Embed images directly in HTML or CSS as data:image/png;base64,... URLs — no separate file needed.
📡
API payloads
Include binary data or file contents in JSON responses without breaking the JSON structure.
📧
Email attachments
MIME email encoding uses Base64 to attach files to email messages as text-safe strings.
🔑
JWT tokens
JWT header and payload are URL-safe Base64 encoded — decode them here to inspect token contents.
🔗
URL parameters
Pass binary or structured data in URL query strings using URL-safe Base64 without percent-encoding.
💾
LocalStorage
Store binary data (images, files) in browser localStorage or cookies by encoding to Base64 first.
Examples

Real-world Base64 encoding and decoding examples

Switch to Decode mode and paste any of the Base64 values below to see them decoded instantly.

Plain text
Encoding plain text to Base64
The most common use case — encoding a simple text string. Each character is converted to its UTF-8 byte representation, then encoded.
Original
Hello, World!
Base64
SGVsbG8sIFdvcmxkIQ==
HTTP Auth
HTTP Basic Authentication header
Basic Auth sends credentials as Base64 in the Authorization header. The format is username:password encoded to Base64. Not encryption — decode it instantly.
Original
admin:password123
Base64
YWRtaW46cGFzc3dvcmQxMjM=
JWT token
Decoding a JWT token payload
JWT tokens are three URL-safe Base64 segments separated by dots. The middle segment (payload) contains the token claims. Paste a JWT payload here to inspect it.
Original
{"sub":"user123","name":"Jane","iat":1700000000}
Base64
eyJzdWIiOiJ1c2VyMTIzIiwibmFtZSI6IkphbmUiLCJpYXQiOjE3MDAwMDAwMDB9
JSON in URL
Base64 encoding JSON for a URL parameter
Encode a JSON object to URL-safe Base64 to pass structured data in a URL query string without percent-encoding issues.
Original
{"filter":"active","page":1}
Base64
eyJmaWx0ZXIiOiJhY3RpdmUiLCJwYWdlIjoxfQ==
Data URL
Inline image data URL format
Base64-encoded images can be embedded directly in HTML or CSS. The format is: data:[mimetype];base64,[encoded bytes]. No separate image file needed.
Original
data:image/png;base64,[base64-encoded-bytes]
Base64
(file bytes encoded with the Encode File button above)
FAQ

Frequently asked questions

What is Base64 decoding?
Base64 decoding converts a Base64-encoded string back into its original text or binary data. Paste your Base64 string into the tool above with Decode mode selected and the original text appears instantly. The tool handles both standard Base64 (using + and /) and URL-safe Base64 (using - and _) automatically without needing to switch modes.
How do I decode a Base64 string online?
Switch to Decode mode, paste your Base64 string, and the decoded output appears immediately. This tool handles both standard Base64 (using + and /) and URL-safe Base64 (using - and _) automatically.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption — anyone can decode it instantly using any Base64 decoder online. It only makes binary data safe for text transmission. For real security, encrypt your data with AES before encoding to Base64. Never use Base64 to hide passwords or sensitive data -- any developer can decode it in seconds using a single function call.
What is URL-safe Base64?
URL-safe Base64 (RFC 4648) replaces + with - and / with _, and removes = padding. Used in JWT tokens, OAuth, and anywhere Base64 appears in a URL. Enable it with the checkbox in Encode mode above.
How much does Base64 increase size?
By approximately 33% — every 3 bytes become 4 Base64 characters. A 100 KB image becomes ~133 KB as a Base64 string. This is the trade-off for text-safe binary transmission. The 33% overhead is acceptable in most cases since text-based formats like JSON and HTML are typically compressed during transfer anyway. Use Base64 for embedding images in HTML/CSS data URIs, encoding file attachments in email (MIME), or passing binary in JSON APIs. Base64 is also used in HTTP Basic Auth headers and in embedding fonts directly in CSS with @font-face data URIs.
How do I decode Base64 in JavaScript?
In a browser: atob(base64string). For Unicode text: decodeURIComponent(escape(atob(base64string))). In Node.js: Buffer.from(base64string, 'base64').toString('utf8'). This tool does the same thing automatically. For URL-safe Base64 in Node.js: Buffer.from(b64str, 'base64url').toString('utf8'). The tool handles both variants without extra steps. Node.js also supports: Buffer.from(data).toString('base64') for standard and Buffer.from(data).toString('base64url') for URL-safe encoding. Both methods produce RFC 4648 compliant output that can be decoded by any standard Base64 library.
How do I decode Base64 in Python?
import base64; base64.b64decode(base64_string).decode('utf-8'). For URL-safe Base64: base64.urlsafe_b64decode(base64_string). Add padding if needed: base64_string += '==' before decoding. Python's urlsafe_b64decode handles the - and _ variants. Always check for missing padding if you get a decode error in Python. Python's standard library handles both standard and URL-safe variants via base64.b64decode() and base64.urlsafe_b64decode() respectively. For very large files, use streaming Base64 encoding in Node.js to avoid loading the entire file into memory at once.
Is my data sent to a server?
No. All encoding and decoding happens in your browser using native JavaScript functions. Nothing is uploaded to Best-TempMail or any other server. All encoding and decoding uses the browser's native btoa() and atob() functions -- your data is processed entirely client-side. The browser functions btoa() and atob() work on ASCII strings -- for Unicode text, encode as UTF-8 first using TextEncoder before calling btoa().
What is the difference between Base64 and Base64URL?
Standard Base64 uses +, /, and = (padding). Base64URL replaces + with -, / with _, and omits =. Both encode the same data — the difference is only which characters are used.
Can I encode a file to Base64?
Yes — click the Encode File button in Encode mode to upload any file. The full Base64 string is shown with a Copy button. Useful for embedding images in HTML/CSS or attaching files in JSON APIs. Base64 is also used in HTTP Basic Auth headers and in embedding fonts directly in CSS with @font-face data URIs.

Need a disposable email? Free temp mail — instant, no signup, no trace.

Get Free Temp Mail ->