Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text. Runs locally in your browser.
Encoded Base64 will appear here.What is Base64?
Base64 is an encoding scheme that represents binary or textual data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It exists because many systems - email, JSON, XML, URLs - are built to carry text safely but can mangle raw binary bytes. Base64 converts arbitrary bytes into plain text that survives those systems intact.
How to use this tool
- Paste your text (to encode) or Base64 string (to decode) into the input.
- Choose Encode or Decode.
- Copy the result from the output field.
Is Base64 encryption?
No. Base64 is not encryption, and it does not protect data. Anyone with the Base64 string - or this page - can decode it back to the original in seconds. Treat it purely as a text-safe transport format, not a security measure.
Practical examples
- Embedding a small image directly in HTML or CSS as a
data:image/png;base64,...URI, avoiding an extra network request. - Decoding the payload segment of a JWT to inspect its claims during debugging.
- Encoding a username and password pair for an HTTP Basic Authorization header.
- Decoding a Base64-encoded environment variable or config value pulled from a CI/CD pipeline or secrets manager.
Common mistakes
- Treating Base64 as a security or obfuscation mechanism - it protects nothing and should never stand in for real encryption.
- Forgetting that standard Base64 uses + and /, which aren't safe to use as-is in URLs or filenames; that context calls for the URL-safe variant instead.
- Pasting a string with line breaks or missing padding characters, which will fail to decode until the whitespace is removed or the = padding is restored.
Frequently asked questions
- Is Base64 encryption?
- No. Base64 is an encoding format, not encryption - it has no secret key and provides no confidentiality. Anyone can decode a Base64 string back to its original form, so never use it to protect sensitive data like passwords or tokens.
- Does Base64 compress data?
- No, the opposite. Base64 makes data roughly 33% larger, because it re-encodes every 3 bytes of binary input as 4 ASCII characters. It trades size for the ability to safely embed binary data in text-based formats like JSON, XML, or email.
- What Base64 variant does this tool use?
- Standard Base64 (RFC 4648): the alphabet A-Z, a-z, 0-9, +, /, with = used as padding. This is the most common variant, though some contexts (like URLs and filenames) use a variant that swaps + and / for - and _ to avoid characters with special meaning.
- Why does decoding fail with a UTF-8 error?
- Base64 can represent any sequence of bytes, including binary data like images. When this tool decodes a Base64 string, it tries to interpret the resulting bytes as UTF-8 text - if the original data wasn't text (or used a different encoding), that interpretation fails and the tool reports it.
- Why does my encoded string end with = or == ?
- Base64 groups input into 3-byte chunks. When the input length isn't a multiple of 3, padding characters (=) are added to fill out the last 4-character group. One = means the last chunk had 2 bytes; == means it had 1 byte.
Related tools
Encode or decode URL components.
Escape text into a JSON string literal.
Format and validate JSON.
Check JSON syntax.
Generate SHA-256, SHA-384, SHA-512.
Generate secure UUID v4 identifiers.
Convert a small image into a Base64 data URL locally.