Base64 and URL Encoding Explained (in Plain English)

Sooner or later you'll bump into strange-looking text: a string of letters and numbers ending in "==", or a web address littered with "%20" and "%3D". These are Base64 and URL encoding at work. They sound technical, but the ideas behind them are simple, and understanding them takes the mystery out of a lot of everyday computing.

Encoding is not encryption

First, an important myth to bust: encoding is not security. Encryption scrambles data so only someone with a key can read it. Encoding just rewrites data into a different but fully reversible format, with no secret involved — anyone can decode it. Encoding exists to make data safe to transport, not to hide it. Never treat Base64 as a way to protect a password.

What Base64 does

Computers store everything as bytes, but many systems — email, web pages, JSON — were designed to handle plain text. If you try to push raw binary data (like an image) through a text-only channel, it can get corrupted. Base64 solves this by converting any binary data into a safe alphabet of 64 characters (A–Z, a–z, 0–9, plus two symbols). The result is bigger — about a third larger than the original — but it survives being sent through text-based systems intact.

That's why you'll see Base64 when an image is embedded directly in a web page's code, when files are attached to emails, or when small pieces of binary data are stored inside JSON. The trailing "=" characters you sometimes see are just padding to make the length come out even.

What URL encoding does

Web addresses have a limited set of characters they can safely contain. Spaces, accents, and symbols like &, ? and = have special meaning in a URL or simply aren't allowed. URL encoding (also called percent-encoding) replaces those characters with a "%" followed by a code. A space becomes %20, for example. This lets you put arbitrary text — a search query with spaces, a name with an accent — safely inside a link without breaking it.

How they differ

They solve related problems — "make this safe to transport" — but in different contexts and different ways.

When you'll actually use them

You might decode a Base64 string to inspect what a system is sending, encode a snippet of text to embed in a data URL, or URL-encode a search term to build a link by hand. Because both are fully reversible, tools handle them instantly. Our Base64 encoder and decoder and URL encoder and decoder both run entirely in your browser, so whatever you paste never leaves your device — which matters if the text is at all sensitive.

Other encodings you'll bump into

Base64 and URL encoding are the two you'll meet most, but they have relatives worth recognising. HTML entities encode characters that have special meaning in web pages — < for a less-than sign, for instance — so they display as text instead of being interpreted as markup. Hexadecimal encoding represents bytes as pairs of hex digits, common in low-level contexts and in colour codes. Unicode escapes (like \\u00e9 for "é") let systems represent any character using only plain ASCII. They're all variations on the same theme: take data that would cause trouble in a particular context, and rewrite it into a form that's safe there — reversibly, and without any secrecy.

A mental model that ties it together

The single idea underneath every encoding scheme is "make this data safe to travel through a channel that has rules about what it can contain." Email and web pages want text, so binary gets Base64-ed into text. URLs forbid certain characters, so those get percent-encoded. Markup treats some characters specially, so they get turned into entities. Once you see encoding as a translation for transport rather than a form of protection, the whole family stops being mysterious — and you'll never again mistake it for encryption.

This distinction has real consequences. People occasionally Base64-encode a password or a token and feel they've hidden it, when in fact anyone can decode it in a second. Encoding scrambles nothing and keeps no secret; it only changes the packaging. If your goal is to keep something private, you need encryption (which uses a key) or a proper secret store — never encoding. Keeping the two ideas firmly separate in your mind will save you from a whole category of security mistakes.

Key takeaways

Advertisement

Tools mentioned in this guide

Base64 Encoder & Decoder

Encode text to Base64 or decode it back instantly.

Developer Tools

URL Encoder & Decoder

Percent-encode or decode URLs and query parameters.

Developer Tools