Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to readable text. Text is converted to UTF-8 first, so any language and emoji work correctly, unlike tools that only handle plain English letters. Choose the URL-safe alphabet for tokens and URLs, or 76-character lines for email and PEM-style data.

Runs in your browser · Your data never leaves your device

Loading the tool…

Tip: decoding accepts both standard and URL-safe Base64, with or without padding.

How to use the Base64 Encoder & Decoder

  1. Choose Encode or Decode.
  2. Type or paste your text or Base64. The result updates as you type.
  3. When encoding, pick URL-safe, padding and line wrapping if you need them.
  4. Copy the result or save it as a file.

How encoding and decoding work

UTF-8
Text is encoded as UTF-8 bytes before Base64, which is what web APIs, JWTs and most programming languages expect.
Forgiving decoding
Spaces and line breaks are ignored, missing = padding is added, both the standard (+ /) and URL-safe (- _) alphabets are accepted, and a data: URL prefix is removed.
Binary data
If the decoded bytes are not valid UTF-8 (for example an image), the note shows the first bytes in hexadecimal.

Examples

These outputs were produced by the same code that runs in the tool above.

Encode text in several languages

UTF-8 makes Arabic, Urdu and emoji round-trip correctly.

Input

Hello, مرحبا, السلام علیکم 👋

Output

SGVsbG8sINmF2LHYrdio2KcsINin2YTYs9mE2KfZhSDYudmE24zaqdmFIPCfkYs=

Decode URL-safe Base64 without padding

A token-style value with - and _ and no padding.

Input

eyJ1c2VyIjoiYW1pbmEiLCJyb2xlIjoiZWRpdG9yIn0

Output

{"user":"amina","role":"editor"}
  • Padding was missing and has been added.

Frequently asked questions

Is Base64 encryption?

No. Base64 only changes how data is written; anyone can decode it. Do not use it to protect passwords or secrets.

What is URL-safe Base64?

It replaces + and / with - and _ so the value can be used in URLs and file names without escaping. JWTs use URL-safe Base64 without padding.

Why is the Base64 longer than my text?

Base64 uses 4 characters for every 3 bytes, so it is about a third longer. Non-English characters take 2 to 4 bytes each in UTF-8.

Is my text uploaded?

No. Encoding and decoding run on your device.

Limitations and edge cases

  • This tool encodes text. Encoding files such as images is planned for a later version.
  • Decoded binary data is shown as text with replacement characters; only the first 64 bytes are listed in hexadecimal.

Read the privacy policy for how the site handles data.