Skip to content
SyntaxSnap

Base64 Encode and Decode

Encode text to Base64 or decode it back. Emoji and non-English text work correctly, and a URL-safe option produces base64url for tokens and query strings.

Text

Base64

eyJ1c2VyIjoiYWRtaW4iLCJleHAiOjE3NjcyMjU2MDB9IOKckyBVVEYtOCBzYWZl
64 characters

How to encode or decode Base64

  1. Step 1

    Pick a direction

    Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.

  2. Step 2

    Paste your input

    Type or paste the text, Base64 string or data: URI.

  3. Step 3

    Copy the result

    Copy the output, or use it as the next input to reverse the conversion.

What Base64 is for

Base64 turns any bytes into 64 plain characters so they can travel through systems that expect text: HTTP Basic auth headers, JSON fields, email attachments and data: URIs. It is an encoding, not encryption, so anyone can decode it.

Standard and URL-safe Base64

Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant, base64url, replaces them with - and _ and drops the = padding. JWTs use base64url, so the decoder accepts both.

Why UTF-8 matters

The browser's btoa function fails on characters outside Latin-1, such as emoji or Tamil script. This tool converts text to UTF-8 bytes first, so every character round-trips correctly.

Questions and answers

Is Base64 encryption?

No. Base64 is a reversible encoding that anyone can decode. Never use it to hide passwords or secrets.

Why does decoding fail?

Either the input contains characters outside the Base64 alphabet, or it decodes to binary data such as an image rather than readable text.

Is my data sent to a server?

No. Encoding and decoding run in your browser.

Can I decode a JWT here?

You can decode each part, but the JWT Debugger splits the token and shows the header, payload and expiry for you.

Next step

Need this built into your stack?

The team behind SyntaxSnap builds custom code generators, internal developer tools and API integrations.