Base64 Converter

Encode text or files to Base64 and decode Base64 strings back to text or binary files. Accepts URL-safe Base64, missing padding and data: URLs. Decoded images, archives and other binary data are kept intact and can be downloaded. Everything runs in your browser.

About this tool

What is Base64?

Base64 is a way to represent binary data using only 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). Every 3 bytes of input become 4 characters, and = is added as padding when the input length is not a multiple of 3. It is used wherever binary data has to travel through text: email attachments, data URLs in HTML and CSS, JSON APIs, and HTTP Basic authentication headers. This tool encodes any text or file to Base64 and decodes Base64 back to the exact original bytes.

How to use

  1. Type text into Raw data, or drop a file onto it.
  2. Click Encode. The Base64 string appears in Encoded data.
  3. To decode, paste Base64 into Encoded data (or drop a text file containing it) and click Decode. The result appears in Raw data.
  4. Use the buttons in the corner of each editor to copy the content, download it as a file, or open it full screen.

Features

  • Encode text (as UTF-8) or any file to standard Base64 with = padding
  • Decode standard Base64 and URL-safe Base64 (- and _ instead of + and /)
  • Padding is optional when decoding
  • Line breaks and spaces (for example 76-character MIME line wrapping) are ignored when decoding
  • A data:...;base64, prefix is stripped automatically, so you can paste a data URL directly
  • Binary results are kept byte-for-byte and can be downloaded as a file
  • Shows the size of each side and reports invalid characters below the buttons

Examples

InputBase64
testdGVzdA==
Hello, World!SGVsbG8sIFdvcmxkIQ==
こんにちは (UTF-8)44GT44KT44Gr44Gh44Gv

FAQ

Is my data uploaded anywhere?

No. Encoding and decoding happen entirely in your browser, so it is safe to use with files you do not want to share. The current input is saved only in this browser so it is still there next time.

How do I turn a Base64 string back into an image or file?

Paste the string (with or without the data:image/png;base64, prefix) into Encoded data, click Decode, then click the download button on Raw data.

Can it produce URL-safe Base64?

Encoding always produces standard Base64 with +, / and padding. URL-safe input is accepted when decoding.

Why does the output get longer?

Base64 turns every 3 bytes into 4 characters, so the encoded text is about 33% larger than the original data. Base64 is an encoding, not compression or encryption: anyone can decode it.