HubTools

Base64 Encoder/Decoder

Encode and decode Base64 strings online. Support for files, URL-safe encoding. Free Base64 converter with file upload.

What is Base64 Encoding?

Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /), expanding the data by roughly 33% in exchange for safe transit through text-only channels. It exists because email (MIME), HTTP Basic Auth, JSON, JWTs, data URIs, and many config formats can only carry text reliably — Base64 lets you embed images, binary blobs, and raw bytes inside those text containers without corruption. This encoder/decoder handles strings and files, supports the URL-safe variant (RFC 4648 §5), and runs 100% client-side. Note that Base64 is encoding, not encryption — never use it to protect secrets. For real confidentiality use the AES Encryptor; for one-way fingerprints use the Hash Generator.
Text / File Input
0 B

Click or drag a file here to encode it to Base64

Max file size: 5MB

Base64 Output
0 B
Encoding Statistics
Input Size
0 B
Output Size
0 B
Size Ratio
N/A
Mode
Encoding
About Base64: Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It is commonly used for encoding data in URLs, email attachments, and data URIs. Base64 encoding increases data size by approximately 33%.

How to use this tool

  1. 1
    Pick encode or decode and an input source
    Choose Encode or Decode. Paste text into the input area or drag-and-drop a file — FileReader reads it locally without any upload.
  2. 2
    Toggle URL-safe if needed
    Enable URL-safe encoding when the output goes into a URL, JWT, or file name where + and / cause problems. Otherwise leave it off.
  3. 3
    Copy the result or generate a data URI
    Copy the encoded or decoded output, or for files use the data URI option to embed images and assets directly in HTML, CSS, or markdown.

Frequently asked questions

What is Base64 used for?
Base64 encodes binary data as ASCII text using 64 printable characters. It's used to embed images in CSS or HTML (data URIs), transmit binary data over text protocols (email MIME, JSON), and store credentials in HTTP Basic Auth headers.