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 shows up constantly in web development: embedding images directly in CSS or HTML, encoding credentials in an Authorization header, attaching files to emails, or passing binary data through systems that only understand text.
This tool encodes plain text into Base64, and decodes Base64 strings back into their original text, instantly and entirely in your browser.
How it works
- Type or paste your text into the input box.
- Click Encode to convert it to Base64, or Decode if you already have a Base64 string and want the original text back.
- The result appears immediately in the output box, ready to copy.
Common use cases
- Data URIs: Encoding a small image or font as Base64 so it can be embedded directly in a CSS `url()` or an HTML `<img src>` without a separate network request.
- API debugging: Decoding a Base64-encoded field from a JSON API response to see what it actually contains.
- Basic Auth headers: Manually building or reading an `Authorization: Basic <base64>` header (see the dedicated Basic Auth tool for a shortcut).
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not an encryption scheme — it has no secret key and anyone can decode it instantly. Never use Base64 alone to protect sensitive data; it only changes the representation of the data, not its confidentiality.
Why does my Base64 output end with = signs?
The = characters are padding, added when the input length isn't a multiple of 3 bytes, so the encoded string's length is always a multiple of 4. Some systems (like JWTs) strip this padding — that's called Base64URL and is slightly different from standard Base64.
Can I encode files, not just text?
This tool works on the text you paste in. For binary files, most programming languages have a built-in Base64 function (e.g. `btoa`/`atob` in JavaScript, `base64` module in Python) that reads the file bytes directly.
Why did decoding fail with an error?
The input isn't valid Base64 — it likely contains characters outside the Base64 alphabet, or is missing padding. Double-check you copied the full string without extra whitespace or line breaks.
This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.