URL Encoder & Decoder for Code Review
Audit URL encoding in pull requests, verify encoded query strings, and catch percent-encoding bugs before they reach production — all directly in your browser.
🔧 Try the URL Encoder & Decoder — FreeWhy Use the URL Encoder & Decoder for Code Review?
Code review is the last line of defense before code reaches production, and URL handling is one of the most frequently reviewed — and most frequently broken — areas in modern web applications. Every API integration, every redirect, every dynamic link in an email template or notification involves URL construction, and every one of those URLs must be properly encoded to function correctly. When you encounter a string like https://api.example.com/search?q=hello%20world&lang=en in a pull request, your eyes see percent-encoded gibberish — not the actual query it represents. Is %20 the correct encoding for a space, or should it be +? Did the developer accidentally double-encode the ampersand as %26 when it should serve as a parameter separator? Is that base64-encoded JWT token in the URL properly URL-safe, with + replaced by - and / by _? The URL Encoder & Decoder answers all of these questions instantly: paste any URL or encoded segment and see the decoded, human-readable version, or type a plain string and get the properly percent-encoded output. It eliminates guesswork and lets you focus on what matters — whether the URL logic is correct, secure, and maintainable.
Real-World Applications in Code Review
URL encoding touches nearly every layer of a web application, and the scenarios where it matters during code review are abundant and concrete. Here are the most common situations where the URL Encoder & Decoder becomes an indispensable review companion:
- Reviewing REST API calls with encoded query parameters. When you see
fetch(`/api/users?filter=${encodeURIComponent(userInput)}`)in a pull request, you need to verify thatencodeURIComponentis the right choice — notencodeURI, which leaves characters like&,=, and#unencoded and can corrupt query string parsing. Paste a sample value through the encoder to confirm the output is valid, then decode it to verify the original input is preserved without double-encoding artifacts. If the code constructs URLs by string concatenation instead of usingURLSearchParamsor a proper URL builder, the encoder helps you trace exactly which characters would break the resulting URL. - Verifying redirect URLs in authentication and OAuth flows. OpenID Connect, OAuth 2.0, and SAML flows pass
redirect_uriparameters through multiple hops. Each hop may encode or decode the URL, and a single mismatch causes the authentication handshake to fail with a cryptic error. During code review, decode theredirect_uriat each stage to confirm the final destination is correct and that no intermediate encoding step is stripping or mangling query parameters. This is especially critical when the redirect URL itself contains query parameters that must survive the full round-trip. - Checking URL encoding in unit tests and test fixtures. Unit tests for URL-building functions often hardcode expected encoded output strings. When reviewing these tests, use the decoder to expand the expected output back to human-readable form and verify it matches the input intent. A test asserting that
buildSearchUrl("hello world")returns/search?q=hello+worldlooks correct at a glance, but decoding reveals whether the space was encoded as%20(RFC 3986) or+(application/x-www-form-urlencoded) — and whether that distinction matters for the consuming endpoint. - Auditing URL construction in templating and email code. Email templates, notification systems, and server-rendered pages often embed URLs with dynamic parameters. A pull request adding a "reset password" link like
https://app.example.com/reset?token={{ userToken }}must ensureuserTokenis URL-encoded, because JWT tokens and reset tokens frequently contain characters like.,+, and/that break URLs. Use the encoder to verify what a representative token looks like after encoding, and the decoder to confirm the recipient can extract the original token from the URL. - Reviewing URL sanitization in security audits. Security-focused code reviews must verify that user-supplied URLs are properly sanitized before being stored, displayed, or followed. When code accepts a URL from user input and renders it in an
<a href>attribute, an attacker could injectjavascript:alert(1)ordata:text/html,<script>...</script>if sanitization is missing. Paste the sanitized output through the decoder to see what the final rendered URL actually is, and verify that dangerous protocol prefixes and HTML entities are neutralized. The encoder also helps you confirm that allowlist-based sanitization (e.g., only permittinghttps://URLs) is correctly implemented.
How URL Encoding Matters in Code Quality
URL encoding is not a cosmetic detail — it is fundamental to correctness, security, and maintainability. When encoding is applied incorrectly, the consequences cascade through the entire application. A space left unencoded in a query parameter produces a syntactically invalid URL that browsers may reject or misinterpret, leading to broken links and 404 errors that frustrate users and inflate error-tracking dashboards. A forward slash (/) that should have been encoded inside a path segment instead gets interpreted as a path separator, routing the request to the wrong API endpoint and potentially exposing data from an unintended resource. An unencoded ampersand (&) in a query value prematurely terminates the parameter, silently truncating user input and causing data loss that may go undetected for weeks.
Security implications are even more severe. URL injection vulnerabilities arise when user-controlled data is interpolated into URLs without encoding, allowing attackers to inject line breaks (%0A, %0D) that enable HTTP header injection and response-splitting attacks, or null bytes (%00) that truncate strings in C-based backend parsers. Server-side request forgery (SSRF) attacks often exploit improperly encoded URLs to trick the server into making requests to internal services. Cross-site scripting (XSS) can occur when unencoded user input is placed inside href attributes, enabling javascript: protocol injection. During code review, the URL Encoder & Decoder helps you model exactly how user input flows through encoding functions and into final URLs, so you can catch these vulnerabilities before they ship. Encoding is also a maintainability concern: hardcoded pre-encoded URL strings like /search?q=hello%20world%26category%3Dbooks are nearly impossible to read and modify without introducing errors. A reviewer who can decode the string back to /search?q=hello world&category=books can reason about the logic, suggest improvements, and verify that future changes won't break the encoding chain.
How to Get Started
Using the URL Encoder & Decoder during code review takes seconds. Open the tool in a pinned browser tab alongside your pull request. When you encounter a URL or encoded segment in the diff, select it, copy it, and paste it into the decoder field. The human-readable version appears instantly, showing you exactly what the URL will look like when resolved. To verify that encoding logic is correct, type a representative input into the encoder field and compare the output against what the code under review produces. The tool runs entirely in your browser — no data is sent to any server, so you can safely paste URLs containing internal hostnames, API keys in query strings, or sensitive tokens without privacy concerns. Bookmark /tools/url-encoder/ for one-click access during every review session.
Tips for Code Reviewers
Make URL encoding review a systematic part of your workflow with these practical habits:
- Always decode before you approve. Any time a PR introduces a URL string with percent-encoded characters, paste it into the decoder to see the actual content. You'd be surprised how often a seemingly correct encoded string decodes to something unintended.
- Check the encoding function. Verify the code uses
encodeURIComponentfor query parameter values (notencodeURI) andencodeURIfor full URLs (notencodeURIComponent). Using the wrong function is a one-character bug with outsized consequences. - Watch for double-encoding. If you see
%25in a decoded URL, that's a percent sign — meaning the original string was encoded twice. Double-encoding produces URLs likehello%2520worldthat decode tohello%20worldinstead ofhello world. - Test with edge-case characters. Paste strings containing spaces, ampersands, hash signs, angle brackets, non-ASCII Unicode characters, and emoji into the encoder to see how the encoding function handles them. If the output breaks, the code under review has an encoding gap.
- Verify URL-safe base64. JWTs, CSRF tokens, and other base64-encoded values embedded in URLs must use the URL-safe variant (where
+becomes-and/becomes_). Decode the token from the URL to confirm it uses the correct alphabet.
Frequently Asked Questions
How do I check URL encoding during code review?
When reviewing a pull request that constructs URLs — whether for API calls, redirects, or hyperlinks — copy any encoded query string or path segment and paste it into the URL Encoder & Decoder. The tool decodes it instantly, showing you the human-readable version. Verify that special characters (spaces, ampersands, slashes, non-ASCII characters) are properly encoded with percent-encoding, and that no double-encoding has occurred (e.g., %2520 instead of %20).
What URL encoding mistakes should I look for during code review?
The most common mistakes are: (1) forgetting to encode spaces and special characters in query parameters, which produces malformed URLs; (2) double-encoding — applying encodeURIComponent() twice so %20 becomes %2520; (3) using the wrong encoding function (encodeURI vs encodeURIComponent) — the former preserves characters like & and = that break query strings; (4) failing to encode user-supplied input before inserting it into URLs, creating injection vulnerabilities; and (5) hardcoding pre-encoded URLs that are difficult to read and maintain.
Can this tool help with security code reviews?
Yes. The URL Encoder & Decoder is invaluable for security-focused code reviews. Paste encoded payloads to decode them and verify whether malicious input is properly neutralized. Check that user-controlled data inserted into href attributes, fetch() calls, or redirect targets is consistently encoded so attackers cannot inject line breaks, null bytes, or protocol-switching characters (like javascript:). The tool also helps you verify that URL sanitization functions strip or encode dangerous characters correctly.
How do I verify encoded URLs in pull requests?
Keep the URL Encoder & Decoder open in a pinned browser tab next to your pull request. When you spot URL construction code — template literals with query parameters, redirect URLs in middleware, or links in email templates — select and copy the encoded segments, paste them into the decoder, and confirm the decoded output is exactly what you expect. Switch to the encoder to verify that if you were to construct the same URL from scratch, the encoding matches what the code produces.