Tools

Base64 encoder and decoder

Encode and decode Base64, standard or URL-safe, with correct UTF-8 handling.

Runs in your browserEncoding4.4K
Free

Input

0 BFree up to 50.0 KB

Result

The result will appear here.

Your runs

Only runs that cost points are saved.

Sign in to keep a history of your runs.

Base64 turns arbitrary bytes into characters that survive a URL, an HTTP header or a JSON string. This handles the UTF-8 step correctly in both directions, which is where hand-rolled attempts using btoa usually break: btoa throws on any character above U+00FF, so accented text and CJK fail outright.

How it works

  • Text is encoded as UTF-8 bytes first, so every script works.
  • The URL-safe variant uses - and _ and drops padding, per RFC 4648 §5.
  • Decoding to text refuses byte sequences that are not valid UTF-8 rather than showing replacement characters.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

When a run costs points, a one-line summary is saved to your own history so you can find it again. The summary records the shape of the run — sizes, counts, the values you looked up — never the content you pasted.

What it costs

Free up to 50.0 KB per run without an account. Past that, a run costs 1 points and is saved to your history.

Points come from signing up, checking in daily, commenting and completing your profile.

See how points work

Common questions

What is the difference between Base64 and Base64URL?
Base64URL replaces + with - and / with _, and usually drops the = padding, so the result can sit in a URL path or query string without escaping. JWTs use it throughout.
Is Base64 encryption?
No, and treating it as such is a recurring source of incidents. It is a reversible encoding with no key — anyone can decode it. Use it to transport bytes safely, never to hide them.
Why did my decode fail?
Either the string is not valid Base64 — a stray space or a truncated tail — or the bytes it decodes to are not text. Binary data such as an image decodes to bytes that no text encoding can display.

The open-source behind it

This tool is a self-contained implementation. dankogai/js-base64 (BSD-3-Clause) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.

dankogai/js-base64

Also known as

  • base64 encode
  • base64 decode
  • base64 converter
  • base64url
  • decode base64 online