How to use Base64 Encoder and Decoder
- 1Text tab: choose Encode or Decode and paste your text. Turn on URL-safe for tokens and URLs. The result updates instantly.
- 2File to Base64 tab: drop an image or any file to get a data URI, plain Base64, and for images a ready-made HTML img tag and CSS background rule.
- 3Base64 to file tab: paste Base64 or a data URI. The file type is detected, images are previewed, and you can download the file.
- 4Use Copy next to any result, or Swap to reverse a text conversion.
Text with any language or emoji
Many simple Base64 tools fail on accented letters, Chinese text or emoji because the browser's built-in function only handles Latin characters. This tool encodes text as UTF-8 first, matching what servers, APIs and command-line tools expect. The decoder accepts standard and URL-safe Base64, missing padding, line breaks and data: prefixes.
If the Base64 you paste is actually a file such as an image or PDF, the Text tab tells you and points you to the file tab instead of showing garbled characters.
Images to Base64 data URIs
Embedding a small icon or logo as a data URI saves an extra request, which is useful for emails, single-file HTML pages and CSS. Base64 makes files about 33 percent larger, so it is best for images of a few KB. For larger images, a normal image file loads faster.
Base64 back to a file
Paste the Base64 from an API response, a JSON field or an email source to recover the file. The type is detected from the file's own signature (PNG, JPG, GIF, WebP, PDF, ZIP, MP3, SVG, text and more) so it downloads with the right extension. Everything runs in your browser; nothing is uploaded.
Frequently asked questions
How do I convert an image to Base64?
Open the File to Base64 tab and drop the image. Copy the data URI, the HTML img tag or the CSS rule.
How do I convert Base64 back to an image?
Paste the Base64 or data URI into the Base64 to file tab. The image is previewed and you can download it.
Is Base64 encryption?
No. Base64 is an encoding that anyone can reverse. Do not use it to protect passwords or private data.
What is URL-safe Base64?
A variant that uses - and _ instead of + and / and drops the = padding, so it can be used in URLs and file names. JWT tokens use it.
Why is my decoded text garbled?
The data is probably a file rather than text, or text in a different encoding. Try the Base64 to file tab to detect its type.