Base64 Encoder & Decoder — Fast, Private, Browser-Only
b64chop encodes any text or file to Base64, or decodes Base64 back to plain text or binary.
All processing happens in your browser using the native btoa/atob APIs
and the FileReader interface — nothing is ever uploaded to a server.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A–Z, a–z, 0–9, +, /). It is used wherever binary data must travel through text-only channels: email attachments (MIME encoding), JSON and XML payloads, HTTP Basic Auth headers, JWT token segments, CSS data URIs, and HTML embedded images.
The encoding inflates size by approximately 33% — every 3 bytes of input become 4 Base64
characters. Padding = characters are appended to make the output length a multiple
of 4. The URL-safe variant replaces + with - and /
with _ so the output can appear in URLs and filenames without percent-encoding.
Features
- Encode text → Base64 or decode Base64 → text
- URL-safe Base64 (RFC 4648 §5) — replaces + and / with - and _
- File input — load any file, get its Base64 representation
- File download — decode a Base64 string and save the raw bytes
- Swap panels to flip input and output instantly
- Live status: input size, output size, validity check
- Zero server requests — works offline after first load
Common Use Cases
- Decoding a Base64-encoded JWT segment or claim value
- Encoding an image or file for embedding in a JSON payload
- Generating a Basic Auth header value (username:password → Base64)
- Encoding configuration secrets for environment variables
- Creating a data URI for a small image or font
- Decoding a Base64 attachment from an email source
FAQ
Is my data sent to a server?
What is URL-safe Base64 and when do I need it?
+ and / which have special meaning in URLs.
URL-safe Base64 (RFC 4648 §5) replaces them with - and _,
and typically omits the padding =. Use it for JWT tokens, URL parameters,
file names, and anywhere the output appears inside a URL.
Can I encode binary files, not just text?
How do I decode a Base64 string back to a file?
Why does my Base64 look different from another tool's output?
= characters;
(3) line breaks — some tools insert newlines every 76 characters (MIME convention) which
b64chop does not.