Encode · Decode

Base64 Encode / Decode

Convert text to Base64, or Base64 back to plain text. Split input by line to process multiple items in one batch.

Input

Output

What is Base64?

Base64 is an encoding scheme that represents binary data as plain text, using 64 printable characters (A–Z, a–z, 0–9, +, /) to stand in for raw bytes. It's commonly used for email attachments (MIME), embedding small images inside CSS or JSON, and carrying tokens through HTTP headers and URLs. Encoding is not encryption — anyone can decode it, so don't use it to hide sensitive data. It exists to make binary data safe to pass through systems built for text.

When to use batch mode

Use "process each line separately" when you need to encode or decode a list of API keys, emails, JWT segments, or config values at once, instead of running the tool once per item. One item per line in, one result per line out, in the same order — useful when you're auditing a batch of tokens or preparing a list of encoded values for a config file.

Common errors and what they mean

"Invalid character" or garbled decode output

Base64 only uses A–Z, a–z, 0–9, +, /, and = for padding. If your input has line breaks, quotes, or a leading "data:image/png;base64," prefix copied in by accident, strip those first — the decoder will otherwise try to interpret them as data and produce garbage or an error.

Output ends with one or two = signs — is that a mistake?

No, that's padding, not an error. Base64 processes data in 3-byte groups; when the input length isn't a multiple of 3, one or two = characters are appended so the output length stays a multiple of 4. It's part of the standard, not a sign something went wrong.

Decoding a JWT and getting broken text

JWTs use Base64URL, a variant that replaces + with - and / with _, and typically drops the padding = entirely. Standard Base64 decoders can choke on this. If a JWT segment won't decode cleanly, that URL-safe variant is almost always why.

FAQ

Is my data sent anywhere when I use this tool?

No. Encoding and decoding both run using your browser's built-in btoa()/atob() functions — there's no network request involved at any point, which you can verify by checking the Network tab in your browser's dev tools while you use it.

Can I encode an image or file, not just text?

This tool is built for text input. For image-to-Base64 conversion, browsers typically produce this automatically via a FileReader's readAsDataURL — if you need that specific workflow regularly, it's worth scripting directly rather than pasting through a text box.

Why does my decoded text show broken characters for non-English input?

This usually means the original text was encoded using a different character set than UTF-8 before Base64 was applied. This tool assumes UTF-8 on both ends; if the source system used something else (like Latin-1 or EUC-KR), the bytes will decode to the wrong characters even though the Base64 itself is valid.