Skip to content
/>codemaxxed.com

Base64 encoder

Encode text, hex or byte arrays to Base64 and decode it back — standard, URL-safe, data: URI or PEM. Handles UTF-8, UTF-16LE (PowerShell) and Latin-1, detects file types, unpacks gzip, and explains malformed input.

Runs locally. Nothing is uploaded.

Text or Base64

Base64

Output appears here as you type.

Ready

How this converter works

Base64 turns arbitrary bytes into 64 printable characters so they survive text-only channels: JSON strings, email, data URLs, environment variables or a JWT segment. Every 3 bytes become 4 characters. It is an encoding, not encryption — anyone can reverse it.

Text is converted to bytes first, and the character set matters: UTF-8 is the default everywhere except Windows, where PowerShell's -EncodedCommand expects UTF-16LE. Naive btoa() throws on emoji; this tool encodes the bytes, so 🚀 round-trips. Switch Input to Hex bytes or Decimal bytes to encode raw bytes, such as a hash or a Java byte[].

The URL-safe variant (base64url) swaps + and / for - and _ and usually drops the = padding; JWTs use it. Decode accepts either alphabet, ignores line breaks and whitespace, strips data: URI and PEM headers, and tells you exactly which character or length is wrong. Set Output to Standard or URL-safe Base64 to convert between them.

Decoded bytes that aren't text are identified from their magic bytes (PNG with its dimensions, PDF, ZIP, gzip, DER certificates…) and shown as a hex dump. gzip and zlib payloads are decompressed automatically, and the tool warns about double-encoded data, non-canonical padding, mixed alphabets and + signs lost in URLs. Decoded images are previewed inline, and any binary result can be saved as a file.

Frequently asked

Is Base64 encryption?

No. It is a reversible encoding with no key. Treat Base64-encoded data as public: it only hides bytes from channels that can't carry them, not from people.

Why does Base64 make my data bigger?

Every 3 bytes become 4 characters, so the output is about 33% larger (plus line breaks if wrapped). The Overhead chip shows the exact cost.

Why do JWT segments look like Base64 but fail to decode elsewhere?

JWTs use URL-safe Base64 without padding. Decode normalizes - and _ and restores padding; paste a whole JWT and its header and payload are decoded as JSON.

How do I make a PowerShell -EncodedCommand?

Set Character set to UTF-16LE and encode your script. PowerShell decodes -EncodedCommand as UTF-16LE, so UTF-8 Base64 produces garbage. A ready-to-run command is shown below the output.

Why is my decoded output different from `echo hello | base64`?

echo adds a trailing newline, so it encodes "hello\n" (aGVsbG8K) rather than "hello" (aGVsbG8=). Use echo -n or printf. The tool notes when your input ends with a line break.

What do 64 and 76 character line lengths mean?

PEM files (certificates, keys) wrap Base64 at 64 characters; MIME email (RFC 2045) wraps at 76. Most decoders, including this one, ignore line breaks.

Can I encode an image or other binary file?

Yes. Open or drop the file: its bytes are loaded as-is (Input switches to Base64), so Encode gives its Base64, Data URI gives a ready data: URI with the detected MIME type, and PEM armors DER keys and certificates. Decoding binary shows a preview for images and a button to download the file.

Is my data uploaded?

No. Encoding, decoding and decompression run entirely in your browser.