Upload a file

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.

Base64URL encoderMIME encoderData URI generatorBase64 to imageBase64 to PDFBase64 to hexBase64 validator
Input 0 BOutput 0 BSize –

Processed in your browser. This page cannot send your data anywhere – how we know

Recommended tools

The tools developers reach for most

Browse all 132 tools

Categories

Every flavor of Base64, sorted

All tools

How Base64 works

3 bytes in, 4 characters out. That is the whole trick.

Full explainer

“Man” → TWFu

Text
Man
Bytes
7797110
Bits
010011010110000101101110
6-bit
010011010110000101101110
Index
1922546
Base64
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

All 65 characters

Base64 in your language

Copy-paste snippets for encode and decode

All languages

Learn

Guides that answer the next question

All guides

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.

All toolsHow we prove it