How does encodeURIComponent vs encodeURI change URL encoding?
Choosing A value (encode everything) invokes encodeURIComponent(), which escapes structural delimiters like /, ?, &, and = so user data cannot alter query boundaries. Choosing A whole URL (keep / ? & =) invokes encodeURI() line by line, escaping spaces and UTF-8 text while keeping the address valid.
| Character or string | A value (encodeURIComponent) |
A whole URL (encodeURI) |
RFC 3986 role |
|---|---|---|---|
A-Z a-z 0-9 - _ . |
Left unescaped | Left unescaped | Unreserved characters |
! ~ * ' ( ) |
Left unescaped | Left unescaped | JavaScript unescaped set |
Space ( ) |
%20 |
%20 |
Unsafe delimiter |
/ ? & = # : |
%2F %3F %26 %3D %23 %3A |
Left unescaped | Reserved URI delimiters |
é (UTF-8 0xC3 0xA9) |
%C3%A9 |
%C3%A9 |
Multi-byte UTF-8 sequence |
Escaping query values with A value mode
Under IETF RFC 3986 URI Generic Syntax, reserved characters act as structural separators between scheme, host, path, and query parameters. If you embed a raw callback URL or an ampersand inside a query value without escaping it, the receiving server splits your parameter in half at & or =.
A value mode is built for individual parameter values, search terms, and nested redirect targets. If you need to pass binary hashes or structured tokens inside a URL without percent-bloat, you can also encode binary payloads with URL-safe Base64 to keep tokens compact.
Preserving structure with A whole URL mode
When you have a complete link copied from a browser bar or CMS that contains spaces or non-ASCII characters in its path, A value mode would break https:// into https%3A%2F%2F. Switching What to encode to A whole URL processes each line with encodeURI(), leaving colons, slashes, question marks, and ampersands untouched.
Always inspect whether your input already contains %20 or %26 before running an encoder. Re-encoding an already escaped URL turns every % into %25, producing broken %2520 sequences that servers reject.
Handling plus signs as spaces and malformed percent sequences
In Decode mode, the tool reverses %XX escapes back into UTF-8 text and handles both standard %20 spaces and form-style + spaces. When a copied log line is cut off mid-escape, a fault-tolerant fallback decodes every valid segment instead of throwing a fatal URIError.
Tip: Click Swap (
⇄) after encoding or decoding to move the output straight into the input box and flip modes, which makes catching double-encoded%25strings immediate.
When to enable Treat + as a space during decoding
Query strings generated by HTML forms and URLSearchParams follow application/x-www-form-urlencoded, where spaces become + instead of %20. Leaving Treat + as a space checked converts every + back into a space before decoding %XX octets.
Uncheck Treat + as a space when decoding URL paths, email addresses with + tags (alice+work), or mathematical expressions where + is literal. Note that MDN encodeURIComponent JavaScript Reference always emits %20 for spaces and %2B for literal plus signs.
Recovering readable text from truncated %XX sequences
Standard decodeURIComponent() throws a URIError: URI malformed if even one % in a 10,000-character log is truncated or followed by non-hex characters. When that happens, this decoder falls back to scanning contiguous %XX tokens and validating 2-byte (0xC2+), 3-byte (0xE0+), and 4-byte (0xF0+) UTF-8 sequences.
Valid runs decode cleanly, while broken % tokens stay visible in the output alongside a yellow warning banner explaining that some % signs lack two hex digits. That same token-inspection pattern helps when debugging Base64URL JWT header and claim payloads extracted from query strings.
Inspecting URL parts and decoded query string parameters
Whenever you paste a complete http:// or https:// address into either box, the URL parts card appears automatically below the editor. It breaks the address into structured components and lists every query key-value pair in a searchable table.
Breaking down protocol, host, path, and fragment fields
The inspector parses your input with the browser’s native URL constructor and URLSearchParams interface documented in the MDN URLSearchParams API Reference. It extracts Protocol, User (if present), Host, Port, Path, and Fragment, automatically decoding percent-escaped path and fragment text for readability.
If you are in Decode mode and paste a fully percent-escaped URL such as https%3A%2F%2Fexample.com..., the inspector falls back to parsing the decoded string. This lets you inspect nested redirect URLs without copying them into a second tab.
Auditing OAuth callback parameters and redirect URIs
Below URL parts, the Query parameters table lists each decoded Name and Value (decoded) pair via url.searchParams.entries(). Each row includes a dedicated Copy button so you can grab an individual code, state, redirect_uri, or UTM parameter cleanly.
Checking decoded query parameters before sharing marketing or deep links prevents broken redirects and leaked tracking IDs. Once a campaign link is verified, you can turn encoded campaign URLs into scannable QR codes for print or mobile distribution.
Why keep OAuth tokens and private URLs inside your browser?
Developer URLs routinely carry sensitive bearer tokens, password-reset secrets, signed cloud storage signatures, and internal staging hostnames. Pasting them into server-backed online utilities exposes those credentials to third-party access logs and analytics pipelines, whereas client-side execution keeps everything in local memory.
- Zero network transmission: Every call to
encodeURIComponent,encodeURI, andnew URL()executes locally in browser memory with nothing sent over the network. - Responsive large-payload handling: Inputs larger than
65,536characters (64 KB) automatically offload to a dedicated Web Worker with a120 msdebounce so the interface stays responsive on huge query dumps. - Local file import and export: You can Download outputs as
encoded.txtordecoded.txtdirectly from memory without temporary server storage. - Clean downstream inspection: When an encoded query parameter contains serialized configuration data, copy the decoded value from the table and validate JSON payloads extracted from query parameters locally.