UTILYARD
tools / developer

Base64 Encoder / Decoder

Encode and decode Base64 strings instantly — paste any text to encode, or paste Base64 to decode it back to plain text.

PLAIN TEXT
BASE64
output appears here...

About Base64

Base64 is an encoding scheme that converts binary data into ASCII text. It's commonly used to embed binary assets in JSON, encode data in URLs, and transmit data over text-based protocols. This tool handles full Unicode text via UTF-8 encoding.

FAQ

Is Base64 encryption?
No. Base64 is encoding, not encryption. Anyone can decode it. Never use it to protect sensitive data.
Is my data sent to a server?
No. All processing happens locally in your browser.
Does this support Unicode?
Yes. The encoder uses UTF-8 under the hood, so all Unicode characters are handled correctly.
What is the swap button?
Moves the output to the input and switches the mode — useful for quickly round-tripping data.

ABOUT THIS TOOL

Paste any text to encode it into Base64, or paste a Base64 string to decode it back to plain text. Base64 represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /, with = padding), which is why it's the standard way to embed images, fonts, or files inside text-based formats like JSON, HTML, or email. Because it encodes 3 bytes as 4 characters, encoded output is always roughly 33% larger than the original. Commonly used when working with email attachments, authentication tokens, or embedding binary data in JSON and HTML — this tool runs entirely client-side, so sensitive tokens never leave your browser.

HOW TO USE

  1. Choose Encode or Decode mode.
  2. Paste your plain text (to encode) or Base64 string (to decode) into the input box.
  3. Click convert, or let it convert automatically as you type.
  4. Review the output — decoding invalid Base64 shows an error instead of garbled text.
  5. Copy the result to your clipboard.
  6. For files or images, convert them to a Base64 string elsewhere first, then paste here to inspect or re-encode.

COMMON USE CASES

  • A developer embedding a small icon as a data URI in CSS needs to Base64-encode the image file's bytes.
  • Someone inspecting the payload of a Basic Auth header decodes the "Authorization: Basic xxxx" string to see the username and password.
  • An engineer debugging an email system decodes a Base64-encoded attachment or body part from raw MIME.
  • A developer storing binary blobs in a JSON field encodes them first since JSON has no native binary type.
  • A student verifying how much larger encoded output gets compares byte counts before and after encoding.

TIPS & COMMON MISTAKES

  • Base64 is encoding, not encryption — anyone can decode it, so never use it as a way to protect secrets or passwords.
  • Standard Base64 uses + and / characters, which aren't URL-safe; if you're decoding a token from a URL, look for "Base64url" variants that use - and _ instead.
  • Decoding fails or produces garbage if the input has incorrect padding (=) or contains characters outside the Base64 alphabet.
  • Expect encoded text to be about 33% larger than the original, since every 3 bytes of input becomes 4 characters of output.

MORE QUESTIONS

Is Base64 the same as encryption?
No. Base64 only re-represents bytes as text with no key or secret involved, so it provides zero confidentiality — anyone can decode it instantly.
Why is my JWT or URL token not decoding correctly here?
Many tokens use Base64url encoding, which replaces + with -, / with _, and often omits padding — if standard decoding fails, try the URL-safe variant.
Why does encoded text look longer than the original?
Base64 converts every 3 bytes of binary input into 4 ASCII characters, inflating size by roughly 33%, plus padding characters at the end.
Can I Base64-encode an entire image file here?
This tool works on text and Base64 strings; for a raw file you'd typically convert it to Base64 first using a file-to-base64 step, then paste the resulting string here to inspect or manipulate it.

RELATED GUIDES

What is Base64?
How Base64 encoding works, why it exists, and when to use it.
Read →
What is a Data URL?
How data URLs embed files directly in HTML and CSS using Base64, the syntax, when they improve performance, and when to avoid them.
Read →
Base64 Encoder / Decoder — UtilYard