Base64 Converter — encode and decode

Convert text and files to Base64 and back. base64url is supported too, and everything is computed in your browser.

Direction

Plain text

Base64 result

The encoded Base64 will appear here

Type something or upload a file

How Base64 works

Base64 is a transformation, not encryption. It rewrites arbitrary bytes using an alphabet of only 64 characters so the data survives anywhere that can carry text — email, JSON, a URL, an HTML attribute. No key is needed to reverse it, which is why it is never a privacy measure.

The alphabet

A–Z, a–z, 0–9 plus + and / — 64 characters in total, so each character carries exactly 6 bits. Trailing = signs pad the output to a multiple of four.

Why it grows

Three bytes (24 bits) become exactly four Base64 characters, so the result is always about 33% larger than the source — a 1 MB image becomes 1.37 MB of text.

base64url

In URLs and filenames + and / have their own meaning, so a variant swaps them for - and _. All three parts of a JWT use it. This tool reads both.

Turning the word Ali into Base64
StepValue
TextAli
UTF-8 bytes0x41 0x6C 0x69
24 bits01000001 01101100 01101001
6-bit groups010000 010110 110001 101001 → 16 22 49 41
Base64QWxp

Frequently asked questions

Does Base64 encrypt my data?

No. Base64 is an encoding, not encryption. Reversing it needs no key and anyone can do it in a second. Putting a password, a token or personal data through Base64 to "hide" it provides no protection at all.

What is base64url, and when do I need it?

The + and / of the standard alphabet have their own meaning in URLs, query parameters and filenames. base64url replaces them with - and _ and usually drops the trailing = padding. JWT, OAuth and many APIs use it. Tick "URL-safe" when encoding; when decoding, both variants are recognised automatically.

Can I encode files as well?

Yes. Text files (.txt, .json and similar) are loaded into the source panel as text. Images have no text form, so they are encoded once directly from their bytes and the result appears in the output panel — which is the value you need to inline them as a data URI in CSS or HTML. The limit is 10 MB.

Is my data sent to a server?

No. Encoding, decoding and file reading all happen in your browser. After the page has loaded this tool makes no network requests at all, so it is safe to use with a token or a confidential payload.

Other useful tools