What are you encoding?

What is URL encoding?

URL encoding, also called percent-encoding, converts characters that are not allowed or have a special meaning in a web address into a safe form: a % sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and so on. Decoding reverses the process and turns the codes back into readable text.

Encoding matters because characters such as &, ?, = and # have a job inside a URL: they separate the address, the query parameters and the page section. If your data contains them, it has to be encoded, or the link will break or be read wrongly.

Which mode should I use?

Text, or one part of a URL (the default)

Use this when you are encoding a value that goes inside a link, such as a search term, a WhatsApp message or a UTM tag. It encodes every character that could cause trouble, including &, =, ? and /. For example:

chai & samosa = ₹20?
becomes
chai%20%26%20samosa%20%3D%20%E2%82%B920%3F

A complete URL

Use this when you have a whole web address that contains spaces or non-English characters, and you want to keep it working as a link. The characters that give a URL its structure are left alone:

https://example.com/search?q=chai samosa&city=Bengaluru
becomes
https://example.com/search?q=chai%20samosa&city=Bengaluru

A common mistake: encoding a full URL in the first mode turns it into https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dchai%20samosa%26city%3DBengaluru, which is no longer a working link. Encode only the parts you are inserting, or use the "complete URL" mode.

(In technical terms, the first mode uses JavaScript's encodeURIComponent and the second uses encodeURI.)

Common characters and their codes

Character Encoded as
Space%20
New line%0A
" (double quote)%22
# (hash)%23
% (percent)%25
& (ampersand)%26
+ (plus)%2B
, (comma)%2C
/ (slash)%2F
: (colon)%3A
; (semicolon)%3B
= (equals)%3D
? (question mark)%3F
@ (at sign)%40

Letters, digits and the characters - _ . ! ~ * ' ( ) are never encoded in the default mode.

Hindi, other Indian languages and emoji

Characters outside basic English are first converted to their UTF-8 bytes, and each byte becomes a % code. That is why one Hindi or emoji character turns into several codes:

Decoding turns them back into the original text. Browsers often display such links in readable form in the address bar, but the encoded form is what is actually sent.

%20 or +: which means a space?

Both can. %20 is the standard code for a space anywhere in a URL. When a web form is submitted, browsers often write spaces in the query part as + instead. If you are decoding form data and see + signs between words, tick "treat + as a space" before decoding. Otherwise, leave it unticked, because a real plus sign in the data should stay a plus.

Why does decoding fail?

Decoding fails when the text contains a % that is not followed by a valid code. Common causes:

The tool shows a message instead of a wrong result. Check that you copied the whole link.

Where URL encoding is used

Frequently asked questions

Is URL encoding the same as encryption?

No. Encoding only changes how characters are written so they can travel safely in a URL. Anyone can decode it, so it gives no privacy or security. Never rely on it to hide passwords or personal data.

Does encoding change my data?

No. Decoding gives back exactly the original text. Only the way it is written changes.

Is my text sent to your server?

No. Encoding and decoding happen entirely in your browser using standard JavaScript functions, and nothing you type is uploaded. See our privacy policy.

Why do I see %2520 in a link?

The text was encoded twice: the % of %20 was itself encoded as %25. Decode it twice to get the original. When building links, encode each value only once.