Base64

Encode and decode UTF-8 text with URL-safe and multi-layer Base64.

On your device. Your input is not uploaded or saved.

UTF-8 text, including emoji. Whitespace in encoded input is ignored. URL-safe output omits padding. Each layer applies the operation to the previous result; input and each result are limited to 1,000,000 characters. Base64 is an encoding, not encryption.

How to encode or decode Base64

  1. Choose Encode text to turn text into Base64, or Decode Base64 to turn Base64 back into text.
  2. Choose the Standard or URL-safe variant. Use URL-safe for JWT segments, URL parameters and file names.
  3. Paste your input. The result updates as you type, and an error explains what is wrong with the input.
  4. To undo text that was encoded several times, set Layers to the number of rounds, up to 20, and expand the layer list to see each step.

How Base64 encoding works

Base64 represents bytes with 64 printable characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so encoded text is about a third longer than the original. The = signs at the end are padding that bring the length to a multiple of 4.

Text is converted to UTF-8 bytes first, so Cyrillic, accented letters and emoji round-trip correctly. You get the same result as Buffer.from(text, "utf8").toString("base64") in Node.js, without the error that the browser's btoa() throws for characters outside Latin-1.

Standard vs URL-safe Base64

URL-safe Base64, also called base64url, replaces + with - and / with _ so the result can appear in URLs and file names without percent-encoding. URL-safe output also omits the = padding, as JWTs do.

When decoding, choose the variant that matches the input: Standard rejects - and _, and URL-safe rejects + and /. Padding is optional, and spaces and line breaks are ignored, so you can paste Base64 that is wrapped across several lines.

Text only, and not encryption

The decoder expects valid UTF-8 text. Base64 of an image, a PDF or another binary file shows an error instead of garbled characters. Input and each result are limited to 1,000,000 characters.

Base64 hides nothing, because anyone can decode it. Use it to carry data through systems that only accept text, such as Basic authentication headers or JSON fields, never to protect passwords or tokens.

Where does my data go?

Encoding and decoding run in your browser with built-in functions. The tool does not upload or save your text.

Like the rest of the site, this page uses Google Analytics and Yandex Metrica, including Metrica session replay. Tool events report only that the tool was opened or used.

The tool area is marked so that Metrica masks what you type and the results in its session recordings.

Also useful

No third-party trackers on JZR Tools. We count anonymous visits with country, referring site and device type only.