Skip to content
techfen
☰

Base64 Encode & Decode

Encode text or files to Base64 and decode Base64 back to readable text, with Unicode and URL-safe support.

Share:WhatsAppTelegram

How to use the Base64

  1. Choose Encode or Decode.
  2. Type or paste your text or Base64 string.
  3. Turn on URL-safe output if the result goes into a URL or token.
  4. Copy the result, or open the file section to encode an image or PDF.

What Base64 is

Base64 represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /). It lets you put images, files or arbitrary bytes into places that only accept text, such as JSON, HTML, CSS, email and HTTP headers. Encoding makes data about 33% larger, and it is not encryption: anyone can decode it.

Unicode text

The browser's built-in btoa() fails on characters outside Latin-1, such as emoji, Hindi or accented letters. This tool first converts text to UTF-8 bytes, so any language encodes and decodes correctly, and the result matches what servers and command-line tools produce.

URL-safe Base64

Standard Base64 uses + and /, which have special meanings in URLs, and = padding. The URL-safe variant (used by JWTs and many APIs) replaces them with - and _ and drops the padding. The decoder accepts both forms automatically.

Files and data URLs

Open the file section to turn an image, font or PDF into a data URL such as data:image/png;base64,…, which you can embed directly in HTML or CSS. Keep embedded files small, because Base64 makes pages heavier and prevents separate caching. For a quick checksum of the same file, use the hash generator, and to tidy JSON that contains Base64 fields, use the JSON formatter.

Where you will meet Base64

Base64 appears in many everyday developer tasks. Email attachments are Base64-encoded inside the message. JSON Web Tokens (JWTs) are three URL-safe Base64 segments separated by dots; decoding the middle segment shows the token's claims, although you should never trust a token without verifying its signature. HTTP Basic authentication sends the username and password as Base64, which is why it must only be used over HTTPS. Many APIs also return images or PDFs as Base64 strings inside JSON responses, which you can paste here to inspect.

Frequently asked questions

Is Base64 encryption?
No. It is an encoding that anyone can reverse. Never use it to protect passwords or secrets.
Why does my text decode as gibberish?
The data may be binary (like an image) rather than text, or it may not be Base64 at all.
What is URL-safe Base64?
A variant that uses - and _ instead of + and / and drops = padding, so it can go into URLs and JWTs.
Does it support emoji and non-English text?
Yes. Text is encoded as UTF-8, so every language and emoji works.

Last updated: