KwikTools

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 strings back to plain text.

How to use the Base64 Encoder/Decoder

  1. Choose encode to turn readable text into Base64, or decode to turn a Base64 string back into text.
  2. Paste your input into the box and press the Encode or Decode button.
  3. Copy the output, or press "Use as input" to feed the result straight back in — handy for checking that a string round-trips cleanly.

About the Base64 Encoder/Decoder

Base64 is a way of representing binary or text data using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It's commonly used to safely embed data — like an image, a file, or an API credential — inside text-based formats such as JSON, URLs, HTML, or email, which can't reliably handle raw binary data.

This tool converts plain text to its Base64-encoded form, and decodes Base64 strings back to readable text, entirely in your browser. Developers use it to debug JWT tokens, inspect API payloads, embed small images as data URIs, or decode configuration values without installing a command-line tool.

Worked example

Example: encoding the text 'Hello, World!' produces the Base64 string 'SGVsbG8sIFdvcmxkIQ==' — and decoding that string back returns the original 'Hello, World!' exactly.

How Base64 works

Base64 takes the input three bytes (24 bits) at a time and splits them into four 6-bit groups, each mapped to one of 64 characters. That's why encoded output is always about a third larger than the input: 'Hello' (5 bytes) becomes 'SGVsbG8=' (8 characters). Text is first converted to UTF-8 bytes, so accented letters and emoji take more than one byte each and grow accordingly.

Base64 vs Base64URL

Standard Base64 uses '+' and '/', which have special meanings in URLs. The URL-safe variant, Base64URL, swaps them for '-' and '_' and usually drops the '=' padding. JWTs and many web APIs use Base64URL. This tool uses the standard alphabet, so if a string contains '-' or '_', replace them with '+' and '/' before decoding — or, for a JWT, use the JWT decoder, which handles the URL-safe form directly.

Troubleshooting decoding errors

  • A 'doesn't look like valid Base64' error usually means a typo, a string that isn't Base64 at all, or Base64URL (see above).
  • Garbled output with odd symbols means the original data wasn't text — an image or a zip file, for example. Base64 can carry any bytes, but only text decodes to something readable.
  • A string copied from an email or log may be wrapped across lines; spaces and line breaks are ignored, so you can paste it as-is.
  • Data URIs start with a prefix like 'data:image/png;base64,'. Remove everything up to and including the comma before decoding.

Frequently asked questions

Is Base64 encoding the same as encryption?
No. Base64 is an encoding scheme, not encryption — it doesn't provide any security or confidentiality. Anyone can decode a Base64 string back to its original value instantly, so never use it to protect sensitive data.
Why does encoded text sometimes end with '=' signs?
The '=' characters are padding, added when the input length isn't a multiple of 3 bytes, so the encoded output aligns to Base64's required 4-character blocks. It's a normal part of the format, not an error.
Can I encode more than plain text, like special characters or emoji?
Yes — this tool handles Unicode text (including emoji and accented characters) by encoding its UTF-8 byte representation before converting to Base64, so decoding returns the original characters correctly.
Where is Base64 commonly used in practice?
Common uses include the payload sections of JWT authentication tokens, embedding small images directly in CSS or HTML via data URIs, encoding email attachments (MIME), and passing binary data through APIs that only accept text.

You might also need