piapia123
en

Base64 Encode & Decode

Encoding & Crypto

Everything runs locally in your browser — nothing is uploaded

Input
Output

Convert between plain text and Base64 in both directions, with correct handling of accented characters, CJK and emoji. Turning on the URL-safe variant swaps + and / for - and _ and drops the trailing =, so the result can go straight into a URL, a filename or a JWT. Decoding tolerates line breaks and missing padding, which makes pasting from elsewhere painless.

Features

  • Both directions: text ⇄ Base64
  • Correct UTF-8 handling for accented text, CJK and emoji
  • URL-safe variant: + → -, / → _, padding removed
  • Decoding tolerates line breaks, spaces and missing padding
  • Results update as you type — no button to press

How to use

  1. Choose the direction: encode or decode
  2. Tick the URL-safe variant if you need it
  3. Paste your content — the result appears instantly
  4. Click Copy to take the result

FAQ

Why does my text encode differently elsewhere?
Base64 encodes bytes, not characters. The same string is 6 bytes in UTF-8 but 4 in GBK, so the output differs. This tool always uses UTF-8, which is the convention across today’s web pages and APIs.
When do I need the URL-safe variant?
The standard Base64 alphabet contains + and /, both of which have special meaning in URLs. Use the variant whenever the output goes into a URL, a filename or a cookie.
What does "not valid UTF-8 text" mean when decoding?
The Base64 decoded fine, but the resulting bytes are not valid text — usually because the original content was binary such as an image or an archive rather than characters.

Related tools