Base64 Encode / Decode
Encode text to Base64 or decode it back, with URL-safe, padding, and data-URI options.
Your data is processed entirely in your browser and is never uploaded.
Tool workspace
Drag & drop file here or browse
Options
×100%
Encode or decode in three steps
Paste or upload
Text to encode, or Base64 to decode. It recomputes live as you type.
Pick the variant
Standard or URL-safe alphabet, with or without padding, optionally wrapped as a data URI.
Read & copy
Watch the expansion meter, see what a decoded blob actually is, then copy or download.
Text that can cross any transport
Base64 encodes data as a compact ASCII alphabet so it survives transports that only carry text. Every 3 bytes of input become 4 printable characters, so encoded output is always at least ~33% larger than its byte length, more for non-ASCII, since characters like emoji expand to several bytes first. The tool encodes and decodes in either the standard alphabet (+ /) or the URL-safe one (- _), with optional padding and optional data-URI wrapping. On decode it reads the first bytes of the result and names common formats: PNG, JPEG, PDF, GIF, WebP, ZIP, gzip, or marks it as JSON or plain text, and shows a byte count for binary payloads instead of unreadable characters.
Things to know
Not every string is valid Base64
Decoding rejects characters outside the alphabet and a length that's misaligned. Load this and the tool names the problem.
hello world!!!
Standard vs URL-safe
Standard Base64 uses + and /, which are awkward inside URLs and filenames. URL-safe swaps them for - and _ and usually drops the = padding. It's what JWTs and most tokens use.
a+b/c==
Encoding always grows the text
Every 3 bytes become 4 characters, so encoded output is ~33% larger. The meter shows the ratio live. Base64 is for transport, not compression.
Base64 is not encryption
It's a trivially reversible encoding, not protection. Anyone with the string can decode it, so don't Base64 something sensitive and call it secure.
Try these
hello world
Switch to Encode and watch a short sentence expand.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Switch to Decode and the tool names the payload format.
What is the meaning of life, the universe, and everything?
Pick the URL-safe alphabet and the output swaps + / for - _.
pair this withPercent-encode instead → URL Encode / Decode·Validate decoded JSON → JSON Validator·Decode a JWT → JWT Decoder
Go deeper
Frequently asked questions
Is my input uploaded anywhere?
No. Encoding and decoding run entirely in your browser, in a background worker for large inputs. Nothing you paste leaves your machine.
What's the difference between Standard and URL-safe?
Standard Base64 uses + and /, which are awkward inside URLs and filenames. URL-safe swaps them for - and _ and usually drops the = padding. It's what JWTs and most tokens use.
Why does the output get bigger when I encode?
Base64 represents every 3 bytes of input as 4 printable characters, so encoded text is always at least ~33% larger than its byte length. It's more for non-ASCII, since characters like emoji expand to several bytes first. The meter shows that ratio live.
What does the tag on decode mean?
When you decode, the tool reads the first bytes of the result and names common formats: PNG, JPEG, PDF, GIF, WebP, ZIP, gzip. Or it marks the payload as JSON or plain text. If the payload is binary, you get a clean byte count instead of unreadable characters.
Is Base64 encryption?
No. Base64 is an encoding with no key, anyone can decode it. Use it for transport, not secrecy. See What Is Base64 Encoding for why it hides nothing.
How do I decode Base64 in Python or JavaScript?
Python: base64.b64decode('SGVsbG8=').decode(). JavaScript: atob('SGVsbG8=') in the browser or Buffer.from('SGVsbG8=', 'base64').toString() in Node. See Base64 Decode in Python, JavaScript, and Java for padding and URL-safe fixes.