Developer Tools
Base64 Encoder & Decoder
Encode text and files to Base64 or decode Base64 back to readable text, images and downloadable files. Supports UTF-8 characters such as Urdu, Arabic and emoji, URL-safe Base64 and data URIs.
Encode or Decode Base64
Type or paste text, or choose a file to encode. To decode, paste Base64 or a data URI and press Decode.
How to Use the Base64 Tool
- Encode text: type or paste text and press Encode.
- Decode text: paste a Base64 string and press Decode. If the result is text, it appears in the result box.
- Encode a file: press Encode a File and choose any file up to 20 MB, such as an image, PDF or font. You can copy the plain Base64 or a ready-to-use data URI.
- Decode to a file: paste Base64 or a data URI of an image, PDF or other file and press Decode. Images are previewed and any binary data can be downloaded.
What Is Base64?
Base64 is a way of representing any data, including images and other binary files, using only 64 safe text characters: A–Z, a–z, 0–9, + and /, with = used as padding at the end. It lets binary data travel through systems that were designed for text, such as email, JSON, XML, HTML and URLs.
Every 3 bytes of input become 4 Base64 characters, so encoded data is about 33% larger than the original. Base64 is an encoding, not encryption: anyone can decode it, so it must never be used to hide passwords or secrets.
Example
| Text | Base64 |
|---|---|
Hello | SGVsbG8= |
ConverterFox | Q29udmVydGVyRm94 |
سلام | 2LPZhNin2YU= |
Common Uses of Base64
- Data URIs: embedding small images, icons and fonts directly in HTML or CSS, for example
<img src="data:image/png;base64,...">, to save an HTTP request. - Email attachments: MIME encodes attachments in Base64 split into 76-character lines.
- APIs and JSON: sending images, PDFs or other files inside a JSON request or response.
- HTTP Basic authentication: the
Authorization: Basicheader containsusername:passwordencoded in Base64. Because it is not encrypted, it must only be sent over HTTPS. - JSON Web Tokens: each part of a JWT is encoded with URL-safe Base64. Use the JWT Decoder to read them.
- Kubernetes secrets and configuration files, which store values in Base64.
Standard vs URL-Safe Base64
The + and / characters in standard Base64 have special meanings in URLs and file names. URL-safe Base64 (also called Base64URL) replaces them with - and _ and usually removes the = padding. It is used in JWTs, some APIs and web links. This decoder accepts both forms automatically. Tick URL-safe before encoding if you need Base64URL output.
Unicode and Emoji
The browser's built-in btoa() function fails on characters outside Latin-1, such as Urdu, Arabic, Chinese and emoji. This tool converts text to UTF-8 bytes first, which is the standard used by almost every system, so non-English text encodes and decodes correctly.
Privacy
Encoding and decoding happen in your browser. Text and files are never uploaded, so the tool is safe for configuration values, tokens and private documents.
Frequently Asked Questions
How do I decode a Base64 string?
Paste the Base64 into the box and press Decode. Text appears in the result box. Images are previewed, and other files can be downloaded.
How do I convert an image to Base64?
Press Encode a File and choose the image. Copy the Base64 output, or use "Copy as data URI" to get a string you can use directly in an img tag or CSS.
Is Base64 encryption?
No. Base64 is an encoding that anyone can reverse. Never use it to protect passwords or sensitive data. Use proper encryption instead.
Why is my Base64 string longer than the original?
Base64 represents every 3 bytes with 4 characters, so the encoded result is about one third larger than the original data.
What is URL-safe Base64?
It replaces + with - and / with _ and normally drops the = padding, so the result can be used safely in URLs, file names and JWTs.
Does this tool support Urdu, Arabic and emoji?
Yes. Text is encoded as UTF-8 before conversion, so all languages and emoji work correctly in both directions.