URL Encoder, Decoder & Query Parameter Parser

Percent-encode query values safely and break apart long tracking or API URLs into structured parameter rows.

100% Client-Side Execution
Input URL or Text
Encoded / Decoded Output

encodeURIComponent() vs encodeURI(): Which Should You Use?

Choosing the wrong JavaScript encoding method is a common source of broken API calls:

  • Use encodeURIComponent() (Encode Component) when encoding a single query parameter value (like a redirect URL, search text, or email containing &, =, or ?). It escapes reserved characters so they do not break the outer query string.
  • Use encodeURI() (Encode Full URL) when encoding an entire URL that contains spaces or Unicode characters, while preserving https://, /, ?, and &.

How the Query Parameter Parser Helps Debug Webhooks & UTM Links

Marketing attribution links, OAuth callback URLs, and REST search queries frequently stack six or more parameters onto one long line. Whenever you paste a full http:// or https:// URL into the left box and run any action, TechCar DevTools automatically parses the URL with the browser's URL API and displays a structured table of the protocol, host, path, hash fragment, and every decoded query key-value pair.

Frequently Asked Questions

Why do some URLs show %20 for spaces while others show +?

Standard RFC 3986 path encoding represents spaces as %20, while HTML form submissions (application/x-www-form-urlencoded) use +. TechCar DevTools's decoder handles both formats cleanly.

What happens if I encode a URL twice?

Double-encoding turns %20 into %2520 (because % itself becomes %25). If your server fails to read a parameter, decode it once here to spot accidental double-encoding.

Should I use Encode Component or Encode Full URL for a redirect parameter?

Always use Encode Component (encodeURIComponent) for a parameter value like redirect_uri=. Using encodeURI leaves ?, &, and = unencoded, which splits the outer query string.

Why does the Query Parser table ignore everything after #?

The hash fragment (#section) is processed strictly inside the browser and shown separately in the Hash row above—web servers never receive hash fragments over HTTP.

Why do phone numbers like +919876543210 lose their + sign in URLs?

In query strings, an unencoded + is decoded by servers as a space character. Always encode literal plus signs as %2B when passing phone numbers or email subaddresses (user+tag@example.com).

Common Reserved Characters Reference

CharacterEncoded FormWhy It Matters
Space%20 / +Spaces break URLs in plain text emails and terminals.
&%26Separates query parameters; unencoded & splits values.
=%3DSeparates parameter keys from values.
?%3FMarks the start of the query string.
/%2FPath separator; must be encoded inside nested redirect URLs.
+%2BDecoded as space unless percent-encoded.

For a full breakdown of RFC 3986 percent-encoding rules, Python/PHP/cURL examples, and open-redirect security checks, read URL Encoding Explained: Percent-Encoding and Query Parsing.

Anatomy of a URL: Which Parts Need Encoding?

A standard web address has five distinct segments: scheme://host:port/path?query#fragment. Hostnames use Punycode for international domains and never require percent-encoding. Paths use RFC 3986 percent-encoding (where spaces become %20), while query string parameter values frequently follow application/x-www-form-urlencoded rules (where spaces become + or %20). Crucially, anything after the # hash fragment stays strictly inside the user's browser and is never sent to your backend server in HTTP requests—so if a parameter value genuinely contains a literal #, you must encode it as %23.

Modern Query Manipulation in JavaScript (URL & URLSearchParams)

Building URLs by concatenating strings with ? and & often introduces subtle bugs like missing question marks, trailing ampersands, or unencoded callback URLs. Using native Web APIs handles every edge case cleanly:

const apiUrl = new URL("https://api.techcar.online/v2/search");
apiUrl.searchParams.set("q", "json & csv + regex");
apiUrl.searchParams.set("next", "https://techcar.online/tools/");
// Result: https://api.techcar.online/v2/search?q=json+%26+csv+%2B+regex&next=https%3A%2F%2Ftechcar.online%2Ftools%2F

Debugging Broken Webhooks, OAuth Redirects & UTM Tracking

  1. Truncated redirect_uri Parameters: Passing an unencoded callback URL containing ? and & causes the outer URL parser to steal everything after the first ampersand. Always wrap nested URLs with Encode Component first.
  2. Accidental Double-Encoding (%2520): Seeing %25 anywhere in a URL confirms that an already-encoded string passed through an encoder a second time. Decode once above to spot the exact culprit.
  3. Security Validation on Servers: Never redirect users based purely on substring checks like next.startsWith("/")—an attacker can pass //evil.example and trigger an open redirect. Parse the destination with new URL(next, expectedOrigin) and assert parsed.origin === expectedOrigin.

Step-by-Step: How to Encode, Decode & Inspect URLs

  1. Paste Any Raw String or Full URL: Drop a full tracking URL, an OAuth authorization redirect, or a raw search query containing spaces and ampersands into the left input box.
  2. Choose the Right Encoding Mode: Click Encode Component (encodeURIComponent) when preparing an individual query value (like a redirect URL or search phrase), click Encode Full URL (encodeURI) when fixing spaces in a complete URL without breaking slashes or colons, or click Decode URL to turn cryptic %20, %2F, and + sequences back into human-readable text.
  3. Audit Every Query Parameter Visually: Whenever the input begins with a valid http:// or https:// scheme, TechCar DevTools automatically renders a structured breakdown table underneath showing the protocol, host, pathname, hash fragment, and every individual query key-value pair cleanly decoded.

Why Percent-Encoding Matters Across APIs, OAuth & SEO

In real-world web engineering, unencoded or double-encoded URLs are responsible for an astonishing share of silent integration failures. Consider an OAuth 2.0 login flow passing a nested callback URL inside redirect_uri: if even one query parameter inside the callback isn't percent-encoded, the identity provider slices the URL in half at the first unencoded & and rejects the login with redirect_uri_mismatch. Similarly, passing raw UTF-8 characters (such as Hindi, Arabic, or accented names) or plus signs inside phone numbers without proper encoding causes backend servers to corrupt parameters or throw URIError exceptions.

Clean URL structure also protects analytics accuracy and SEO health: marketing UTM links containing unencoded ampersands split campaign names inside Google Analytics, while inconsistent query ordering creates duplicate crawl paths unless paired with strict <link rel="canonical"> tags. Remember also that all encoding, decoding, and URL parsing on this page runs 100% locally inside your browser—making it safe to inspect signed presigned URLs, webhook callbacks, and private API parameters without exposing tokens to third-party logs. Need to decode Base64URL tokens or inspect JSON API responses next? Jump straight to our Base64 Encoder & Decoder, JWT Decoder, or JSON Formatter.

Understanding encodeURI, encodeURIComponent & RFC 3986 Edge Cases

Many developers assume JavaScript's encodeURIComponent() encodes every punctuation symbol cleanly, yet RFC 2396 legacy behavior leaves five characters untouched: !, ', (, ), and *. For everyday REST queries and browser navigation, that makes zero difference—but when computing strict HMAC signatures for OAuth 1.0 or cloud storage presigned requests, those five characters must also be percent-encoded manually to avoid signature mismatch errors. Similarly, remember that backend servers using Python's urllib.parse.quote(val, safe="") encode forward slashes by default, whereas quote(val) preserves slashes unless safe="" is passed.

Practical URL Hygiene Checklist for Modern Web Apps

Keep URLs clean, predictable, and secure across your entire stack with three habits: construct every parameterized URL using new URL() and URLSearchParams instead of manual string templates; validate decoded path segments after URL decoding on backend servers so encoded %2e%2e%2f sequences cannot bypass path traversal guards; and never pass sensitive Bearer JWTs or API secrets inside query strings, because query strings persist in browser history, proxy logs, and HTTP Referer headers.

Testing Internationalized URLs, Webhook Signatures & Reverse Proxies

Across modern reverse proxies such as Nginx, Cloudflare, and API Gateways, subtle URL normalization differences frequently trigger confusing production bugs. Some gateways normalize encoded slashes (%2F) back into path separators before forwarding requests, whereas others preserve raw percent-encoding—causing downstream route matchers or HMAC request signature checks to compute a completely different canonical string. Similarly, copy-pasting marketing links or webhook URLs from chat apps often corrupts trailing UTF-8 query values when international characters remain unencoded.

Using this client-side parser before shipping integration code lets you verify exact canonical encoding across every parameter row without risking leakage of signed cloud storage URLs, temporary tokens, or internal API endpoints to third-party logs. Checking trailing encoded slashes, percent-encoded email plus signs, and nested OAuth redirect parameters upfront prevents frustrating callback mismatches across Safari, Chrome, mobile WebViews, and server-side HTTP clients alike. When troubleshooting search filters or multi-value array parameters such as repeated tag= keys, inspect every decoded row carefully to verify ordering and whitespace handling before deployment. You can also test Unicode slugs containing Hindi, Arabic, or Japanese characters cleanly because JavaScript encodes UTF-8 byte sequences automatically without losing multi-byte surrogate pairs. Pair this workflow with all seven local TechCar DevTools utilities whenever you need to convert nested JSON exports, inspect decoded JWT claims, or validate regular expressions on extracted parameters.