Base64 encode & decode, online
Paste text or drop a file or image to get Base64 instantly. URL-safe, no padding, MIME line breaks, any charset. Everything runs locally in your browser.
Processed in your browser. This page cannot send your data anywhere – how we know
Recommended tools
The tools developers reach for most
Categories
Every flavor of Base64, sorted
How Base64 works
3 bytes in, 4 characters out. That is the whole trick.
“Man” → TWFu
Input not a multiple of 3? The tail is padded with =. Every 3 bytes become 4 characters, so output grows by about 33%. More: padding explained, Base64 vs Base64URL.
Characters worth knowing
The ones you keep seeing in your output, and why
Base64 in your language
Copy-paste snippets for encode and decode
new TextEncoder().encode("hi").toBase64() // aGk=Pythonbase64.b64encode(b"hi").decode() # aGk=PHPbase64_encode('hi'); // aGk=JavaBase64.getEncoder().encodeToString("hi".getBytes()) // aGk=C#Convert.ToBase64String(Encoding.UTF8.GetBytes("hi")) // aGk=Go (Golang)base64.StdEncoding.EncodeToString([]byte("hi")) // aGk=Node.jsBuffer.from("hi").toString("base64") // aGk=Bashprintf '%s' hi | base64 # aGk=Learn
Guides that answer the next question
FAQ
Short answers, links to the long ones
Is Base64 encryption?
No. It is an encoding, and anyone can reverse it. For secrets, encrypt first, then encode. See encoding vs encryption.
What is the difference between Base64 and Base64URL?
Base64URL swaps + and / for - and _ and usually drops padding, so the result is safe in URLs and filenames. Try the Base64URL tool.
Why is my output about 33% bigger?
Every 3 bytes become 4 characters. Line breaks in MIME mode add a little more. Check exact sizes with the size calculator.
Can I convert images and files?
Yes: image to Base64, file to Base64 and back with Base64 to image or Base64 to file. Nothing is uploaded.
Why does decoded text look garbled?
The bytes are probably binary or in another charset. Switch the charset or decode to a file.
What is a data URI?
A Base64 payload with a MIME prefix, like data:image/png;base64,…, which you can embed directly in HTML or CSS. Build one with the data URI generator.
Do you store or see my data?
No. The pages are static files and the tools run in JavaScript on your device. A Content Security Policy blocks every network request from the page except Cloudflare’s page-view count, so there is nowhere for your data to go. Details.
Is base64hub really free?
Yes. No accounts, no limits, no premium tier hiding the good stuff.
Nothing leaves your browser
Every tool here runs on your device. Load a page once and it keeps working offline.