Base64 Encoder/Decoder
Encode text or a file to Base64, or decode a Base64 string back to plain text.
About Base64 Encoder/Decoder
Base64 is a way of encoding binary or text data into an ASCII string format, commonly used for embedding data in URLs, JSON, emails, and data URIs. This tool converts plain text (including full UTF-8 text, emoji, and non-Latin scripts) to and from Base64 instantly, and also supports uploading any file — commonly an image — to get its Base64 data URI, ready to paste directly into CSS (background-image: url(...)), HTML (an img tag's src attribute), or JSON. Everything runs locally in your browser; files are never uploaded anywhere.
See Base64 in action: how JWTs use itFrequently Asked Questions
Base64 encoding is commonly used to embed binary data (like images) in text formats such as JSON or HTML, to safely transmit data over text-based protocols like email, and to encode data in URLs and data URIs.
Switch to the File tab, upload your image, and copy the generated data URI — it's ready to paste directly into an <img> tag's src attribute or a CSS background-image property.
Yes, the tool correctly handles multi-byte UTF-8 text including emoji and non-Latin scripts by encoding through UTF-8 bytes before Base64 conversion.
Base64 decoding fails if the input contains characters outside the valid Base64 alphabet or has incorrect padding — double-check you've pasted a complete, valid Base64 string.
Files up to 5MB are supported — Base64 encoding inflates the output by about 33%, so larger files can be slow to handle in a browser tab.
A JSON Web Token is three Base64url-encoded segments joined by dots — header, payload, and signature. Base64url is a URL-safe variant (it swaps a couple of characters and drops padding) but the underlying encoding is the same idea shown here. See our JWT guide for the full breakdown, or the JWT Decoder tool to decode a real token.