Skip to content

Base64 Encoder / Decoder · Encoding

Encode and decode Base64, the right way.

Turn any text into Base64 or read it back — with the base64url variant and padding controls, full UTF-8 support, and everything running client-side in your browser. Free, no signup, and your data never leaves your device.

Runs in your browser Standard & URL-safe No signup Updated Jul 28, 2026

Base64 encoder and decoder playground

UTF-8 safe both ways. Decoding accepts standard +/ or url-safe -_ alphabets, with or without = padding; whitespace is ignored.

Base64

No share links on this tool — inputs may be secrets.

Type or paste on the left, then flip Encode / Decode — the result appears here, ready to copy.

Verify an AI's answer

Paste what ChatGPT or Claude told you — this recomputes it exactly, locally. Why AI needs checking →

Enter text or Base64 above, then paste in what an AI told you to check it.

The Gap

The wrong alphabet, a quietly broken token.

Base64 looks trivial until a value travels somewhere text rules. Use the standard alphabet inside a URL and the + and / get percent-mangled; forget that JWTs are base64url with no padding and your decoder chokes on the very token you need to read.

This free Base64 encoder and decoder shows both alphabets side by side, lets you toggle padding, and reads your text as UTF-8 so Unicode round-trips cleanly — so you can confirm exactly what a value decodes to before it lands in a request, a config or a header. Entirely in the browser, with nothing to install and no data ever leaving your device.

Don’t ask an AI to do this either: a language model “decoding” Base64 is predicting bytes, not decoding them, and long payloads come back subtly corrupted. This tool runs the actual algorithm, byte for byte, so the decoded text is the data — not a guess at it.

Decoding a JWT? The JWT Decoder splits and base64url-decodes the three parts for you.

The Pipeline

How it works.

Four deterministic steps run on every keystroke — all inside your browser tab, with UTF-8 read before the bytes are mapped.

  1. Read the text as bytes.

    Your input is encoded to UTF-8 first, so emoji and accents become the exact bytes Base64 will carry.

  2. Map to the alphabet.

    Bytes are grouped 24 bits at a time and split into four 6-bit values, each mapped to a Base64 character.

  3. Choose the variant.

    Standard uses + and / with = padding; URL-safe swaps to - and _ and can drop the padding entirely.

  4. Decode back to text.

    Reverse the steps — Base64 to bytes, then bytes back to UTF-8 — to recover the original string exactly.

Alphabet Reference

Standard vs URL-safe.

Both variants share 62 characters and differ only on the last two and on padding. That one difference is what keeps a value intact inside a URL or filename.

The two alphabets

Index 62 and 63 change, and URL-safe usually omits the = padding.

base64-alphabets
index  std  url      index  std  url
0–25   A–Z  A–Z      62     +    -
26–51  a–z  a–z      63     /    _
52–61  0–9  0–9      pad    =    (omitted)

Where it matters

The same bytes encode identically until a +, / or = appears — then the variants diverge.

standard-vs-url-safe
text     ">>>"   (UTF-8 bytes)

standard Pj4+            ·  uses + / and = padding
url-safe Pj4-            ·  + -> - , / -> _ , no =

text     ">>>?"

standard Pj4+Pw==        ·  '+' and trailing '=='
url-safe Pj4-Pw          ·  '-' , padding dropped

Next Step

That token is base64url — decode the whole JWT.

A JWT is three base64url segments joined by dots. The JWT Decoder splits them, decodes the header and payload, and shows the claims — or, if you just need a digest, the Hash Generator computes SHA-256 and friends, all in your browser.

jwt.txt
eyJhbGciOiJIUzI1NiJ9   ←  header  (base64url)
.eyJzdWIiOiIxMjM0In0   ←  payload (base64url)
.dBjftJeZ4CVP-mB92K   ←  signature

FAQ

Questions, answered.

Tap a question to expand the answer.

Base64 is a binary-to-text encoding that represents arbitrary bytes using just 64 printable ASCII characters (A–Z, a–z, 0–9 and two symbols). It takes three bytes (24 bits) at a time and splits them into four 6-bit groups, each mapped to one character. The result is roughly a third larger than the input but safe to drop into JSON, URLs, email or HTML where raw bytes would be mangled.

They share the first 62 characters (A–Z, a–z, 0–9). Standard Base64 uses + and / for the last two and pads the output with = to a multiple of four. URL-safe Base64 (base64url, RFC 4648 §5) swaps those to - and _ so the value survives inside a URL or filename without percent-encoding, and the = padding is usually dropped. Toggle the variant here and the output updates live.

No. Base64 is an encoding, not encryption — there is no key and anyone can decode it instantly. It only changes how bytes are represented so they travel safely through text-only channels. Never use Base64 to hide secrets; reach for real encryption or hashing if you need confidentiality or integrity.

No. Encoding and decoding run 100% client-side in your tab — there is no server, no account and no logging. You can safely paste tokens, config snippets or private data; it never travels over the network.

Text is first read as UTF-8 bytes before encoding, so emoji, accents and any Unicode character round-trip correctly — unlike the raw btoa() function, which only handles Latin-1. Decoding reverses the steps: Base64 back to bytes, then those bytes back to text as UTF-8.

Base64 converts binary data into ASCII text so it can travel safely over text-only channels. Common uses include email attachments (MIME), embedding images in HTML or CSS as data URIs, encoding the three segments of a JWT, SSL certificates in PEM format, and SAML assertions. Anywhere a protocol or format only allows printable ASCII, Base64 is how binary gets through.

Base64 maps every 3 bytes of input to 4 ASCII characters, so the encoded output is about 33% larger than the source. If the input length is not a multiple of three, one or two = padding characters are appended to align the output to a 4-character boundary. For example, 3 bytes encode to 4 characters; 4 bytes encode to 8 characters including one = pad.

Decode the Base64 to recover the raw bytes, then save them with the correct file extension. For images embedded in HTML data URIs, strip the data:image/...;base64, prefix first, then paste the remaining string into the decoder to get the binary content. This tool decodes any valid Base64 or base64url string to text — for downloading binary files directly, you would need a dedicated file-handling tool.

More free, private DevOps tools.

The Base64 Encoder / Decoder is one tool in OpsCanopy — a growing canopy of browser-based validators, converters and testers that never touch a server.

New to Linux?  Read the Linux guide →

29 free tools, every one offline-capable — opscanopy.com works with no signup and nothing uploaded.

Related encoding tools: the JWT Decoder, the Hash Generator and the Timestamp Converter, or browse the full tools directory.

Provided as-is for convenience; Base64 is an encoding, not encryption — never use it to protect secrets. OpsCanopy is free and open.