# Encoding & IDs

Base64 Encode / Decode

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

Updated

File drag-and-drop Base64URL mode Image preview

Loading Base64…

What this page sends

  • Your input: Text and files are encoded in this tab; files are read with FileReader and not sent to a server.
  • Share links: Share links put a Base64 copy of your input and output in the URL itself (after #d=). Anyone with the link can read it, so don't share a link that contains secrets.
  • Editor: On desktop screens the code editor (Monaco) is downloaded from cdn.jsdelivr.net; phones get a built-in lightweight editor instead.
  • Page load: Loading the page requests HTML, scripts and images from ByteKiln, fonts from Google Fonts, and sends Google Analytics page views, tool-usage events and catalog interactions (tool/category IDs, result status and whether a click followed search — never your input, output or search terms). Privacy & sharing

How the Base64 Encode / Decode Works

The ByteKiln Base64 tool encodes and decodes text or files in your browser using JavaScript's built-in encoding APIs: TextEncoder for text and FileReader for files.

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; the file is not sent to a server. 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.

Limitations

  • Decoded bytes are shown as UTF-8 text. Binary content (an image, a zip, a protobuf) will look garbled in the text view — decode it as a file instead, or use the File tab to go the other way.
  • Files are read fully into memory and the whole Base64 string is rendered in the page, so files of tens of megabytes make the tab slow; there's no streaming.
  • Base64 is an encoding, not encryption — anyone can decode it. It also grows data by about a third.
  • Line-wrapped MIME Base64 is decoded, but other alphabets (Base32, Base58, Ascii85) are not supported.

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.

Want the background and worked examples? There's a longer write-up.

Read the Base64 guide

Related guides