Base64 Encode / Decode
Encode text or binary data to Base64 and decode Base64 strings back to plain text, instantly in your browser.
Base64 encoding is the go-to solution whenever you need to transmit binary data through a channel designed for text. Whether you are embedding images directly in CSS, passing authentication credentials in an HTTP header, or storing binary blobs in JSON payloads, Base64 gives you a reliable, universally understood encoding that survives every text-safe transport layer intact.
Developers reach for Base64 constantly β in JWTs, data URIs, MIME email attachments, and environment variables that carry certificates or keys. This tool lets you encode any UTF-8 string or paste a Base64 string and decode it instantly, so you can inspect tokens, debug API payloads, and verify encoded assets without leaving the browser.
How to Base64 Encode and Decode Online
- 1
Paste Your Input
Paste plain text or a Base64 string into the input panel. Choose encode or decode.
- 2
Get the Result Instantly
The encoded or decoded output appears immediately. The tool validates input and reports the exact position of any invalid Base64 character.
- 3
Copy the Output
Copy the result to your clipboard. Supports standard Base64 (RFC 4648) and URL-safe Base64 variants.
How Base64 Encoding Works
Base64 works by splitting the input byte stream into 6-bit groups rather than the usual 8-bit bytes. Each 6-bit value maps to one of 64 printable ASCII characters β the uppercase and lowercase Latin alphabet, the digits 0β9, and the two symbols `+` and `/`. Because 6 bits fit into one character and 8 bits make one byte, every 3 bytes of input produce exactly 4 Base64 characters, expanding the data by roughly 33%.
When the input length is not a multiple of three, padding characters (`=`) are appended to keep the output length a multiple of four. URL-safe Base64 replaces `+` with `-` and `/` with `_` to avoid conflicts in query strings and filenames β important to know when decoding tokens from OAuth or JWT sources.
Why Use FileCrank Base64 Encoder / Decoder?
- β Supports standard Base64 (RFC 4648) and URL-safe Base64.
- β Validates input and highlights invalid characters with position.
- β Handles text and binary data representations.
- β Runs entirely in your browser β no data sent to any server.
Features & Specs
Frequently Asked Questions
What is Base64 encoding used for?
Base64 is used to embed binary data β images, fonts, files β inside text formats like JSON, HTML, XML, and email. It encodes every 3 bytes as 4 ASCII characters, increasing size by about 33%.
What is the difference between standard Base64 and URL-safe Base64?
Standard Base64 uses + and / characters which have special meaning in URLs. URL-safe Base64 replaces them with - and _, making the output safe for use in query strings and filenames without percent-encoding.
Why does my decoded Base64 output look garbled?
The input was likely binary data (an image or file), not a UTF-8 text string. Base64-encoded binary decodes back to binary bytes. If you are expecting readable text, the original encoder may have encoded a non-text file.
Is there a size limit for Base64 encoding here?
The tool handles inputs up to the displayed limit. For larger files, Base64 encoding in the browser is practical up to several megabytes before memory constraints become relevant.
Base64 vs. Hex Encoding vs. Compression
Hex encoding is simpler β each byte becomes two hex digits β but it doubles the data size instead of adding only 33%. Base85 and Base91 are more compact than Base64 but far less universally supported. If size is the concern and both ends control the codec, consider zlib or gzip compression before encoding. Base64 wins on compatibility: every standard library in every language ships a Base64 codec, making it the safest default for interoperability.
Related Tools
URL Encode / Decode
Percent-encode URLs for safe use in query strings, or decode encoded URLs back to plain text.
HTML Entities Encode / Decode
Encode special characters to HTML entities and decode HTML entities back to plain text.
bin2hex
Convert binary data to hex strings and hex back to binary at the byte level β like PHP's bin2hex() and hex2bin().
FileCrank Base64 Encode / Decode converts text and binary data to and from Base64 format, supporting RFC 4648 and URL-safe variants, entirely in your browser.
Advertisement