# Encoders

Base64 Encode / Decode

Convert text to Base64 and back with Unicode-safe browser-side processing.

File drag-and-drop Base64URL mode Image preview

How the Base64 Encode / Decode Works

The ByteKiln Base64 tool encodes and decodes text or files entirely in your browser using JavaScript's built-in encoding APIs. No data is uploaded — all processing is client-side using TextEncoder and FileReader.

Text encoding and decoding

Pasting text and selecting Encode produces a standard Base64 string. Selecting Decode reverses the process. Unicode characters are handled correctly using TextEncoder/TextDecoder — no data loss for non-ASCII input.

File encoding

Switch to the File tab and drop any file to encode it as Base64. The tool reads it locally using the FileReader API without uploading. Image files also display a live preview using the resulting data URI.

Base64URL mode

Enabling Base64URL switches to RFC 4648 §5 encoding: + becomes -, / becomes _, and = padding is removed. Use this for JWT payloads, URL query parameters, or any context where standard Base64 characters would need percent-escaping.

FAQ

Short answers for the things developers usually ask before trusting a tool.

Can I encode files to Base64 with the ByteKiln tool?

Yes. Switch to the File tab and drop any file onto the upload zone. The tool reads it locally using the FileReader API and produces the Base64 string in-browser — no file is ever uploaded to a server.

What is Base64URL mode?

Base64URL (RFC 4648 §5) replaces + with - and / with _ and removes = padding characters. This variant is safe to use directly in URLs, query strings, and JSON Web Tokens without percent-encoding.

Can it decode malformed Base64?

Invalid Base64 strings return a clear error message rather than silently producing broken output. Common mistakes like missing padding or invalid characters are detected immediately.

Is there a file size limit for Base64 encoding?

The tool handles files up to a few megabytes comfortably in-browser. Very large files may slow down depending on your device, as all processing happens on the client side.

When would I use Base64 encoding in practice?

Base64 is commonly used to embed images in CSS or HTML as data URIs, encode binary attachments in JSON APIs, transmit binary data over text-only protocols, and represent cryptographic keys or JWT payloads.

Related tools

Useful follow-ups when one conversion usually turns into three more.