Base64 Encoder / Decoder

Encode or decode Base64 strings instantly. 100% private.

Output will appear here...

Quick Examples

Base64 converts binary or text data into a set of 64 printable characters — A-Z, a-z, 0-9, plus, and slash — which is why it shows up so often in places that only reliably handle plain text: embedding small images directly inside CSS or HTML, passing data safely through URLs and JSON payloads, or attaching files within email systems built around text transport.

It's important to be clear about what Base64 is not: it is an encoding, not encryption. There is no secret key involved, and anyone with the encoded string can decode it back to the original data instantly. It should never be used as a way to hide or protect sensitive information.

This tool encodes plain text into Base64 or decodes a Base64 string back into readable text, all processed locally in your browser using native JavaScript functions, with the result available to copy immediately.

The choice of exactly 64 characters isn't arbitrary — it's the largest set of characters that's both printable and safe across virtually every text-based system, including older email protocols that were originally built to handle only plain 7-bit ASCII text, long before binary-safe transport was standard.

Understanding this history explains why Base64 still shows up in modern contexts too: JSON Web Tokens (JWTs) used for web authentication encode their header and payload sections in a URL-safe variant of Base64, and data URIs embedding small images directly in HTML or CSS use standard Base64 to represent that binary image data as text.

It's also worth understanding a subtle but important distinction: Base64 encoding is deterministic, meaning the same input always produces exactly the same output, which is different from hashing functions that are specifically designed to be one-way. This determinism is exactly why Base64 is reversible and unsuitable for security purposes, while a proper hash function serves a fundamentally different purpose.

Step-by-step instructions

  1. 1

    Choose encode or decode mode

    Select whether you're converting text to Base64 or Base64 back to text.

  2. 2

    Paste your input

    Enter the text or the Base64 string you want to convert.

  3. 3

    Review the output

    The converted result appears instantly as you type or paste.

  4. 4

    Copy the result

    Click copy to grab the output for use elsewhere.

Common use cases

Embedding small images in CSS

Convert a small icon to Base64 to inline it directly in a stylesheet, avoiding an extra HTTP request.

Debugging API payloads

Decode a Base64-encoded field in a JSON response to inspect its actual content.

Email attachment encoding

Understand how binary attachments get represented as text within email protocols.

Passing data through URLs

Encode data safely so it survives being passed as a URL parameter without special characters breaking it.

Understanding data URIs

Decode a data URI's Base64 portion to inspect the actual image or file it represents when debugging embedded HTML/CSS content.

Tips for best results

  • Never use Base64 alone to protect sensitive data — it's reversible by anyone, with no password required.
  • Expect encoded output to be about 33% longer than the original input; this is a normal property of the encoding, not an error.
  • If decoding fails, double-check you copied the full Base64 string without accidental line breaks or missing characters.
  • For binary files like images, dedicated file-to-Base64 tools handle the conversion more directly than plain text encoding.
  • JSON Web Tokens (JWTs) use a URL-safe variant of Base64 — if decoding a JWT segment fails here, that's usually why; look for a JWT-specific decoder instead.
  • For embedding images directly in HTML/CSS as data URIs, remember the Base64 string needs a proper MIME type prefix like 'data:image/png;base64,' to work correctly.

Frequently asked questions

Is Base64 the same as encryption?

No — Base64 is an encoding scheme, not encryption. It has no secret key, and anyone can decode it instantly.

Why is the encoded text longer than the original?

Base64 encoding increases size by roughly 33%, since every 3 bytes of original data becomes 4 characters of encoded output.

Can I encode special characters and emoji?

Yes, this tool handles Unicode text correctly during both encoding and decoding.

Is anything I type sent to a server?

No, encoding and decoding both happen locally in your browser using built-in JavaScript functions.

Why exactly 64 characters?

64 is the largest character set that's both printable and safe across virtually every text-based system, a legacy of older email protocols built to handle only plain text.

Can I decode a JWT (JSON Web Token) here?

JWTs use a URL-safe variant of standard Base64, so a standard decoder may show errors on some tokens; a JWT-specific decoder handles that variant correctly.

Is Base64 encoding the same thing as hashing?

No — Base64 is deterministic and fully reversible, while hashing functions are specifically designed to be one-way and are used for entirely different security purposes.