How URL encoding and decoding work

You copied the link to an Arabic product page to send it, and it came out long and full of codes like %D9%85%D8%B1. The link is not broken; that is its encoded form. Understanding what happens helps when you build campaign links or put one link inside another.

Published · 2 min read

Why encode?

Links accept a limited set of English letters and symbols. Any character outside it, like a space or an Arabic letter, is written as the bytes that represent it, each byte after a % sign. An Arabic letter is two bytes in UTF-8, so it becomes six characters.

Worked example

The 5-letter word «مرحبا» becomes:

And a space in a link becomes %20.

%D9%85%D8%B1%D8%AD%D8%A8%D8%A7

A whole URL or one part of it?

This difference causes most mistakes. In “Full URL” mode, the symbols that build the link, like :, /, ? and =, stay as they are, so the link still works. In “Component” mode those symbols are encoded too, which is what you need when a whole URL goes inside a value in another URL.

Worked example

The text https://a.com/x y?q=1 in full URL mode becomes https://a.com/x%20y?q=1, and stays a working link.

The same text in component mode becomes https%3A%2F%2Fa.com%2Fx%20y%3Fq%3D1.

How to do it

  1. Open the URL encoder/decoder and paste your text.
  2. Choose encode or decode, then the mode: full URL or component.
  3. When decoding, if there is an invalid % sequence, the tool tells you where it is instead of failing silently.
  4. Copy the result.

Common mistakes

  • Double encoding: encoding text that is already encoded turns % into %25. The tool warns you but does what you asked.
  • Old links encoded in Windows-1256 show up as invalid UTF-8 and are not decoded.
  • Full URL mode does not decode codes like %2F and %3F, because decoding them could change what the link means.

For ad campaign links, the UTM campaign link builder encodes Arabic values for you. To pick a clean page link from the start, use the URL slug generator.

Common questions

Does an encoded link work?

Yes. It is the form the link actually travels in, and the browser shows it in Arabic in the address bar.

Why is an Arabic link so long?

Each Arabic letter is two bytes, and each byte is written as three characters, so one letter becomes six.

Is my link sent to a server?

No, encoding happens inside your browser.