Encoding

Base64

Base64 encode and decode — text and files, right in your browser.

Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /). It exists so binary data — images, archives, cryptographic keys — can pass unchanged through channels that were designed for text only.

This tool encodes and decodes both plain text and files. Everything runs client-side in your browser: the input never leaves your machine, which makes it safe for tokens, private keys, and other sensitive data.

How to use it

Common uses

Things to keep in mind

Base64 is not encryption — anyone can decode it. It only changes the representation of data, not its confidentiality.

Encoded output is about 33% larger than the input because every 3 bytes become 4 characters.

For URLs and file names use Base64URL, which swaps + and / for - and _ and often drops the = padding.

Article about this tool: Base64: why encoding is needed and how it works

Frequently asked questions

What is Base64 actually used for?

Base64 turns binary data into plain ASCII text so it can safely travel through systems that only handle text, like email bodies, JSON payloads, or embedding a small image directly in CSS/HTML.

Why is the encoded output bigger than my input?

Base64 packs 3 bytes of input into 4 output characters, so encoded text is roughly 33% larger than the original. This is expected and not a sign of an error.

Is my file or text uploaded anywhere?

No. Encoding and decoding happen entirely in your browser using JavaScript — nothing is sent to a server, so it works fine offline too.

How is standard Base64 different from Base64URL?

In Base64URL, the characters + and / are replaced with - and _, so the string can be safely dropped into a URL or file name without extra percent-encoding. This is the variant JWT uses.

What does the = character at the end of the string mean?

It's padding, showing how many bytes are missing from the final 3-byte block. It isn't always required — some systems deliberately drop it.

Articles: Encoding

Base32: how it differs from Base64 and when it is more convenient

The case-insensitive Base32 alphabet and scenarios where it beats Base64.

URL Encode/Decode: percent-encoding in links

How special characters in URLs and query parameters turn into %XX sequences.

HTML Entities: how to safely output special characters on a page

Why the characters < > & need escaping and how that prevents broken markup.

JWT: token structure and what "decoding" a JWT actually means

The header, payload, and signature of a JWT, and why decoding is not the same as verifying the signature.

Unicode Escape: what \uXXXX sequences mean

Where \u0041-style sequences in JSON and JS strings come from and what they mean.

ROT13 and the Caesar cipher: simple character substitution

Why shifting by 13 letters makes ROT13 self-inverse, and why anyone still uses it today.

Punycode: how internationalized domains work in DNS

How a domain with non-Latin characters gets converted into an ASCII form with the xn-- prefix.

Morse code: how text becomes dots and dashes

The principle behind encoding letters as dots and dashes, and where Morse code is still used today.

Data URI: when to embed images directly in code

How a data: URI embeds a file’s contents directly in HTML or CSS, and when that is worth it.

Gzip + Base64: compressing data for text-based transfer

Why compressed binary data also gets Base64-encoded before going into a text field.

XML Entities: escaping characters in XML documents

The five required XML entities without which a document breaks during parsing.