Base64 Encoder & Decoder Tool
Upload a file or type text to generate Base64.
How Base64 Converts Binary Bytes Into Printable Text
Base64 is a reversible binary-to-text encoding scheme standardized in IETF RFC 4648 Section 4. An encoder reads input 3 bytes (24 bits) at a time, divides those bits into four 6-bit values (0 to 63), and maps each number onto 64 printable ASCII characters: A-Z, a-z, 0-9, plus (+), and forward slash (/). For instance, the 3-byte word foo encodes cleanly to Zm9v, whereas the 2-byte input fo becomes Zm8= using the equals (=) padding character to complete the 4-character block.
Developers use an online Base64 decoder and encoder to carry binary files and UTF-8 strings across text-only channels like JSON payloads, HTTP headers, XML documents, and MIME email bodies without corrupting raw bytes. Expanding every 3 bytes into 4 ASCII characters adds roughly 33% to total data size, and URLs require either percent-escaping or the URL-safe base64url alphabet (hyphens and underscores) so plus and slash symbols do not break query strings. When you specifically need HTML or CSS Data URI snippets for graphics, use our Image to Base64 Converter.
Because Base64 uses a public lookup table with no secret key, anyone can decode a Base64 string back to its original bytes immediately. Standard browser btoa() and atob() calls also fail on multi-byte Unicode characters out of the box, so this Base64 tool normalizes UTF-8 byte sequences automatically before converting your input locally. If you need an irreversible cryptographic digest for file verification instead of two-way text encoding, generate a checksum with our SHA Hash Generator.
Decode a Base64 String or Encode Files Online
Switch between plain-text UTF-8 strings and binary file uploads up to 10 MB.
Choose Encode or Decode using the switch at the top right of the input card.
Stay on the Text tab to type or paste UTF-8 strings and JSON data, or select the File tab to drop a PDF, CSV, JSON, TXT, or image file (max 10 MB).
Check the Response panel on the right for live converted output alongside the Valid or Error status badge.
Click Copy to place the string on your clipboard, or click Download as Text File to save a .txt copy.
In Decode mode, click Download as Original File when converting Base64 file data back into raw binary bytes.
"All text and file conversions run locally in your browser without sending payloads over the network."
Key Capabilities for Text & Binary Payloads
Built for UTF-8 string conversion and binary file reconstruction up to 10 MB.
Local Browser Processing
Text and uploaded files stay inside your browser tab from start to finish. Nothing is posted to a remote server or written to external logs.
Live Debounced Text Conversion
Typing or pasting into the Text tab updates the output automatically after a 300ms pause, keeping the page responsive on multi-kilobyte strings.
Multi-Byte UTF-8 Support
Standard browser btoa() calls throw errors on non-Latin scripts and emojis. This Base64 tool encodes UTF-8 byte sequences first so international characters survive a round trip intact.
File Upload Encoding (Up to 10 MB)
Drag and drop PDF documents, CSV sheets, JSON files, plain text, or web images (PNG, JPEG, SVG, WebP) to convert their raw bytes into a Base64 string.
Binary File Reconstruction
When decoding an encoded document, use Download as Original File to rebuild the raw byte array (Uint8Array) and save the binary file straight to disk.
Clean Raw RFC 4648 Output
Uploading a file strips the browser Data URI header (such as data:application/pdf;base64,) automatically so you get a pure Base64 payload ready for JSON fields or MIME bodies.
Malformed Input Detection
The status badge flags invalid characters and broken 4-character block lengths right away, helping you catch truncated strings or stray whitespace.
Clipboard & .txt File Export
Copy output to your clipboard in one click or save long strings directly as base64_encoded.txt and base64_decoded.txt files.