🔄 Developer tools

Base64 encoder and decoder

Encode or decode text, files and images as Base64 in your browser. Restore Base64 to a file and download it.

🗓️ Last updated 2026.07.14 ⏱️ Time required About 10 seconds 🔒 Browser conversion · Input is not saved Translation updated: 2026-11-02

base64 · text · file

Base64 encoding and decoding

Convert text and files to Base64, or restore Base64 to text and files.

Waiting

Choose Encode or Decode, select Text or File, then enter your content.

Waiting for text input
✏️ Original text 0 characters
📤 Base64 output 0 characters
Original: 0 B Result: 0 B Size ratio: -
Enter content to see the Base64 result.
Conversion result Shown after input
Status Encoding or decoding status
Size and ratio Input and output sizes

Base64 encoder and decoder guide

Base64 represents bytes with 64 characters: A-Z, a-z, 0-9, + and /. The = character is separate padding. It is used to carry original bytes as text in email attachments, JSON payloads, data URIs and small token representations. The Text tab converts UTF-8 strings to Base64 and back. The File tab accepts a chosen or dropped file for encoding, or restores a Base64 string as a downloadable file. Processing happens in your browser without sending the input or files to the Toolvil server.

Base64 is a reversible representation, not encryption. Do not use it to hide passwords, authentication tokens or personal data. This tool checks Base64 characters and padding, verifies whether decoded bytes form UTF-8 text, and normalizes URL-safe strings to standard Base64. Image previews show the beginning of a Data URI, but copying returns only the Base64 payload. To use it in HTML or CSS, add the data:image prefix for the actual image format yourself.

When this tool is needed

  • Encode text for an API example or test payload
  • Prepare an image or file as a Data URI or Base64 string for code
  • Restore received Base64 as the original text or a file

Before converting

  • Base64 is not encryption. Do not use it to hide sensitive values.
  • For decoding, check the Base64 alphabet and padding, or use a valid URL-safe form.
  • File encoding supports up to 10 MB. The encoded result is approximately 33% larger than the original.

How to use

  1. Choose Encode or Decode and Text or File input.
  2. Enter a string in the Text tab or drag a file into the File tab.
  3. Check the live result, original and result sizes, and size ratio.
  4. Copy the result or convert it to URL-safe format if needed.
  5. For a decoded file, choose an extension and select Download.
Input valuesUTF-8 text, a Base64 string or a chosen file (up to 10 MB)
Output valuesBase64 payload / decoded text / restored file (11 extensions) / image Data URI header preview
Processing methodLocal browser processing using TextEncoder, TextDecoder, btoa/atob, FileReader and Blob
NoteBase64 is not encryption and anyone can decode it. Encoding increases size by about 33%.

Text Base64 encoding and decoding

The Text tab encodes UTF-8 strings containing Korean, emoji and English as standard Base64, then decodes them again. Input and output are side by side. Use the middle ⇅ button to swap them and decode a result immediately. Live character counts and byte sizes help compare the data before and after conversion.

Encode files with selection or drag and drop

In the File tab, drag a file or click to choose one for Base64 encoding. All file formats are accepted, up to 10 MB. Conversion takes place inside the browser, so selecting a file does not send it to an external server.

Base64 images and Data URIs

Image file bytes are converted to a Base64 payload. The preview shows the beginning of a header such as data:image/png;base64,… and part of the payload. Copy returns the complete Base64 payload only. For a PNG, prepend data:image/png;base64, to the copied value for an HTML img src or CSS image URL. Check the actual format and MIME type rather than assuming them from the extension.

Decode Base64 and download a file

In Decode mode, paste Base64 into the File tab, choose an extension such as .png, .pdf or .zip from 11 options, then select Download to save the restored file. This is useful when you receive Base64 representing an image, document or archive and need its original bytes as a file.

URL-safe Base64 conversion and normalization

The +, / and = characters can be inconvenient in URLs and file names. URL-safe Base64 uses - and _ and can omit padding. Use the 🔗 URL-safe button to convert a result. URL-safe strings entered for decoding are normalized to standard Base64 automatically.

Base64 is not encryption

Base64 is an encoding that represents data as text, not encryption. Anyone can decode it to restore the original. Protect passwords, authentication tokens and personal data with actual encryption rather than Base64.

As its name suggests, Base64 represents values using 64 characters. To compare the same bytes in base 2, base 8 or base 16, use the number base converter. This helps inspect byte values from decoded data.

This utility converts Base64 representations and restores file bytes. It does not replace data security, integrity checks or virus scanning. Review untrusted Base64 and files separately before using them.

FAQ

What are Base64 encoding and decoding?

Base64 represents binary and text bytes with 64 characters: A-Z, a-z, 0-9, + and /. The = sign adds padding for remaining data and is not part of that 64-character alphabet. Decoding restores bytes from this representation; it is not decryption.

Can I encode files and images as Base64?

Yes. Choose or drag a file into the File tab to generate a Base64 payload. Images also show the start of a Data URI in the preview. Copy returns the raw Base64 payload only. For an HTML or CSS image URL, prepend the prefix for the actual format, such as data:image/png;base64,.

Can I save a Base64 string as a file?

Yes. In Decode mode, paste Base64 into the File tab, choose an extension such as .png, .pdf or .zip from 11 options, then download. The restored bytes are saved as-is. Changing the extension neither converts the actual format nor checks that the file is valid.

Is URL-safe Base64 supported?

Yes. Convert a result to URL-safe form (+ → -, / → _, omit =). When you paste URL-safe input for decoding, it is normalized to standard Base64 automatically.

Is my text or file sent to a server?

The tool converts in your browser without automatically sending or saving input text or files on a server. Base64 is not encryption, and shared, copied or downloaded results still contain the original data. For confidential information or authentication tokens, also check who can access your device and clipboard.