ToolSink

Base64 Encode / Decode

Convert text to and from Base64 encoding. Fully client-side.

What is the Base64 Encode / Decode?

The Base64 Encode / Decode tool converts arbitrary text or binary data into a compact ASCII string and back again. Base64 is the format used to embed images in emails, credentials in HTTP headers and binary blobs inside JSON payloads — situations where plain bytes cannot survive.

Developers use Base64 dozens of times a day: encoding an OAuth client secret for Basic auth, decoding a JWT payload, embedding a small PNG in CSS, or moving binary data through a text-only transport. This tool handles both directions with a click.

Encoding and decoding run in your browser. Secrets and credentials never travel to a server, which is essential for anyone working with production tokens.

How to use the Base64 Encode / Decode

  1. 1Paste the text you want to encode or the Base64 string you want to decode.
  2. 2Pick a mode: "Encode" (text → Base64) or "Decode" (Base64 → text).
  3. 3Choose the character encoding — UTF-8 for most modern applications.
  4. 4Click the action button and read the result.
  5. 5Copy the output to your clipboard with a single click.

Key features

  • Two-way encoding and decoding
  • UTF-8 support for non-Latin characters
  • Optional URL-safe Base64 (- and _ instead of + and /)
  • Handles multi-line input
  • One-click copy and swap
  • Fully offline execution

Examples

HTTP Basic auth

Input
user:supersecret
Output
dXNlcjpzdXBlcnNlY3JldA==

Decode a JWT payload

Copy the middle part of a JWT and decode it to reveal the JSON claims (header, payload).

Inline image in CSS

Encode a small PNG into a data URI so you can drop it into a stylesheet.

Why use this tool

  • Instantly turns credentials into HTTP-friendly strings
  • Great for debugging tokens without a full library
  • Works offline — safe for production secrets
  • Handles Unicode correctly
  • Free and unlimited

Common use cases

  • Preparing Basic authentication headers
  • Decoding JWT payloads while debugging
  • Embedding images in emails and CSS
  • Sending binary data inside JSON payloads
  • Encoding small blobs for URL parameters
  • Teaching students how encoding schemes work

Frequently asked questions

Is Base64 encryption?

No. It is an encoding scheme, not encryption. Anyone can decode it — never rely on it to hide secrets.

Why is my decoded text garbled?

The input probably was not text or used a different character encoding. Try switching between UTF-8 and Latin-1.

Does the tool support URL-safe Base64?

Yes — enable the toggle to swap + and / for - and _.

Is my data uploaded?

No — everything is encoded and decoded locally.

Can I encode binary files?

Use our Image to Base64 tool for images. Support for arbitrary file uploads is on the roadmap.