About Base64 Encoder
Base64 turns bytes into a safe ASCII string so they can travel through email, JSON, URLs and data URIs. The catch is that JavaScript's built-in btoa and atob only handle Latin-1, so the same functions destroy accents, Chinese characters and emoji unless the text is converted to UTF-8 bytes first. This encoder does that conversion for you in both directions.
The tool also encodes small files straight from your device, up to 1 MB, which is enough for a favicon, a small SVG or a test payload inside a data URI. Optional line wrapping at 64 or 76 characters keeps output readable in code and matches the line lengths traditionally used by MIME and PEM formats.
What this tool does
UTF-8 safe both ways
Text passes through TextEncoder and TextDecoder, so accents, Chinese, Japanese and emoji round-trip without being corrupted.
Encode or decode in one action
Switch direction with the segmented control, run the conversion, and swap the result back to the input pane when you need to reverse it.
Optional line wrapping
Wrap encoded output at 64 or 76 characters for readable code and mail headers, or leave it on one line for data URIs and API fields.
Small files to Base64
Drop a file of up to 1 MB to encode its raw bytes, with the original size and the encoded length both shown.
Forgiving decoder
Spaces and line breaks are ignored when decoding, and URL-safe Base64 characters are accepted and normalized before the conversion.
Copy with confirmation
A dedicated copy button writes the output to the clipboard and shows a copied state so you know it worked.
How to use Base64 Encoder
- 01
Choose a direction
Select Encode to turn text into Base64, or Decode to turn a Base64 string back into readable text.
- 02
Enter your input
Type or paste into the input pane. For decoding, the Base64 string can contain line breaks and missing padding.
- 03
Set line wrapping if you need it
Leave wrapping off for a single-line string, or choose 64 or 76 characters to match mail and PEM conventions.
- 04
Run the conversion
Press Encode or Decode and the result appears in the output pane, with character counts for both sides.
- 05
Encode a file instead
Drop a file of up to 1 MB into the file area to encode its raw bytes without converting it to text first.
- 06
Copy or swap the result
Use Copy to take the output, or Swap to move it into the input pane and reverse the direction in one click.
Supported formats and limits
- Input
- TXTBase64
- Output
- Base64
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Maximum size
- 1 MB per file
- Requirements
- Chrome, Edge, Firefox or Safari · 1 MB maximum for file encoding
Limitations worth knowing
- File-to-Base64 is capped at 1 MB per file, and the encoded result is roughly a third larger than the source.
- The output is plain Base64: no data URI prefix such as data:image/png;base64 is added, and nothing is encrypted.
- Decoded output is only readable text for UTF-8 content; binary Base64 has to be saved as a file elsewhere to be useful.
Privacy and file handling
Encoding and decoding happen in your browser tab. Text and files are read by JavaScript on your device and never uploaded, stored or logged; closing the page clears the input and output panes.
Read the full privacy policy