Genesis Forge
Genesis Forge › Free tools › Developer tools

Base64 encode and decode

Encode text to Base64 or decode Base64 back to text, with full Unicode support and a URL-safe option.

Runs in your browser. Nothing you enter is uploaded.

What it does

Base64 writes any data using 64 plain characters, so that it can travel through systems that only handle text, such as email bodies, data URLs and JSON. This tool converts text to Base64 and back, and handles Telugu, Hindi, emoji and other non-English text correctly.

How to use it

  1. Paste text and press Encode, or paste Base64 and press Decode.
  2. Tick URL-safe if the value will go in a URL or file name.
  3. Copy the result.

Worked example

Namaste, నమస్తే encodes to TmFtYXN0ZSwg4LCo4LCu4LC44LGN4LCk4LGH.

How it works

The text is first turned into UTF-8 bytes. Every 3 bytes (24 bits) are split into four 6-bit groups, and each group is written as one of 64 characters: A to Z, a to z, 0 to 9, + and /. If the input is not a multiple of 3 bytes, = signs pad the end. The output is about one third longer than the input.

Questions

Is Base64 encryption?

No. Anyone can decode it. Never use it to hide passwords or secrets.

Why does decoding fail?

The input contains characters outside the Base64 alphabet, has the wrong length, or is not text once decoded (for example an image).

What is URL-safe Base64?

A variant that replaces + with - and / with _ and usually drops the = padding, so the value can sit in a URL without escaping. JWTs use it.

Is my text sent to a server?

No. Everything runs in your browser. Nothing you type is uploaded or stored by us.

Related tools

All free tools →