What Is Percent-Encoding?
Percent-encoding represents characters that are awkward inside URLs as a % followed by two hexadecimal digits. The sequence %48%65%6C%6C%6F decodes to "Hello". Servers, analytics dashboards, and browser address bars all rely on this scheme to move arbitrary text through URL-shaped channels.
URL Decoder reverses that process using JavaScript's decodeURIComponent, turning encoded fragments back into the original readable string.
Reading Encoded Query Strings
A typical analytics or redirect URL might look like:
https://example.com/search?q=open%20source%20tools&ref=newsletter%2324
To read just the search term, copy open%20source%20tools into the decoder. The output open source tools confirms what the user typed. Similarly, newsletter%2324 decodes to newsletter#24.
Diagnosing Malformed Encodings
Decoding fails when the byte sequence is invalid. Common causes in real-world data:
- Truncated copy-paste — A log line cut mid-sequence leaves
%2without the final digit. - Manual encoding mistakes — Someone replaced spaces with
%alone instead of%20. - Mixed encoding layers — A value encoded twice shows
%2520for a space; one decode pass yields%20, a second yields a space.
When the tool reports an error, search the input for % characters and verify each is followed by two valid hex digits (0-9, A-F, a-f).
Plus Signs vs. Percent Spaces
HTML form submissions often represent spaces as + in query strings. decodeURIComponent does not treat + as space — that behavior belongs to application/x-www-form-urlencoded parsers. If your input uses plus notation, replace + with %20 before decoding, or decode form-style strings with the appropriate function in your codebase.
Decoding in a Debugging Workflow
When investigating broken redirects or garbled API parameters, alternate between URL Encoder and URL Decoder. Encode the expected plain text, compare it to what arrived on the wire, and note where they diverge. Mismatches often reveal middleware that re-encoded values, wrong charset assumptions, or manual string concatenation that skipped encoding on one branch.