Base64 Encoder & Decoder
Encode or decode Base64 text and files — UTF-8 safe, URL-safe variant and data URIs.
- Free
- No sign-up
- Runs in your browser
What is a Base64 encoder and decoder?
Base64 is a way of writing binary data using only 64 safe characters: A to Z, a to z, 0 to 9, plus and slash, with equals signs as padding. It exists so that images, files and arbitrary bytes can travel through systems built for text, such as email, JSON, HTML attributes and HTTP headers. A Base64 encoder turns data into that text form; a decoder turns it back.
This tool has two modes. Text mode encodes and decodes strings with proper UTF-8 handling, so emoji, Arabic, accented letters and other non-Latin text survive the round trip intact. Many quick encoders use the browser's raw btoa function, which throws an error or corrupts anything outside basic Latin characters; this one does not. A toggle switches to the URL-safe variant, which replaces plus with hyphen and slash with underscore and drops the padding, and the tool auto-detects Base64 when you paste it so you can decode without changing settings.
File mode converts any file into a Base64 string or a complete data URI, showing the detected MIME type and the size overhead, which is roughly 33 percent because every 3 bytes become 4 characters. It also works in reverse: paste Base64 and download it as a file. Output updates live as you type, and everything happens in your browser.
How to encode or decode Base64 online
- 1
Pick text or file mode
Use text mode for strings such as tokens, credentials or snippets. Use file mode for images, fonts, PDFs or any other file.
- 2
Enter your input
Type or paste text, or choose a file. If you paste something that looks like Base64, the tool detects it and offers the decoded result.
- 3
Choose standard or URL-safe
Leave the toggle off for standard Base64. Turn it on when the result will go into a URL, a filename or a JWT-style token, where plus, slash and equals signs cause problems.
- 4
Check the live output
The result appears as you type. In file mode, review the MIME type and the size overhead before you embed a large data URI in a page.
- 5
Copy or download
Copy the encoded or decoded text, or download decoded Base64 as a file with the original contents restored.
Common uses for Base64 encoding
Inlining small images and icons
A data URI lets you embed a tiny SVG or PNG directly in CSS or HTML, saving a request. File mode builds the full data URI with the correct MIME type, ready to paste.
Reading tokens and API payloads
JWT segments, webhook signatures and some API fields are Base64 or Base64url. Decoding them shows the underlying JSON so you can check claims, expiry times and user IDs while debugging.
HTTP Basic authentication
The Authorization header for Basic auth is the word Basic followed by username and password, joined by a colon and Base64-encoded. Encode or decode the value to confirm credentials are being sent correctly.
Recovering embedded files
Email sources, JSON exports and logs sometimes contain attachments as long Base64 blocks. Paste the block into file mode and download it to get the original file back.
Handling multilingual text safely
When passing Arabic, Chinese or emoji-heavy strings through systems that mangle non-ASCII characters, UTF-8-safe Base64 keeps the text intact end to end.
Base64 tips: overhead, URL-safe output and security
Base64 always makes data bigger. Every 3 input bytes become 4 output characters, so expect about 33 percent overhead, plus a little more if line breaks are added. That is why data URIs suit small assets only. Inlining a 200 KB hero image into CSS adds roughly 67 KB of weight, blocks rendering until the stylesheet loads and prevents the image from being cached separately, which can hurt Core Web Vitals rather than help.
Standard and URL-safe Base64 encode the same bytes with slightly different alphabets. If a decoder complains about invalid characters, check whether the input contains hyphens and underscores, which means it is URL-safe, or plus and slash, which means it is standard. Missing padding is normal in the URL-safe form.
Finally, Base64 is encoding, not encryption. Anyone can decode it in a second, so never treat a Base64 string as a way to hide passwords, API keys or personal data. If you see credentials stored in Base64 in a config file or a repository, they are effectively in plain text.
Frequently asked questions
Is the Base64 encoder free?
Yes, the Base64 encoder and decoder is free to use, with no account, no watermark and no limits on how many strings or files you convert. Text mode, URL-safe output, file to data URI conversion and Base64 to file downloads are all included. It is meant for developers and technical SEOs who need a reliable converter that handles Unicode correctly.
Are my files or text uploaded anywhere?
No, nothing you enter leaves your browser. Encoding and decoding run locally in JavaScript, and files are read directly from your device without being sent to our server. That matters because Base64 strings often contain access tokens, credentials or private documents, which you should never paste into a tool that processes data on a remote server.
Why does my emoji or Arabic text break in other Base64 tools?
Many tools call the browser's btoa function directly, which only accepts characters in the Latin-1 range and fails on anything else. This tool first converts your text to UTF-8 bytes and then encodes those bytes, so emoji, Arabic, Hindi, Chinese and accented characters decode back exactly as they were entered.
What is URL-safe Base64?
URL-safe Base64, often called Base64url, is a variant that replaces plus with a hyphen and slash with an underscore, and usually omits the trailing equals padding. Those changes let the string sit inside URLs, query parameters, filenames and JWTs without extra escaping. The underlying data is identical; only the alphabet and padding differ.
Why is the Base64 output larger than the original file?
Base64 output is larger because it represents every 3 bytes of data with 4 text characters, adding roughly 33 percent to the size. File mode shows the original size and the overhead so you can decide whether embedding makes sense. For anything beyond a few kilobytes, serving the file normally is usually faster.
Is Base64 a form of encryption?
No, Base64 is not encryption and provides no security. It is a reversible encoding with no key, so anyone with the string can decode it instantly using this or any other tool. Use it to transport data safely through text-based systems, and use real encryption or a secrets manager when you need to protect sensitive values.
Related tools
More Developer tools →JSON Formatter & Validator
Format, validate and minify JSON with exact error locations and a collapsible tree view.
Developer · In-browser
URL Encoder & Decoder
Percent-encode or decode URLs and inspect every part — host, path and query parameters.
Developer · In-browser
Redirect Generator
Turn old → new URL lists into redirect rules for Apache, Nginx, Cloudflare, Vercel and more.
Developer · In-browser
QR Code Generator
Free QR codes for links, Wi-Fi, vCards, email and WhatsApp — with your logo, colours and SVG/PNG export.
Developer · In-browser