Developer tools · free · no signup

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text. Your work stays on this device whenever possible.

Free to useNo accountClear results
Preparing tool…
Simple, transparent workflow

How to use Base64 Encoder & Decoder

  1. Paste into the input box: the 'Paste analysis' line says whether it looks like Base64, Base64url, a data URI, a JWT, hex or plain text, with a one-click Decode or Encode button.
  2. Use 'Text Mode' for typed strings, 'File Mode' (or the large-file boxes) for files, or 'JWT Mode' for tokens; tick 'URL-Safe (- and _)' and set 'Line Wrap:' if needed.
  3. Press 'Encode to Base64' or 'Decode from Base64'. Decoded bytes are matched against file signatures, so a PNG, PDF, MP3, ZIP and about thirty other types are named, previewed where the browser can, and offered with a suggested file name.
  4. Under 'Large files', encode a file in 3 MB slices with progress and cancel, or decode a Base64 text file to binary; URL-safe and wrap options are honoured and output above 2 MB is downloaded instead of shown.
  5. Pick 'Copy as' for JavaScript, Node.js, Python, shell, PowerShell, curl, CSS or HTML using the current Base64, and use '⇄ Swap' for a round-trip check.

Worked example

Paste iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg== and the analysis line reports a PNG image. Press 'Decode it' to see 'PNG image', the suggested name decoded.png, a 1 x 1 preview and a download button, then pick 'Python' under 'Copy as' to get a base64.b64decode snippet.

When to use this tool

  • Checking what a mystery Base64 blob in a config or email actually is before opening it.
  • Embedding a small icon in a stylesheet with a data URI.
  • Peeking inside a token's claims and expiry date while debugging a login problem.

Important limitations

Base64 expands raw payload size by approximately 33% (4 output characters for every 3 raw bytes). It provides encoding, not encryption or password secrecy.

Frequently asked questions

How are accented letters and emoji handled?

Text is turned into UTF-8 bytes before encoding, so accented letters, non-Latin scripts and emoji all work without errors. For example, the string 'Café ☕' becomes Q2Fmw6kg4piV when you press the encode button.

What does URL-safe change?

It swaps + and / for - and _ and removes the trailing = padding, which suits links and filenames. The decoder accepts either alphabet and quietly adds the padding back before it reads the bytes. A string that mixes both alphabets is reported as invalid.

How does the paste analysis decide?

It checks the alphabet, the padding and whether the decoded bytes start with a known file signature or valid UTF-8 text. Short plain words can be valid Base64 by accident, so it only suggests decoding when the result looks meaningful; treat it as a hint, not proof.

Does JWT reading verify a token?

No. It splits the token, decodes the header and payload, and shows iat, nbf and exp as UTC dates with how long ago or from now, but it never checks the signature. Use the JWT Decoder for signature verification. Base64 is an encoding that anyone can reverse, not encryption.

Can it handle big files?

Encoding and decoding of files run in 3 to 4 MB slices so the tab stays responsive, but the finished result is still held in memory, so multi-gigabyte files can exhaust the tab. Nothing is uploaded either way.

Which image type do the snippets assume?

Snippets use the type found from the file signature when there is one, otherwise application/octet-stream. The older 'Copy HTML <img>', 'Copy CSS url()' and 'Copy as Data URI' buttons still assume PNG or plain text when the value has no data: prefix.