ToolStack

Base64 Encode / Decode

Encode and decode Base64 text.

Advertisement

What is Base64 encoding?

Base64 is a binary-to-text encoding that represents arbitrary data using 64 printable ASCII characters — the letters A–Z and a–z, the digits 0–9, and the symbols + and /, with = used for padding. Every three bytes of input are mapped onto four Base64 characters, which is why encoded output is roughly 33% larger than the original data.

Its purpose is to let binary or non-ASCII content travel safely through systems that were designed for plain text — email bodies, HTTP headers, JSON string fields, data URIs, and configuration values — without being corrupted by characters those systems treat specially. This tool encodes and decodes in a fully Unicode-aware way, so emoji and non-Latin scripts round-trip correctly through UTF-8. Understanding the size and character behaviour up front prevents the surprises that occur when encoded data is dropped into a length-limited field or a strict text protocol.

Encoding is not encryption

The single most important thing to understand about Base64 is that it provides no security whatsoever. It is an encoding, not encryption: there is no key, and anyone can decode a Base64 string back to its original bytes instantly. Treating it as a way to hide secrets is a common and dangerous mistake.

A credential stored or transmitted as Base64 is, for all practical purposes, plaintext. If you need confidentiality, use real encryption such as AES or TLS. Base64 only makes data transport-safe; it never makes it private. A useful mental model is that Base64 is like writing in a different alphabet, not locking data in a safe: the message is trivially legible to anyone who recognizes the alphabet.

Where Base64 shows up in web development

You encounter Base64 constantly once you know to look for it. Data URIs embed small images or fonts directly in HTML and CSS as Base64. HTTP Basic Authentication sends credentials as a Base64 string. The header and payload of a JSON Web Token are Base64URL encoded — a URL-safe variant that swaps + and / for - and _. MIME email attachments and binary blobs stored inside JSON all rely on it too.

The security implications follow from the point above: use Base64 freely to make binary data portable, but never as a substitute for protecting sensitive information, and remember the roughly one-third size increase when it matters for bandwidth or storage. Recognizing the base64url variant in particular saves confusion when a token fails to decode simply because its - and _ characters were treated as standard Base64.

Common use cases

Inspecting a JWT

Decode the Base64URL header and payload segments of a JSON Web Token to read its claims while debugging authentication.

Building data URIs

Encode a small image or font to Base64 to embed it directly in HTML or CSS and save an extra network request.

Crafting Basic Auth headers

Encode a username and password pair to construct or verify an HTTP Basic Authentication header during API testing.

How to use

  1. Type or paste your text or Base64 string.
  2. Choose Encode or Decode.
  3. Copy the transformed result.
Advertisement

Frequently asked questions

Does it support emoji and non-Latin characters?

Yes. Encoding and decoding are UTF-8 aware, so emoji, accented letters, and scripts such as Arabic, Cyrillic, and CJK round-trip correctly without corruption.

Is Base64 a form of encryption?

No. Base64 is encoding, not encryption. Anyone can decode it, so it provides no confidentiality. Use it to make data transport-safe, never to protect secrets.

Why does decoding fail on some input?

Decoding fails when the input contains characters outside the Base64 alphabet or has incorrect padding. Removing stray whitespace or line breaks and confirming the string is complete usually resolves it.

Can I use this to decode a JWT?

You can decode the individual header and payload segments of a JWT, which are Base64URL encoded, to inspect their contents. For a fully parsed view, use a dedicated JWT decoder.

Is my input uploaded when I encode or decode?

No. All processing happens in your browser, so credentials, tokens, and other sensitive strings never leave your device.

Related tools

Category: Developer Utilities