Base64 Encoder / Decoder

Encode or decode Base64 for text and files with UTF-8 support and URL-safe mode. Drop a file to convert it locally without uploading.

Mode: Encode All text is processed as UTF-8.
Ready to encode
Drop a file here to encode

What is Base64 encoding?

What this tool does

Base64 encoding turns binary data or text into a safe ASCII string using 64 printable characters. This tool encodes plain text and files to Base64, decodes Base64 back to readable text, and supports URL-safe variants used in JWTs and query parameters. Drop a file onto the zone or paste directly—the result appears in the output panel with copy and download options. A mode badge and swap button make it easy to flip between encode and decode workflows without reloading the page.

Why you need it

Many systems only accept text in JSON, XML, email, or URL contexts, yet files and binary payloads are byte streams. Base64 bridges that gap by representing bytes as text that survives transport without corruption. Developers decode Base64 snippets from logs, JWT segments, and legacy configs daily. URL-safe mode avoids characters that break query strings. Email attachments, data URIs, and API fields labeled content or payload often arrive Base64-encoded. Because files are read with FileReader locally, sensitive documents never upload to a server. Keeping encode and decode in one tab saves context switching when you are iterating on an API integration.

How to use it

  1. Choose Encode or Decode mode and toggle URL-safe Base64 if your target format requires it.
  2. Paste text into the input panel, or drop a file onto the drop zone to encode its bytes.
  3. Review the output panel. Invalid padding or characters show a clear error in the status bar.
  4. Copy the result for data URLs, API payloads, or embedded assets, or download as a text file.
  5. Click Clear when finished — encoded output exists only in your current browser session.

Practical examples

  • Encode a small certificate or key snippet for a JSON API request body.
  • Decode a Base64 segment from a JWT header or payload before inspecting claims.
  • Convert UTF-8 text with emoji or non-Latin characters for safe JSON transport.
  • Generate raw Base64 from a binary file, then build a data URL with the Image to Base64 tool.
  • Decode a Base64 attachment from an email header before inspecting the raw bytes.

How it works

Base64 groups every three bytes into four 6-bit values, each mapped to a character from A–Z, a–z, 0–9, plus + and /. Padding with = marks incomplete final groups. URL-safe Base64 replaces + and / with - and _ and often omits padding. This tool treats all text input as UTF-8 before encoding, so emoji and accented characters round-trip correctly. Decoding reverses the mapping and validates character sets and padding. File encoding reads bytes through the browser FileReader API entirely on your machine—Kitnax never receives the file contents. The output panel updates live as you type or drop files, and swap toggles direction without losing your last result.

Common mistakes

  • Treating Base64 as encryption—it is reversible encoding; anyone can decode it.
  • Using standard Base64 in URL query strings without URL-safe mode; + and / get mangled.
  • Decoding truncated strings; missing padding or characters produces errors or garbage output.
  • Encoding very large files in the browser tab; memory limits apply—use CLI streaming tools instead.
  • Mixing standard and URL-safe alphabets in the same pipeline without normalizing before decode.

FAQ

What is URL-safe Base64?

It replaces + and / with - and _ and may omit padding — common in JWTs and URL parameters.

Can I encode binary files?

Yes. Drop a file to Base64-encode its bytes in the browser.

Is there a size limit?

Browser memory limits apply. Very large files should use streaming CLI tools instead.

Does encoding encrypt my data?

No. Base64 is encoding, not encryption. Anyone can decode it.

Are files uploaded?

No. FileReader reads locally; output appears in your session only.

Related tools