Base64 Encode & Decode

Encode text or files to Base64 and decode Base64 back to readable text. Conversion runs instantly in your browser.

What this tool does

Encode UTF-8 text or a selected file as Base64, or decode Base64 text into readable UTF-8. Base64 is a reversible representation and provides no secrecy.

Practical use cases

  • Inspect an encoded UTF-8 value
  • Prepare a file's Base64 payload
  • Verify a small encoding example

Example

Input: Text Hello in encode mode

Expected output: SGVsbG8=

Limits to know

  • Base64 expands binary data by roughly one third
  • The text decoder expects UTF-8 and is not a general binary-file viewer
  • A full data URL includes a prefix that is separate from the Base64 payload

Common problems

Decoding reports an error

Check the alphabet, padding and whether a data URL prefix or unrelated characters were pasted.

Decoded bytes are not readable text

The payload may be binary rather than UTF-8 text; use a binary-aware decoder for that file type.

Frequently asked questions

Is Base64 encryption?

No. Base64 only re-encodes bytes as text, and anyone can decode it, so it does not protect passwords or other secrets.

Why does decoding show “Invalid Base64 or UTF-8 input”?

Decode expects standard Base64 that represents UTF-8 text. URL-safe Base64 with - and _, a data: URL prefix, stray characters or binary content such as an image all fail; remove any prefix and convert - and _ to + and / first.

How are non-English characters handled?

Text is converted to UTF-8 bytes before encoding and read back as UTF-8 when decoding, so accents, emoji and non-Latin scripts round-trip correctly.

Can I encode an image or PDF file?

Yes, files up to 100 MiB are read on your device and output as plain Base64 without the data: prefix. Large files make a very long output that can slow the page; the decoder handles text only and cannot turn Base64 back into a file.

Why is the encoded output longer than the input?

Base64 uses 4 characters for every 3 bytes, so the output is about one third larger, plus = padding at the end when needed.

Tool-specific privacy note

Encoding and decoding are performed locally. Anyone with the encoded value can decode it.

How to use this tool

  1. Choose encode or decode mode.
  2. Paste text, or select a file in encode mode.
  3. Copy the output and check that the receiving system expects plain Base64 rather than a data URL.

Try a sample file

Sample text containing abc

There is no trailing newline. SHA-256: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad; Base64: YWJj.

Related tools

URL Encoder

JWT Decoder

Hash Generator

UUID Generator