Skip to main content
ByteKiwi
Home Base64 Encoder

Base64 Encoder

Online Base64 encoder and decoder. Encode text, strings, and data to Base64 instantly with Unicode support, one-click copy, and real-time output.

Plain Text
Base64

Features

Everything you need, nothing you don’t.

  • Encodes any text or string to Base64 in real time as you type
  • Full Unicode and multi-byte character support via UTF-8 encoding
  • One-click copy encoded output to clipboard
  • Expand either pane to fullscreen for working with long strings
  • No data leaves your browser - everything runs client-side
  • Keyboard shortcuts: ⌘↵ to encode, ⌘C to copy output

Frequently asked questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to safely transmit binary or non-ASCII data over text-based protocols such as HTTP headers, email, and JSON payloads.

When should I use Base64 encoding?

Use Base64 when you need to embed binary data - like images, files, or keys - in a text-based format. Common use cases include embedding images in HTML or CSS as data URIs, encoding credentials in HTTP Basic Authentication headers, and encoding binary data in JSON payloads.

Does Base64 encoding compress my data?

No. Base64 increases data size by approximately 33% because it maps every 3 bytes of input to 4 output characters. It is an encoding scheme for safe transport, not a compression algorithm.

Is Base64-encoded data safe or encrypted?

No. Base64 is an encoding, not encryption. The encoded data can be trivially decoded by anyone with the string. Do not use it to hide sensitive information such as passwords or secrets. Use a proper encryption algorithm if you need to protect data.

What is the "=" padding at the end of a Base64 string?

Base64 encodes data in groups of 3 bytes. When the input length is not a multiple of 3, one or two = characters are appended as padding to make the output length a multiple of 4. Some implementations use URL-safe Base64 and omit the padding.

Does this tool support Unicode characters?

Yes. The encoder uses UTF-8 encoding before applying Base64, so all Unicode characters - including emoji, CJK characters, and accented letters - are correctly encoded. The companion Base64 Decoder reverses the process automatically.

How do I encode text to Base64 in JavaScript?

In modern browsers and Node.js, use btoa() for ASCII text. For Unicode strings, encode to UTF-8 first:

// ASCII only
btoa('hello world'); // 'aGVsbG8gd29ybGQ='

// Unicode-safe
btoa(unescape(encodeURIComponent('hello world')));

In Node.js 16+, you can also use Buffer.from('hello').toString('base64'). This tool does the same thing in your browser without writing any code.

Can I use this to encode an image to Base64?

This tool encodes text strings, not binary files. To encode an image to Base64 in the browser, use the FileReader API with readAsDataURL(), which returns a Base64 data URI you can embed in HTML or CSS. For command-line image encoding, run base64 image.png on macOS/Linux.