Skip to main content
FileForge

Base64 Encoder / Decoder

Convert text to Base64 and back. Unlike naive implementations, this handles UTF-8 correctly, so emoji and non-Latin text round-trip safely.

Runs in your browser — files never leave your device

Free · No sign-upOutputs Base64, Plain text
Loading tool…

How to use Base64 Text

  1. Paste text (to encode) or a Base64 string (to decode).

  2. Click Encode or Decode.

  3. Copy the output.

  4. For images, use the dedicated Image to Base64 tool instead.

About this tool

Base64 turns arbitrary bytes into a safe alphabet of letters, digits, + and /, which is why it appears in HTTP headers, JWTs, email attachments and data URIs. JavaScript's raw btoa() breaks on any character outside Latin-1; this tool encodes the text as UTF-8 bytes first, so "héllo 👋" encodes and decodes without corruption. Note that Base64 is an encoding, not encryption — anyone can decode it.

This comes up often when inspecting the payload of a JWT token, decoding a Base64-encoded HTTP header or environment variable, or preparing a short string for a system that expects Base64 as its transport format.

Common ways people use this

  • Decoding a Base64-encoded HTTP header or environment variable to see its actual contents
  • Inspecting the header or payload segment of a JWT token, which is Base64-encoded
  • Encoding a short piece of text for a system that requires a Base64 format

Tips for better results

  • Remember that Base64 is not encryption — anyone can decode it back to plain text, so never rely on it alone to protect sensitive data.
  • If you're specifically working with images, use the dedicated Image to Base64 or Base64 to Image tools instead, which handle binary image data and MIME types directly.

Frequently asked questions

Is Base64 encryption?
No. It's a reversible encoding with no key — anyone can decode it. Never use Base64 alone to protect secrets.
Why did emoji break when I used btoa() in my code?
btoa() only accepts Latin-1 characters. Encode the string as UTF-8 bytes first (as this tool does) — in modern JS, via TextEncoder.
What are the = signs at the end of Base64?
Padding. Base64 works in 3-byte groups; = fills out the final group when the input length isn't a multiple of three. Decoders handle it automatically.
Can I decode a JWT token with this tool?
You can decode the individual header and payload segments (the parts separated by dots) as Base64 text. Note that the signature segment isn't meant to be human-readable, and this doesn't verify the token's validity.
What happens if I try to decode text that isn't valid Base64?
You'll get a clear error explaining that the input isn't valid Base64, rather than a garbled or silent result.