Menu

URL Encoding Explained: Why %20 Appears in URLs (and How to Decode It)
πŸ“°
0

URL Encoding Explained: Why %20 Appears in URLs (and How to Decode It)

DEV CommunityΒ·Snappy ToolsΒ·about 1 month ago
#fmfvP5gL
Reading 0:00
15s threshold

You paste a URL into your browser and it looks like this: https://example.com/search?q=hello%20world&filter=price%3E100 Enter fullscreen mode Exit fullscreen mode What are all those %20 and %3E symbols? Why does a space become %20 ? And why does > become %3E ? This is URL encoding (also called percent-encoding), and understanding it will save you from a category of bugs that trips up developers at every experience level. Why URLs cannot contain raw special characters A URL is a string of ASCII text with strict rules about which characters are allowed. Characters like spaces, # , ? , & , = , and > all have specific meanings in URL structure. If you include them literally in a query parameter, the browser or server will misinterpret the URL. For example, this URL is ambiguous: https://example.com/search?q=cats & dogs Enter fullscreen mode Exit fullscreen mode Does the space end the URL? Is & another parameter separator? The parser cannot tell.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More