Free Base64 Encoder and Decoder
Encode text or any file to Base64, or decode Base64 back to text, images and files. Unicode safe, with URL safe mode and data URI output.
Base64 Encoder and Decoder: Encode text or any file to Base64, or decode Base64 back to text, images and files. Unicode safe, with URL safe mode and data URI output. It is free, needs no sign-up and runs in your browser. How to use it: 1) type text or paste Base64, or switch to the File tab; 2) choose encode or decode and the URL safe option if needed; 3) copy the result, download the decoded file or preview the image.
How Base64 encoding works
Base64 turns any bytes into 64 safe characters (A to Z, a to z, 0 to 9, + and /) so binary data can travel inside text formats such as JSON, email, HTML and CSS. Every 3 bytes become 4 characters, so the output is about 33 percent larger than the input. The = signs at the end are padding.
Text is UTF-8 safe
The browser function btoa fails on accents, emoji and non-Latin scripts. This tool converts text to UTF-8 bytes first, so the result matches what servers, PHP and Python produce, and decoding returns the exact original text.
Decoding
The decoder accepts standard and URL safe Base64, missing padding, line breaks and full data URIs. It checks the first bytes to detect PNG, JPEG, GIF, WebP, SVG, PDF, ZIP and other file types. Images are previewed and any file can be downloaded. Binary data that is not text is shown as a hex preview.
Files to data URIs
On the File tab you get a data URI, the plain Base64 string, a CSS background rule and an HTML image tag. Inlining small icons this way saves a request, but files larger than about 10 KB are usually better served as normal files.
Limitations
Files are limited to 25 MB to keep the browser responsive. Base64 is an encoding, not encryption: anyone can decode it, so never use it to hide passwords or secrets.
Base64 Encoder and Decoder FAQs
What is Base64 encoding used for?
Base64 lets you put binary data such as images, PDFs or keys inside text based formats. Common uses are data URIs in HTML and CSS, email attachments, JSON APIs that carry files, basic authentication headers and JWT tokens. It increases size by about a third, so it is best for small files.
What is URL safe Base64?
URL safe Base64 replaces + with – and / with _ and usually drops the = padding, because those characters have special meaning in URLs and file names. JWT tokens use this variant. This decoder accepts both variants automatically, and the encoder offers a checkbox to produce the URL safe form.
Why does my decoded text look broken?
Broken characters usually mean the text was encoded with a different character set, or the Base64 is actually a binary file such as an image. This tool decodes text as UTF-8 and detects common file types by their first bytes, showing an image preview or a download button instead of unreadable text.
Is Base64 a form of encryption?
No. Base64 only changes how data is written. Anyone can decode it instantly without a key, so it gives no protection. To keep data secret, use real encryption such as AES, and to check that data has not changed, use a hash such as SHA-256.
Want our experts to implement these improvements?
Get professional support from Hayyat Networks. Request a free consultation.
