Ontoom

Base64 Universal

Convert any file to Base64 and back — in your browser, with nothing uploaded to a server.

Rebuilds these and other formats

max 50.00 MB

  • PDF
  • DOCX
  • XLSX
  • PPTX
  • PNG
  • JPEG
  • WEBP
  • GIF
  • SVG
  • ZIP
  • MP3
  • MP4

Drop the .txt with Base64 here

Accepts .txt · .b64 · .base64 · max 50 MB

Important: Everything runs in the browser. Nothing is uploaded. Limit: 50 MB.

What Base64 is

Base64 is a way to represent binary data using only 64 printable characters: A–Z, a–z, 0–9, + and /, with = as padding. Every 3 bytes of input become 4 characters of output, so encoded data is about 33% larger than the original. The standard is described in RFC 4648.

It exists because many channels were built for text: email bodies, JSON fields, XML, HTTP headers. Base64 lets you carry an image, a PDF or arbitrary bytes through them without corruption. It is an encoding, not encryption; anyone can decode it.

What this tool does

  • Text tab: converts text to Base64 and back as you type. Text is handled as UTF-8, so accents and emoji survive the round trip.
  • File tab: turns any file into Base64, or rebuilds a file from Base64 and offers it for download, with a preview for images and PDFs.
  • Accepts data URIs (data:image/png;base64,…) and the URL-safe alphabet (- and _) when decoding.
  • Files up to 50 MB. Nothing is uploaded; conversion happens in your browser.

How to use it

  1. For short text, stay on the Text tab, choose Text → Base64 or Base64 → Text, and type or paste.
  2. For files or very long strings, use the File tab and drop the file or paste the Base64.
  3. Copy the result, or download the reconstructed file when decoding binary data.

A worked example

The word Man is the bytes 77, 97 and 110. In binary that is 24 bits, which Base64 splits into four 6-bit groups: 19, 22, 5 and 46. Looking those up in the alphabet gives T, W, F and u, so Man becomes TWFu. When the input length is not a multiple of 3, = padding fills the gap: Ma becomes TWE= and M becomes TQ==.

Man  →  TWFu
Ma   →  TWE=
M    →  TQ==

Base64 vs Base64URL

Standard Base64 uses + and /, which have special meaning in URLs. Base64URL replaces them with - and _ and usually drops the padding. JWTs, many OAuth parameters and some web APIs use Base64URL. If you paste a JWT segment here, it will decode; to read a whole token at once, use the JWT decoder.

Where you run into Base64

  • Data URIs that inline small images in CSS or HTML.
  • Email attachments (MIME) and some API payloads that carry files inside JSON.
  • HTTP Basic authentication, where user:password is Base64-encoded, which is why Basic auth must always run over HTTPS.
  • Kubernetes Secrets and many config systems that store binary values as Base64 text.
  • Pair it with the JSON formatter when the Base64 sits inside an API response.

How a file is recognized

On the way back from Base64 to a file, the page looks at the first bytes. It recognizes PDF, PNG, JPEG, GIF, WebP, BMP, TIFF, ICO, AVIF, HEIC, MP4, MP3, RAR, 7z, TAR, EXE (the MZ signature), OLE documents, SVG, HTML, XML, and gzip. A ZIP is opened far enough to split DOCX, XLSX, PPTX, ODT, ODS, ODP, APK, JAR, EPUB, or a plain ZIP.

With no known signature, bytes that are valid UTF-8 come back as text. Anything else can still be downloaded; the extension is the one detection found, or the generic case. The hard limit is 50 MB on the file. The page does not upload the content. Decode accepts .txt, .b64, and .base64, strips whitespace, surrounding quotes, and a data-URI prefix up to ;base64,, and accepts the URL alphabet (- and _).

Frequently asked questions

Is Base64 encryption?
No. It is a reversible encoding with no key. Anyone can decode it, so never rely on it to hide secrets.
Why is the Base64 output bigger than my file?
Every 3 bytes become 4 characters, so the output is roughly 33% larger, plus a little padding.
Are my files uploaded?
No. Encoding and decoding run in your browser, and the file never leaves your device.
What do the = signs at the end mean?
They are padding that makes the output length a multiple of 4. One = means the last group had 2 bytes; two mean it had 1.
Why does decoding give garbled text?
The original data was probably binary, such as an image or PDF, rather than text. Use the File tab to download it as a file instead.

Written by Orlando Alves · reviewed on · Editorial policy

See also