Tools / Text & Data / Base64 Encode / Decode
Client-side

Base64 Encode / Decode

Encode plain text to Base64 or decode any Base64 string back to readable content, all locally in the browser with no upload.

What it does

  • Encode text to Base64, UTF-8 safe
  • Decode Base64 back to plain text
  • Standard (+/ with =) or URL-safe (-_ without padding) alphabet
  • Decoding accepts input with or without = padding
  • Runs entirely in WebAssembly, nothing leaves the tab

This tool converts text to Base64 and Base64 back to text, in both the standard and the URL-safe variants. Type in the Plain text box and click Encode ↓, or paste a Base64 string in the Base64 box and click Decode ↑. The work is done by the Rust base64 crate compiled to WebAssembly, in your browser. Remember that Base64 is not encryption: anyone can decode it in a second, so pasting an auth payload into a third-party site hands over the plaintext. Here, nothing is uploaded.

For a page locked to one direction, use the text to Base64 encoder or the Base64 to text decoder.

How to encode or decode Base64

  1. Choose the variant: Standard (selected by default) or URL-safe.
  2. To encode, type or paste your text in the top box and click Encode ↓. The Base64 appears in the bottom box.
  3. To decode, paste the Base64 string in the bottom box and click Decode ↑. The text appears in the top box.
  4. Copy either side with its copy button. The status line shows the length of the result.

Standard or URL-safe: which one to choose

  • Standard (RFC 4648 section 4): alphabet A-Z a-z 0-9 + /, output padded with = to a multiple of four characters. Used in email attachments (MIME), HTTP Basic authentication headers, data URIs, PEM certificates and most APIs.
  • URL-safe (RFC 4648 section 5): replaces + with - and / with _, and the encoder here omits the = padding. Used in JWT tokens, URL parameters, file names and anywhere + and / would be misread.

Decoding must use the variant the string was produced with. A string containing - or _ is URL-safe and fails in Standard mode; one containing + or / is standard. In both modes, trailing = padding is optional, and leading or trailing spaces are ignored.

How Base64 works, in short

Base64 takes the bytes of your text three at a time (24 bits) and writes them as four characters from a 64-character alphabet (6 bits each). The output is always about 33 percent longer than the input. Text is first converted to UTF-8 bytes, so accented letters and emoji are encoded correctly: é€ gives w6nigqw=. When decoding, the bytes are read back as UTF-8.

Limits and edge cases

  • Text only. If the decoded bytes are not valid UTF-8 text (an image, a PDF, a ZIP), the tool reports "Decoded bytes are not valid UTF-8" instead of showing garbage. For images, use the image to Base64 converter, which handles data URIs in both directions.
  • No line breaks inside the string. Base64 wrapped every 76 characters, as in emails or PEM files, must be joined into one line before decoding; a line break inside the string triggers an "Invalid symbol" error with its offset.
  • No data URI prefix. Remove data:text/plain;base64, before decoding.
  • JWT: each part of a token is URL-safe Base64. Decode the header or payload with the URL-safe variant, or use the JWT decoder to read all parts at once.

Typical uses

  • Building an HTTP Basic authentication header: encode user:password and send Authorization: Basic followed by the result.
  • Reading a Kubernetes Secret, whose values are stored in Base64.
  • Inspecting the payload of a webhook, a cookie or an API field that turns out to be Base64.
  • Embedding a short text or JSON configuration in an environment variable or a URL parameter.

Compared with the command line

On macOS and Linux, echo -n 'text' | base64 encodes and base64 -d (or -D on older macOS) decodes; on Windows, PowerShell uses [Convert]::ToBase64String. Watch the -n: without it, echo adds a line break that becomes part of the encoded value, a frequent source of "wrong password" errors. In this tool, what you see in the box is exactly what gets encoded.

Privacy: Base64 hides nothing

Because Base64 is trivially reversible, the strings people decode are often sensitive: Basic auth credentials, Kubernetes secrets, API tokens, session cookies. Pasting them into an online decoder that processes input on a server exposes the clear value. Here encoding and decoding run in WebAssembly in your tab, with no network request for your data.

Frequently asked questions

Is Base64 a form of encryption?
No. It is an encoding that makes binary data safe to transport as text. Anyone can decode it without a key. Never rely on it to protect a password or a token.
Is my text sent to a server?
No. Everything runs in your browser through WebAssembly. Nothing is transmitted or stored.
Why does decoding fail with "Invalid symbol"?
The string contains a character outside the selected alphabet: a line break, a space inside the string, or - and _ in Standard mode. Remove line breaks, or switch to URL-safe.
Why does decoding fail with "not valid UTF-8"?
The Base64 encodes binary data, not text. This tool only displays text. Use a tool made for the file type, such as the image converter for pictures.
Do I need the = signs at the end?
Not for decoding here: padding is optional in both modes. Some other decoders require it, so keep it when using Standard output elsewhere.
Does it handle emoji and accented characters?
Yes. Text is encoded as UTF-8, which covers every Unicode character, and decoded the same way.