Base64 Encoder & Decoder

Encode text and files to Base64 or decode Base64 back into readable data. Supports standard and URL-safe Base64, Data URLs, and file download — all in your browser.

Read the guide: How to Use Base64 Encoding and Decoding
5 of 5 free uses remaining today
5 conversions remaining
Base64 variant:Uses A–Z, a–z, 0–9, +, / and = padding.

Text to Encode

0 chars

Base64 Result

Encoded Base64 will appear here.

Your data is processed locally where possible and is not included in analytics.

How the Base64 Encoder & Decoder works

  • Text is encoded as UTF-8 bytes, then those bytes are represented as Base64 characters using the browser's built-in TextEncoder and btoa.
  • Files are read as an ArrayBuffer and encoded byte-by-byte to Base64, with an optional Data URL that includes the file's MIME type.
  • Decoding validates the Base64 alphabet and padding before converting back to bytes. Text decode interprets the bytes as UTF-8; file decode offers a download with the correct extension.
  • Data URLs are parsed to extract the MIME type and Base64 data automatically, so you can paste a data:image/png;base64,... URL and download the file directly.

See also: JSON Validator, JSON Minifier, XML Formatter and YAML Formatter.

Examples

Encode text

Hello World → SGVsbG8gV29ybGQ=

Decode Base64

SGVsbG8gV29ybGQ= → Hello World

Unicode text

Hello 👋 → SGVsbG8g8J+Riw==

Useful tips

  • Use Standard Base64 for general purposes and Base64URL for URLs, filenames or JWT tokens.
  • If decoding produces garbled text, the data may be binary — switch to File Decode mode to download it as a file.
  • Paste a Data URL (data:...;base64,...) in File Decode mode to automatically detect the MIME type and download the file.
  • Base64 increases data size by roughly 33% — consider compression if you need to reduce the output size.

Frequently asked questions

What is Base64?+

Base64 is an encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, + and /). It is used to safely transport binary data through text-based systems.

How do I encode text to Base64?+

Choose the Encode mode, paste your text into the input editor, and click Encode to Base64. The Base64 output can be copied or downloaded.

How do I decode Base64?+

Choose the Decode mode, paste your Base64 string into the input editor, and click Decode Base64. If the decoded data is valid UTF-8 text, it is displayed in the output editor.

Is Base64 encryption?+

No. Base64 is encoding, not encryption. Anyone with the Base64 string can decode it instantly without a key. Do not use Base64 to protect sensitive information.

Can Base64 encode files?+

Yes. Choose File Encode mode, upload a file (up to 10 MB), and click Encode File. The Base64 representation is generated, with an optional Data URL for inline use.

Can I decode a Base64 file?+

Yes. Choose File Decode mode, paste a Base64 string or Data URL, and click Decode to File. The decoded bytes can be downloaded with the appropriate file extension.

What is Base64URL?+

Base64URL is a URL-safe variant of Base64 that replaces + with - and / with _, so the result can be used in URLs and filenames without escaping. Padding is often omitted. Base64URL is not identical to standard Base64.

Why does Base64 make data larger?+

Base64 represents every 3 bytes of input as 4 characters, so the encoded output is approximately 33% larger than the original data. This overhead is the trade-off for safe text-based transport.

Can Base64 contain images?+

Yes. Any binary data, including images, can be encoded as Base64. The File Encode mode generates a Base64 string and an optional Data URL (data:image/png;base64,...) that can be embedded directly in HTML or CSS.

What is a Base64 Data URL?+

A Data URL is a URL that embeds the file data directly in the URL string, prefixed with the MIME type. For example, data:image/png;base64,iVBORw0KGgo... embeds a PNG image. Data URLs can be used in HTML, CSS and JSON where inline binary data is needed.

Is Base64 secure?+

No. Base64 is encoding, not encryption. It provides no confidentiality — anyone with the Base64 data can decode it. If you need security, use encryption (such as AES) and manage keys appropriately.

Is my Base64 data stored when I use this tool?+

No. All encoding and decoding runs entirely in your browser. Your text, files and Base64 strings are never uploaded or stored, and your data is not included in analytics.

Related guides

What would you like to do next?