Open tools · 0

About

Base64 Encode & Decode

Encode text or a file to Base64, or decode Base64 back into text or a file, with the box you type in always on top and the result below it. A decoded file is recognised for what it is (a PNG, a PDF, a zip), previewed when it is a picture, and downloads with the right extension.

What it does

  • Text to Base64 and back as you type, in the standard or the URL-safe alphabet, with or without padding.
  • One line, wrapped at 76 characters for MIME or 64 for PEM, or a data: URI ready for HTML or CSS.
  • Text read as UTF-8, UTF-16 LE (what PowerShell’s -EncodedCommand carries) or Windows-1252; a list encoded one line at a time.
  • Files up to 50 MB in, as Base64; Base64 out as a file, its type read from the bytes.
  • A decoded picture previewed, and copied as CSS or as an <img>.
  • Mistakes placed by line and column (a URL-encoded %3D, the dots of a JWT, a stray quote), with Go to error.
  • A reading that works but is wrong, like ASCII read as UTF-16, called out with the right one a click away.

How to use it

  1. Choose Encode or Decode.
  2. Paste the text or the Base64 into the top box, or drop a file on the window.
  3. Set the alphabet, padding and wrapping if the other side is particular about them.
  4. Copy the result, or download the decoded file.

What it does not do

  • Legacy character sets such as EBCDIC or KOI8: the browser cannot write them, and they are rarely pasted now.
  • Fetching a URL to encode: the page is not allowed to reach other sites.
  • Reading a JWT’s claims: the dots are recognised and pointed out, but decoding a token is a job of its own.

Questions

Standard or URL-safe?

URL-safe swaps + and / for - and _ and usually drops the padding; JWTs, file names and query strings use it. If the other side rejects your string, switch.

Why does my decoded text come out as gibberish?

The bytes were not UTF-8. Try Windows-1252 or UTF-16 LE; when the bytes point at one of them, the tool suggests it.

Is Base64 encryption?

No. It is a way of writing bytes as text that survives email and JSON, and anyone can decode it.

Why is the output a third bigger than the input?

Base64 writes every 3 bytes as 4 characters. The ratio is fixed, and a data: URI adds a few characters more for its header.

Everything here runs in your browser. Nothing you type, paste or open is uploaded, and there is no account and no queue. How that works.

For one job

  • Image to Base64: A picture as Base64 or a data: URI, ready for HTML or CSS.
  • Base64 to Image: A Base64 string or data: URI shown as the picture it holds.

Often used with

More in Converters

  • Unit Converter: Convert length, weight, temperature, volume, area, speed, data size and nine more quantities, both ways, with the formula.
  • CSV Viewer & Editor: Open a CSV, Excel or JSON file as a table, tidy it (spaces, duplicates, garbled letters, dates and numbers) and save it as CSV, .xlsx or JSON.
  • JSON, YAML, XML & TOML: Convert between JSON, YAML, XML and TOML, keeping comments, key order and numbers exactly as written, and told what each format cannot carry.

All toolsAbout utilbrewPrivacy