Base64 Encode / Decode
Encode text to Base64 or decode it back.
Base64 turns binary data into plain ASCII text, commonly used for embedding images in code, API tokens and email attachments.
Related tools: Regex Tester
Read the guide: How to Encode and Decode Base64 — Text, Files and Data URLs
Quick answers
Is Base64 the same as encrypting my text?
No, not at all. Base64 just rewrites your text's bytes using a different set of characters so the data can travel through systems that only handle plain text safely. There's no password and no key involved, and anyone can reverse it instantly with any decoder, including this one.
Think of it like writing a note in block capitals instead of handwriting. The words are exactly the same and anyone can still read them. You've changed how it looks, not who can read it. People use Base64 for things like embedding data in JSON or sending binary data through text-only channels, never for keeping secrets. If your text actually needs protecting, that's a job for real encryption, which this tool doesn't do.
Why is Base64 output about a third longer than the input?
Because the encoding works in fixed blocks. Every 3 bytes of input become 4 Base64 characters, no exceptions, so the output grows by roughly 33% every time. A 900-byte payload comes out at exactly 1,200 characters, and that ratio holds whether you're encoding a word or a whole page of text.
There's no compression hiding in the process to offset that growth. Base64 trades size for safety. You pay about a third extra in length, and in exchange your data can pass through systems that would corrupt or reject raw bytes. If size matters more than that safety, Base64's the wrong tool, and you'd want compression first, or instead.
Why does the same text sometimes encode differently in other tools?
Usually it's not the Base64 step that differs, it's what happens before or after it. Some tools use the URL-safe alphabet with - and _ instead of + and /, some wrap the output into short lines, and some handle the text's bytes differently. This tool keeps it plain: UTF-8 bytes, standard alphabet, one unbroken string.
So if you encode something here and somewhere else and the results don't match, check those three things first. Look at the last characters for alphabet swaps, look for line breaks, and check whether the other tool treated your text as something other than UTF-8. Nine times out of ten the mismatch is one of those, not a bug in either tool.
How to use
- Paste text to encode, or Base64 to decode.
- Click the direction you need — the result appears below.
- Copy it with one click.
About this tool
Note: Base64 is encoding, not encryption — anyone can decode it. Never treat it as secure.
All processing happens locally in your browser.
How it works
Base64 turns binary data into plain ASCII text. It takes every 3 bytes (24 bits), splits them into four 6-bit groups, and maps each group to one of 64 characters: A–Z, a–z, 0–9, +, /. When the input length is not a multiple of 3, = padding is added so the output length is always a multiple of 4.
For example, 'Man' (bytes 4D 61 6E) becomes 'TWFu'. 'Ma' (2 bytes) becomes 'TWE=' — the missing byte is replaced by one = pad. Three input bytes always produce exactly four output characters, so Base64 output is roughly 33% larger than the input.
Base64 is encoding, not encryption — anyone can decode it instantly. It exists so binary data can travel through text-only channels: email attachments (MIME), data URIs in CSS and HTML, and JSON fields that must stay valid UTF-8.
Before any Base64 happens, your text gets turned into UTF-8 bytes. That's step one, and it's where a lot of confusion starts. Base64 doesn't encode characters. It encodes bytes. So the tool first asks, what bytes does this text become in UTF-8, and only then does the encoding start.
That step changes the size of things you might not expect. Plain English letters are one byte each in UTF-8, neat and tidy. But an accented letter takes two. Take café. It's four letters on screen, but it's five UTF-8 bytes, because the é needs two bytes. Those five bytes encode to Y2Fmw6k=. And a check mark, ✓, is a single symbol that takes three bytes in UTF-8, and it encodes to 4pyT. If you count characters on screen and expect the output size to match, you'll be off every time there's anything beyond basic English.
Once it's bytes, the actual Base64 step is mechanical. The tool takes the bytes three at a time and turns each group of three bytes into four Base64 characters. Three in, four out, over and over until the bytes run out. That's the whole trick. There's no compression in there, no clever shrinking.
Which means the output size is predictable down to the character. A 900-byte payload becomes exactly 1,200 characters, because 900 divided by 3 is 300 groups, times 4 characters is 1,200. In general, Base64 output runs about 33% bigger than what you put in. If your input length isn't a neat multiple of three bytes, the last group gets padded with = signs to round it out to four characters, which is why so many encoded strings end the way they do.
What this tool can’t do
Let's get the big one out of the way first. Base64 isn't encryption. It isn't close to encryption. Anyone who gets your encoded string can decode it in about two seconds, no password, no key, nothing. Here's the test you can carry to any tool like this: if a Base64 string would embarrass you once it's decoded, it was never protected. You just rewrote it in a different alphabet, that's all.
This tool handles text only. You paste text in, you get text out. It won't encode a file for you, not an image, not a PDF, not anything you upload. If you've got a file you need encoded, you'll have to use something built for that job instead.
It also uses the standard Base64 alphabet only, the one with + and / in it. There's no URL-safe variant here, so you won't get the - and _ version. That matters if you paste the output straight into a URL or a query string. A raw + or / in the wrong spot can get mangled or misread, and your string breaks for reasons that have nothing to do with the encoding itself.
There's no MIME-style line wrapping either. Real email systems chop Base64 into lines of 76 characters. This tool gives you one continuous string. Most modern systems don't care, but if you're feeding output into something old and picky that expects wrapped lines, you'll need to break it up yourself.
If a decode fails, the tool just tells you the input isn't valid Base64. It won't point at the bad character or tell you which position broke. You'll have to eyeball it yourself, and usually it's a stray space, a truncated paste, or a character that wandered in from somewhere else.
Long inputs aren't really this tool's problem, since it runs in your browser. But whatever system you're pasting the output into might cap its field sizes. A database column, an API, a form field, any of them can quietly reject or cut off a long string. The encoding worked. The destination just said no.
Worked examples
A quick sanity check: Encode 'hello' and you get 'aGVsbG8=' — five input bytes become eight output characters with a single = pad. Decode it back and you get 'hello' again, byte for byte.
Binary data inside JSON: An API returning a small thumbnail can embed it as {"thumb": "iVBORw0KGgo..."} instead of a second download — the client decodes the string back to image bytes.
Encoding café and a check mark, byte by byte: Type café into the encoder and you'll get Y2Fmw6k=. Here's why it's that long. In UTF-8, the c, a, and f are one byte each, but the é takes two bytes, so you're encoding five bytes total, not four. Five bytes split into a group of three and a group of two, the second group gets padded with one = sign, and out comes an 8-character string. Now try the check mark on its own: ✓. One symbol, but it's three bytes in UTF-8, exactly one full group, so it encodes cleanly to 4pyT with no padding at all. Same tool, same rules. The difference is entirely in how many bytes UTF-8 needed before Base64 even got started.
Quick reference
| Input bytes | Output chars | Padding |
|---|---|---|
| 3 | 4 | none |
| 2 | 4 | one = |
| 1 | 4 | two == |
The 64-character alphabet: A–Z map to values 0–25, a–z to 26–51, 0–9 to 52–61, then + is 62 and / is 63.
Frequently asked questions
Is Base64 encryption?
No — it is just an encoding. Anyone can decode Base64, so never use it to "protect" secrets.
Does it support emoji and Chinese characters?
Yes — this tool handles full Unicode correctly.
Is my input uploaded?
No. Everything runs in your browser.
Why does my encoded output end with = signs?
That's padding, and it's normal. Base64 works in groups of 4 characters, so when your last chunk of bytes doesn't fill a group neatly, the tool adds one or two = signs to round it out. One = means the last group had 2 bytes in it, two = signs mean it had just 1. It isn't part of your data, but don't strip it off. Some decoders get fussy and reject unpadded strings, so leave it where it is.
Can I paste Base64 output straight into a URL?
Carefully, and sometimes not at all. This tool uses the standard alphabet, which includes + and /. Both can cause trouble in a URL. A + often gets read as a space in query strings, and a / looks like a path separator. If you must put encoded data in a URL, percent-encode the output first, or use a URL-safe Base64 variant from a tool that offers one. This one doesn't.
Why does decoding fail even though my string looks like Base64?
Usually because something small got in or something small went missing. A stray space from a copy-paste, a line break in the middle, a character that isn't in the Base64 alphabet at all, or a string that got cut off at the end will all do it. The tool won't point at the exact spot, so check the ends first. Truncated pastes are the most common culprit, especially with long strings copied out of chat windows and emails.
First time embedding? Read the step-by-step guide →
More free tools
Image to Base64 Converter
Encode an image as a Base64 data URI.
URL Encoder / Decoder
Encode or decode URLs and query strings.
JSON Formatter & Validator
Format, minify and validate JSON in one click.
SHA-256 Hash Generator
Generate SHA-256 / SHA-512 hashes instantly.
Morse Code Translator
Translate text to morse code and back.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.