decodeurl.com

Draft

BLOG

Draft — not indexed

What URL Encoding Actually Does

A short, practical guide to percent-encoding — why query strings break, and how to read them again.

A URL can only carry a small set of characters safely. Letters, digits, and a handful of symbols pass through untouched. Everything else — spaces, accents, ampersands, slashes inside a value — has to be percent-encoded so that a browser and a server agree on where the address ends and the data begins.

Why links break

Consider a search link:

https://example.com/search?q=paper flowers & tags=gift

The space and the & are ambiguous. A server reading that raw string cannot tell whether & tags=gift is part of your search or a second parameter. Encoding removes the guesswork:

https://example.com/search?q=paper%20flowers%20%26%20tags%3Dgift

Now every reserved character is written as a % followed by two hex digits, and the meaning is unambiguous.

The rules in one paragraph

Percent-encoding replaces a byte with % and its two-digit hexadecimal value. A space becomes %20. An ampersand becomes %26. Non-ASCII text is first turned into UTF-8 bytes, then each byte is encoded — which is why an emoji or an accented letter expands into several percent groups.

When to encode and when to decode

- Encode when you are building a URL from text: a search term, a redirect target, or anything pasted by a person. - Decode when you receive a URL and want to read it: debugging a redirect, inspecting an analytics link, or recovering the original query.

The encoder and decoder on this site do exactly this, entirely in your browser. Nothing you paste is uploaded.

← Back to the blog