Base64 Codec

Loading...

Base64 Encoder & Decoder — Text and Files, URL-Safe Support

Encode text to Base64 or decode Base64 back to readable text — and also encode files (images, documents, anything) to a Base64 string. URL-safe mode swaps the +/ characters for -_ so encoded values can travel safely inside URLs, cookies, and JWT-style tokens.

All encoding and decoding runs locally in your browser. Passwords, API keys, tokens, and file contents never leave your device — important, because Base64 is often used around credentials and is trivially decoded by anyone who intercepts it. PureKit also handles Unicode correctly, so emoji and CJK text round-trip without the mojibake that naive encoders produce.

How to encode or decode Base64

  1. Pick text mode for strings or file mode to encode a file.
  2. Paste your text (or drop a file) into the input area.
  3. Toggle URL-safe mode if the output will be used in a URL or cookie.
  4. Click encode or decode — the result appears instantly.
  5. Copy the output with one click.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption — anyone can decode it instantly. It exists to represent binary data using only printable characters, for transport through text-only channels like JSON, XML, URLs, and email. Never use it to protect secrets.

Why does Base64 output end with = signs?

Padding. Base64 encodes every 3 bytes into 4 characters; when the input isn't a multiple of 3, = characters pad the final group. They carry no data themselves and are stripped in URL-safe contexts.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 replaces them with - and _ so the encoded string can be embedded in query parameters and path segments without additional escaping. JWTs use this variant.

Can I encode files like images to Base64?

Yes — switch to file mode and drop any file. A common use is creating data URIs (data:image/png;base64,...) to inline small images in CSS, HTML, or JSON APIs.

Does it handle Chinese characters and emoji?

Yes. The tool encodes text as UTF-8 first, which is the correct standard-compliant behavior — round-tripping multi-byte characters works without corruption.

Related tools

PureKit · base64 · Free online tool — files processed locally in your browser, no upload.