Skip to content
DevTrove

Encoding

Base64 Encode / Decode

Convert text to and from Base64, including the URL-safe variant.

Runs in your browser

Mode

How to use

  1. Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
  2. Paste or type your input. The result updates as you type.
  3. For Encode, enable URL-safe output if the value will be used in a URL, filename or JWT.
  4. Use Copy to copy the result to your clipboard.

What is Base64?

Base64 is an encoding that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /). It is commonly used to embed data in JSON, email, data URLs and HTTP headers, where raw bytes are not allowed.

Base64 is an encoding, not encryption. Anyone can decode it, so it must never be used to protect secrets.

Text and UTF-8

This tool encodes text as UTF-8 before converting it to Base64, so emoji and non-Latin scripts round-trip correctly. When decoding, the result must be valid UTF-8 text; decoding arbitrary binary data such as images is not supported yet.

Standard vs URL-safe Base64

URL-safe Base64 (often called base64url, defined in RFC 4648 §5) replaces + with - and / with _, and usually omits the trailing = padding. It is used in JWTs and anywhere a value must appear in a URL or filename. The decoder accepts either alphabet, with or without padding.

FAQ

Is my data uploaded?
No. Encoding and decoding run entirely in your browser using built-in JavaScript APIs. Your input is not sent to a server and is not stored.
Why does decoding fail with “not valid UTF-8”?
The Base64 value decodes to bytes that are not UTF-8 text — for example an image or compressed data. This tool currently only outputs text.