Encoding

Base64 Encoder & Decoder

Encode any text to Base64, or decode Base64 back to text. URL-safe variant available. All processing happens locally in your browser.

Advertisement

About Base64 encoding

Encode arbitrary text or binary data into Base64. And decode it back. Standard and URL-safe variants supported. Everything runs locally in your browser; nothing is uploaded.

What Base64 is

Base64 is a binary-to-text encoding. It converts arbitrary bytes. An image, a binary blob, a string of text. Into a sequence of 64 printable ASCII characters: A-Z, a-z, 0-9, plus the characters + and /. The result is safe to paste into JSON, store in a database column, send in an email body, or include inline in HTML and CSS.

Three things Base64 is not: encryption, compression, or hashing. The transformation is fully reversible by anyone. Encoding makes data portable, not secret.

Why use Base64 at all

Three real-world reasons:

The URL-safe variant

Standard Base64 produces +, /, and = characters. + in a URL means "space." / is a path separator. = is a query-string symbol. None of them survive round-trips through URL parsing without percent-encoding.

The fix is Base64URL. A variant defined in RFC 4648 §5 that swaps + for - and / for _. The padding (=) is sometimes also stripped. Toggle "URL-safe" in the encoder when the result will travel through URLs, JWT segments, or filenames.

Common pitfalls

Base64 vs other encodings

EncodingOutput alphabetSize overheadUse case
Base6464 chars~33%Email, JSON embedding, generic binary→text
Base64URL64 chars (URL-safe)~33%JWTs, URLs, filenames
Hex16 chars~100%Hashes, low-level debugging
Percent-encodingvariable0-200%URL components
Base3232 chars~60%Filenames on case-insensitive systems
Base85 (ASCII85)85 chars~25%PostScript, PDF embedded data

How the tool works

The encoder reads your input as UTF-8 bytes (the standard for any text in 2026), then converts to the chosen Base64 variant. Standard or URL-safe. The decoder reverses the process, with auto-padding and whitespace tolerance to handle real-world Base64 strings that may have been wrapped or stripped.

Everything runs locally. The text never leaves your browser. Useful for sensitive data, internal IDs, or anything covered by an NDA.

Local-only encoding. Both encode and decode happen entirely in your browser. Nothing is uploaded, logged, or transmitted.

Workflow tips

The size penalty

Every 3 input bytes become 4 output characters. The output is roughly 4/3 (33%) larger than the input. Plus the padding (=) at the end and any whitespace some implementations add to wrap long output. For small inputs the overhead is invisible; for large files (above ~100KB) it starts to matter and you should prefer real binary transport over Base64-in-text where possible.

Frequently asked questions

Is Base64 encryption?

No. Base64 is encoding, not encryption. It converts binary data to a printable ASCII representation, but anyone can decode it. Don't use it to hide secrets.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses '+', '/', and '=' characters. URL-safe Base64 replaces '+' with '-' and '/' with '_' so the result can travel safely in URLs without percent-encoding. The '=' padding is sometimes omitted in URL-safe variants.

Why does my decoded text contain weird characters?

Base64 is a wrapper around bytes. Not text. If the original input was binary (an image, a compressed blob), decoding produces those raw bytes. To preserve text encoding, both encode and decode in the same character set (UTF-8 by default).

How big does Base64 make my data?

About 33% larger. Every 3 bytes of input becomes 4 bytes of output, plus padding. A 1MB image becomes ~1.34MB as Base64.

Can I decode a Base64 string without padding?

Yes. Most decoders accept missing padding. The TextKit Base64 decoder auto-pads if needed before decoding.

Is Base64 the same as Base64URL or Base64URL-safe?

Base64URL and URL-safe Base64 are the same thing. The variant with '-' and '_' instead of '+' and '/'. Toggle the URL-safe option in the encoder to produce it.

Advertisement

Related