consolelog.tools

Base64 Encoder / Decoder

Encode & decode Base64 with full Unicode, URL-safe variant, line-wrap, data-URIs, and file → Base64. Live.

About this ToolHow it works, benefits & use cases

Base64 turns arbitrary bytes into a safe, text-only alphabet so they survive places that mangle raw binary — JSON payloads, data URIs, email, and URL query strings. This encoder and decoder handles both directions with full Unicode (UTF-8) support, so emoji and accented characters round-trip correctly rather than corrupting. Toggle the URL-safe variant to swap "+/" for "-_" and drop the "=" padding, wrap output at 76 columns for MIME-style line breaks, or emit a ready-to-paste "data:" URI with the MIME type you choose. You can encode typed text or drop in a file up to 10 MB to get its Base64 directly in the browser. The decoder is deliberately tolerant: it strips whitespace, accepts the URL-safe alphabet, and fixes missing padding before decoding. A live size readout shows byte counts and the encoding overhead, and nothing you paste or upload ever leaves your machine.

How to Use

  1. 1Choose Encode or Decode with the toggle at the top.
  2. 2Type or paste your text in the input box — or, when encoding, drop a file (up to 10 MB) into the upload area to encode it directly.
  3. 3Open Options to enable the URL-safe alphabet, wrap output at 76 columns, or output a data URI (and set its MIME type).
  4. 4Click "Encode to Base64" or "Decode from Base64"; the result and a byte-size readout appear below as you work.
  5. 5Copy or download the output, use "Swap input ↔ output" to reverse the conversion, or share the link to reproduce the exact input.

Key Benefits

  • Full UTF-8 support — emoji and accented text encode and decode without corruption
  • URL-safe alphabet option (-_ , no padding) for tokens and query strings
  • Optional 76-column line wrapping for MIME-style output
  • Generate data: URIs with a custom MIME type for inline embedding
  • Encode any file up to 10 MB without uploading it anywhere
  • Tolerant decoder strips whitespace, accepts URL-safe input, and repairs padding
  • Live byte-count and overhead readout so you can see the size cost

Common Use Cases

  • Embedding small images or fonts inline as data: URIs in CSS or HTML
  • Inspecting or hand-crafting Base64url segments inside JWTs and OAuth tokens
  • Encoding binary payloads to ship safely inside JSON or XML
  • Decoding a Base64 blob pasted from a log, API response, or config file
  • Converting a downloaded file to Base64 for a quick test fixture

Options

0 characters · live

Click to upload or drag and drop

Any file type • Max 10 MB

Enter text or pick a file to encode.

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related guides

Related tools