What Is URL Encoding?

Updated 2026-07-04 ยท By the MakeToolz team

Quick answer: URL encoding, also called percent-encoding, replaces characters that are not allowed in a web address with a percent sign and a two-digit code. A space becomes %20. It keeps links and query strings valid so browsers and servers read them correctly.

Every character that is unsafe or has a special meaning in a URL gets swapped for a percent sign and the character's code. This lets you put spaces, accents, and symbols into a link without breaking it. A URL encoder does the whole swap for you.

Why URLs need encoding

A web address can only use a small set of characters safely. Letters, numbers, and a handful of symbols like the hyphen, period, underscore, and tilde are fine. Everything else falls into two groups. Some characters, like the ampersand, question mark, and hash, have a reserved job in a URL. Others, like spaces, accents, and most symbols, are simply not allowed in raw form.

Drop one of these into a link untouched and things go wrong. A space can cut the link short. An ampersand inside a value can look like the start of a new parameter, so the server reads the URL the wrong way. Encoding removes that ambiguity by turning each risky character into a harmless code.

How percent-encoding works

Encoding swaps each unsafe character for a percent sign followed by the two-digit hexadecimal code for that character. You do not have to memorize the codes, but a few are worth recognizing:

Characters outside basic English, like accented letters or emoji, are first turned into their UTF-8 bytes, and each byte becomes its own percent code. That is why a single emoji can expand into several percent groups. Your URL encoder handles all of this automatically.

The two kinds of encoding

There are two modes, and picking the right one matters. Choosing the wrong one is the most common encoding mistake:

The rule of thumb: if the text is a single piece of data going into a URL, escape everything. If the text is already a complete URL, leave its structure alone.

Where you will run into URL encoding

Decoding: reading it back

Decoding reverses the process. Paste an encoded string like hello%20world and you get hello world back. This is handy when you copy a messy link full of percent codes and want to see what it actually says, or when you need to check what a parameter really contains. The free URL Encoder and Decoder converts both ways, handles emoji and accents, and runs in your browser so nothing is uploaded.

People Also Ask

Why does a space become %20?

Spaces are not allowed in a URL, so they are replaced with %20, the percent code for a space character. Some older web forms use a plus sign instead, especially in the query part, but %20 is the safe, modern standard that works everywhere in a URL.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes everything, including &, =, and /, which is right for a single value. encodeURI leaves the URL structure characters alone, which is right for a whole address. Use encodeURIComponent for a parameter and encodeURI for a full link. The tool's two modes map to these exactly.

Is URL encoding the same as encryption?

No. Encoding just rewrites characters so a link stays valid, and anyone can decode it instantly. It hides nothing and offers no security. Never use URL encoding to protect a secret, a password, or any sensitive data.

Do I need to encode a normal link I type?

Usually not, if the link only has letters, numbers, and simple paths. You need encoding when a value holds spaces, symbols like & or ?, or non-English characters. Modern browsers even encode some characters for you, but doing it explicitly avoids surprises.

Why is %20 sometimes shown as a plus sign (+)?

In the query string of older HTML forms, a space is encoded as a plus sign instead of %20. Both can mean a space depending on where they appear, which is a common source of confusion. When in doubt, %20 is safe in every part of a URL, while the plus sign is only a space inside form-style query data.

What happens if I do not encode a special character in a URL?

The link can break or point somewhere wrong. A space may cut the URL short, and an ampersand inside a value can be read as the start of a new parameter, so the server misreads your data. Encoding removes that risk by turning each special character into a safe code.

Can I encode emoji and non-English characters in a URL?

Yes. They are first converted to their UTF-8 bytes, and each byte becomes its own percent code, so one emoji can turn into several % groups. A good encoder does this automatically, and decoding puts the original character back exactly.

Is URL encoding case sensitive?

The percent codes themselves can be written with uppercase or lowercase hex letters, so %2F and %2f mean the same thing. Uppercase is the recommended convention. The rest of the URL follows normal URL rules, where the domain is case-insensitive but the path can be case-sensitive.

Need to clean up a link or make a value URL-safe? Paste any text or address into the free URL Encoder and Decoder. It converts both ways, handles emoji and accents, and runs entirely in your browser so nothing is uploaded.