Skip to content
SPCXTools

Base64 Encode & Decode

Convert text and files to Base64 and back, with full UTF-8 and Base64URL support.

Runs locally — files never leave your device

Loading tool…

How to use Base64 Encode & Decode

  1. 1Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
  2. 2Type or paste into the input box — the output updates instantly.
  3. 3Tick URL-safe (Base64URL) if the result will be used in a URL, filename or JWT.
  4. 4To encode a file, choose or drop it in the file section; tick Data URL to get a string you can paste into HTML or CSS.
  5. 5Copy the result, or in decode mode download the decoded bytes as a file.

Base64 encoder and decoder

Base64 is a way of writing any data — text, images, PDFs, keys — using only 64 safe characters: A–Z, a–z, 0–9, + and /. This tool encodes text and files to Base64 and decodes Base64 back to readable text or the original file. Conversion happens instantly in your browser, and nothing you paste or select is uploaded.

What it can do

  • Encode text to Base64 with proper UTF-8 handling, so any language and emoji are supported.
  • Decode Base64 to text, tolerating line breaks, spaces and missing padding — common when copying from emails or logs.
  • Base64URL mode for URL-safe output, used by JWTs, OAuth and many web APIs.
  • File to Base64, with an option to output a complete data: URL ready for an <img src> or CSS url().
  • Base64 to file: download the decoded bytes when the content is binary, such as an image or PDF.

Where Base64 is used

Email attachments. The MIME standard encodes attachments in Base64 so binary files survive transport through systems designed for text.

Data URLs. Small icons and images can be embedded directly into HTML or CSS as data:image/png;base64,…, saving an extra network request.

APIs and configuration. Binary values such as certificates, encryption keys or file uploads are often sent inside JSON as Base64 strings. Kubernetes secrets and many environment variables also store values in Base64.

Authentication. HTTP Basic authentication sends username:password encoded as Base64, and JSON Web Tokens are three Base64URL-encoded parts. To inspect a token's contents, use the JWT Decoder.

How Base64 works

The encoder takes the input three bytes (24 bits) at a time and splits them into four 6-bit groups. Each 6-bit value (0–63) maps to one character of the Base64 alphabet. When the input length is not a multiple of three, the output is padded with one or two = signs so its length is a multiple of four.

Because each 3 bytes become 4 characters, Base64 data is about one third larger than the original. That overhead is the price of being able to pass binary data safely through text-only systems.

Base64 is not the same as URL encoding. If you need to put arbitrary text into a query string, use URL Encode/Decode instead. To check whether two files are identical, compare their checksums with the Hash Generator.

Frequently asked questions

Is Base64 a form of encryption?
No. Base64 is an encoding, not encryption. Anyone can decode it without a key. Use it to move binary data through text-only channels, never to hide secrets.
Why is the Base64 output larger than the input?
Base64 represents every 3 bytes with 4 characters, so encoded data is about 33% larger than the original (plus up to two = padding characters).
What is Base64URL?
Base64URL replaces + with - and / with _, and usually drops the trailing = padding, so the string can be used safely in URLs and filenames. JSON Web Tokens use Base64URL. The decoder here accepts both variants automatically.
Does it support emoji and non-English text?
Yes. Text is converted to UTF-8 bytes before encoding and decoded as UTF-8, so accents, Chinese, Arabic, emoji and other characters round-trip correctly.
Are my files uploaded?
No. Files are read with your browser's File API and encoded on your device. Nothing is sent to a server.
The decoded text looks like gibberish — why?
The Base64 probably contains binary data such as an image, PDF or compressed file rather than text. Use Download file to save the decoded bytes, then open the file with the right program.