Tsallaka zuwa abun ciki
Justice Tech School

URL Encoding

URLs can only contain a limited set of characters. Others are replaced with a percent sign and two hex digits: a space becomes %20 and a slash inside a value becomes %2F.

In JavaScript, encodeURIComponent() does this for you when you build a query string.

Example
https://example.com/search?q=hello%20world&lang=en

Exercise

Which code stands for a space in a URL?

my%file.pdf

Quiz Test

What does %20 stand for?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.