Skip to content
JSON Toolkit

Base64 Encoder/Decoder

Convert

Encode text to Base64 or decode Base64 back to text — instantly, in your browser.

What is Base64 encoding?

Base64 is a way of representing binary or Unicode data using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It doesn't compress or encrypt anything — it just re-encodes bytes into a form that's guaranteed to survive text-only systems like HTTP headers, JSON fields, email, and URLs without corruption.

You'll run into Base64 constantly as a developer: HTTP Basic Auth sends username:password Base64-encoded in an Authorization header, data URIs embed images directly in HTML or CSS as Base64, and JWTs use a URL-safe variant for every segment of the token.

Standard Base64 vs. Base64URL

Standard Base64 uses + and / in its alphabet and pads the output to a multiple of 4 characters with trailing = signs. Both characters have special meaning in a URL, so pasting standard Base64 into a query string or path segment requires escaping.

Base64URL swaps + for - and / for _, and drops the padding entirely, producing a string that's safe to use directly in a URL, filename, or cookie. This tool's URL-safe toggle switches the output between the two, and decoding accepts either alphabet automatically so you never have to guess which one you're pasting.

Encoding and decoding text safely

Because encoding converts UTF-8 bytes rather than raw characters, this tool round-trips Unicode correctly — emoji, accented letters, and non-Latin scripts all decode back to exactly what you started with. Decoding validates the input's length and alphabet first, so a corrupted or truncated Base64 string is reported with a clear reason instead of producing garbled output.

JSON to Base64 — encode a JSON payload as Base64

To encode JSON to Base64, paste your JSON into the encoder — the tool converts the UTF-8 bytes of the JSON string into a Base64-encoded string. This is useful when you need to embed a JSON payload in a context that does not allow raw JSON: an HTTP header value, a URL query parameter, a cookie, or a string field inside another JSON document.

The output is standard Base64, or Base64URL (URL-safe, no padding) if you enable the toggle. To reverse it, switch to decode mode and paste the Base64 string — the decoder produces the original JSON text back. Everything runs in your browser, so JSON containing sensitive data stays private.

Base64 to JSON and JSON decoder

A JSON decoder reads an encoded representation of JSON and gives you back the original readable JSON text. The most common case: paste a Base64 string, switch to decode mode, and the tool decodes it back to JSON in one step.

JWT payloads, API tokens, and embedded config values are frequently Base64-encoded JSON. Decoding Base64 to JSON here lets you read the underlying data — the claims in a JWT header or payload, for example — without writing code. Both standard Base64 and the URL-safe Base64URL variant are accepted automatically so you never have to guess which encoding you are looking at.

Capabilities

Everything in the Base64 Encoder/Decoder

Free online Base64 encoder and decoder. Encode text to Base64 or decode Base64 back to text, with a URL-safe mode and full Unicode support. 100% client-side.

Encode & decode

Switch between text → Base64 and Base64 → text instantly.

URL-safe mode

Use the - and _ alphabet with no padding, for URLs and JWTs.

Unicode-safe

Emoji, accents, and multi-byte text round-trip correctly.

Clear errors

Invalid Base64 or corrupted padding is flagged with a plain-English reason.

Frequently asked questions

Base64 turns arbitrary bytes into plain ASCII text using 64 printable characters, so binary or Unicode data can travel safely through text-only channels — HTTP Basic Auth headers, data URIs, JWT segments, email attachments, and JSON fields that must stay plain text.

Standard Base64 uses + and / and pads the output with = characters. Base64URL replaces those with - and _ and drops the padding, so the result is safe to use directly inside a URL or filename without escaping. Toggle 'URL-safe' to switch between them; decoding accepts either alphabet automatically.

Yes. Text is encoded as UTF-8 bytes before Base64, so emoji, accented letters, and CJK characters all round-trip correctly — unlike the browser's raw btoa/atob, which only supports Latin-1 and throws on anything else.

Decoding fails if the input has invalid length, contains characters outside the Base64 alphabet, or decodes to bytes that aren't valid UTF-8 text — the last case usually means the Base64 encodes binary data (an image or file) rather than text.

No. Every operation runs entirely in your browser using client-side JavaScript. Your input is never uploaded, logged, or stored on any server — it never leaves your device.

Yes, completely free with no sign-up required. There are no usage limits, no watermarks, and no premium gate on any feature.

Keep going

Related tools