Base64 Encoder and Decoder
Encode and decode Base64 text with full UTF-8 support, or turn any file into a Base64 data URI.
Your files never leave your device. Privacy
Base64 turns any data into plain letters and numbers so it can travel safely through email, JSON, URLs and HTML. Developers use it daily for tokens, small images and API payloads. Encode or decode text here, or convert a whole file.
How to use the Base64 Encoder and Decoder
-
Choose a mode
Use Text for strings, or File to Base64 for images and documents.
-
Encode or decode
Paste text and press Encode or Decode, or drop a file to get its Base64 instantly.
-
Copy or save
Copy the result, download it, or save decoded Base64 as a file.
Features
-
Full UTF-8 support
Accents, Urdu, Arabic, Chinese and emoji encode and decode correctly.
-
URL-safe option
Uses – and _ instead of + and / and drops padding, for URLs and JWT style tokens.
-
File to data URI
Turn images, fonts and small files into data URIs for HTML and CSS.
-
Decode to file
Save Base64 back to a real file, with the type detected from a data URI.
-
Undo and redo
Flip between encoded and decoded versions with Ctrl+Z.
-
Private
Text and files are converted in your browser and never uploaded.
When to use it
Inline images
Embed a small icon or logo directly in HTML, CSS or an email template.
API work
Encode credentials for Basic authentication headers or decode payloads from logs.
Reading tokens
Decode the parts of a token to see what it contains, without sending it anywhere.
Data transfer
Move binary data through systems that only accept text.
Base64 is not encryption
Anyone can decode Base64 in a second, so it hides nothing. Never use it to protect passwords or secrets. It exists to carry data safely through text only channels, not to keep it private.
Why Base64 files are bigger
Base64 uses four characters to represent every three bytes, so encoded data is about 33 percent larger than the original. That is why data URIs suit small images and icons, not large photos.
Base64 in everyday development
HTTP Basic authentication sends “username:password” encoded as Base64 in the Authorization header. Email attachments are Base64 encoded inside the message. JSON Web Tokens use URL-safe Base64 for their header and payload, which is why you can decode and read them, and why they must never contain secrets.
Data URIs, such as data:image/png;base64, followed by the encoded file, let you embed small images straight into HTML and CSS, saving a network request for tiny icons. For anything larger than a few kilobytes, a normal image file is usually faster, because browsers can cache it separately.
Frequently asked questions
How do I decode Base64?
Paste the Base64 text into the box in Text mode and press Decode. If it is a file, press Save decoded as file.
How do I convert an image to Base64?
Choose File to Base64 and drop the image. You get a data URI you can paste into HTML or CSS.
Is Base64 secure?
No. It is an encoding, not encryption, and anyone can reverse it.
What is URL-safe Base64?
A variant that replaces + and / with - and _ and removes = padding, so the result can be used in URLs and file names.
Why does decoding show an error?
The text may be missing characters, contain extra symbols, or represent binary data rather than text.
Is my data uploaded?
No. Encoding and decoding happen entirely in your browser.