Base64 encoder / decoder

Encode or decode UTF-8 text. Load a file to convert its bytes to Base64 (encode). Paste Base64 and use download to save decoded bytes.

File → Base64

Need more than a template?

Need something built around this?

I build internal tools, integrations and full-stack products for startups and growing teams.

Full-stack engineering →

How to use the Base64 encoder and decoder

Base64 turns bytes into letters, digits, plus and slash so binary data can travel through places that only carry text, such as JSON, email and URLs. This tool encodes text as UTF-8 and decodes it back. It can also read a file and give you its Base64, or turn Base64 back into a file you can download.

  1. Choose encode or decode.
  2. Type or paste your text. To encode a file, pick it with the file chooser and the output is the file's Base64.
  3. Copy the result. When you decode, Download as file saves the decoded bytes, which is how you get an image or PDF back.

Worked examples

Plain text

Hello, Aslam!  →  SGVsbG8sIEFzbGFtIQ==

The == at the end is padding.

A JSON snippet

{"user":"aslam"}  →  eyJ1c2VyIjoiYXNsYW0ifQ==

Base64 is how the parts of a JWT carry JSON.

Non-English text

Café  →  Q2Fmw6k=

The text is converted to UTF-8 bytes first, so accented letters and emoji survive the round trip.

Mistakes to avoid

  • Treating Base64 as encryption

    It hides nothing. Anyone can decode it in a second. If the data is private it needs real encryption.

  • Forgetting that it grows the data

    Three bytes become four characters, so the encoded version is about a third larger.

  • Using the standard alphabet where URL-safe is needed

    URL-safe Base64 swaps + and / for - and _. This tool uses the standard alphabet, so if you paste a URL-safe string (JWT segments are one), replace - with + and _ with / first.

  • Decoding binary data as text

    If the original was an image or a PDF, showing it as text gives garbage. Download the decoded bytes instead.

Questions people ask

Does the decoder cope with line breaks?
Yes. It ignores spaces and line breaks, so Base64 wrapped across lines, as in email or PEM files, still decodes.
Is there a size limit?
There is no fixed limit, but a very large file may slow your browser down, because everything is processed in memory.
Are my files uploaded?
No. Files are read in your browser and never sent to a server.

Related