Skip to main content

URL Encoder & Decoder

Instantly encode and decode URLs and query parameters online. Processed securely within your browser with live parameter breakdown.

Input String
Output Result
Ready
In: 0 Out: 0

Advertisement

RFC 3986 & Query Diagnostics Percent Encoding Reference

URL Percent Encoding Explained: encodeURIComponent, Plus Signs, and Query Parsing

Uniform Resource Identifiers restrict raw transport characters strictly to safe ASCII symbols. Whenever query parameters carry nested callback URLs, email aliases with plus signs, spaces, or international scripts, unencoded delimiters split parameters in half and corrupt server routing. Mastering percent encoding means knowing the exact boundary between encoding parameter values versus full addresses, recognizing when + turns into a space, and spotting broken multi byte UTF-8 escape sequences.

1. Why This Tool Uses encodeURIComponent Instead of encodeURI

Developers frequently confuse JavaScript's two built in encoding functions. Calling encodeURI() leaves structural delimiters untouched (:, /, ?, &, =, and #) because it assumes its input is already an intact address where only stray spaces or non ASCII letters need escaping. By contrast, clicking Encode here invokes strict encodeURIComponent() so parameter payloads never hijack the outer query string.

Consider nesting an OAuth callback URL inside a login redirect parameter: if you passed https://app.example.com/auth?next=https://portal.test/?tab=2&role=admin without strict component encoding on the inner value, the server sees role=admin as a separate top level parameter rather than part of next. Because encodeURIComponent() turns : into %3A, / into %2F, ? into %3F, and & into %26, encode individual query values or fragments first rather than passing your full root URL through Encode.

Input Character / Sequence encodeURIComponent Output Why Escaping Matters
Space (U+0020) %20 Separates request path from HTTP protocol version in raw requests
& and = %26 / %3D Reserved parameter pair delimiters in query strings
+ (Literal Plus) %2B Prevents form parsers from decoding plus aliases into spaces
# (Fragment Hash) %23 Browsers strip everything after # before sending HTTP requests
% (Percent Sign) %25 Escapes literal percentages like 100% without throwing URIError
é / Arabic / Emoji (UTF-8) %C3%A9 / %F0%9F%9A%80 Multi byte UTF-8 expansion guarantees safe ASCII transport

2. Reading Multi Byte UTF-8 Escape Sequences

Notice the last row in that reference table: modern URLs do not map non English glyphs onto legacy single byte codepages. Instead, characters above ASCII 127 first serialize into UTF-8 bytes, and every individual byte receives its own %XX hexadecimal pair. A two byte Latin accent such as é becomes %C3%A9, three byte Devanagari, Cyrillic, or CJK characters expand to three triplets, and four byte emoji such as a rocket expand to %F0%9F%9A%80.

Meanwhile, RFC 3986 and ECMAScript preserve unreserved characters completely unchanged: ASCII letters (A-Z, a-z), digits (0-9), and safe marks (- _ . ! ~ * ' ( )). Wait until you examine RFC 3986 strict API signatures (such as AWS S3 Signature V4 or OAuth 1.0): some cryptographic signers require escaping ! * ' ( ) as well, which encodeURIComponent() leaves unencoded by default.

3. The Plus Sign Trap (%20 vs. +) and Query Breakdown Table

Paste any complete link containing ?utm_source=..., a relative path with a question mark, or even bare key=value&key2=value2 text into the input box. Whenever key pairs are recognized, the bottom Query Parameter Breakdown panel automatically parses your query via the browser's standard URLSearchParams parser and displays clean decoded key/value rows directly beneath the editor.

Understanding one critical difference between raw RFC 3986 URIs and HTML form encoding prevents subtle production bugs. When browsers submit classic application/x-www-form-urlencoded forms (or when URLSearchParams parses the breakdown table), any raw + inside a value decodes into a space. Conversely, clicking Decode runs pure decodeURIComponent(), which restores %20 to a space and keeps literal + signs intact. If you pass Base64 tokens or email subaddresses such as [email protected] inside a query string without escaping + to %2B, backend form parsers convert + into a space and reject the signature or address silently.

4. Hash Fragment Stripping, Path Filenames, and Long UTM Cleanup

Characters after a literal hash symbol (#) form the client side URL fragment, meaning browsers strip them before dispatching an HTTP request to your backend server. If product titles or CSS hex colors (?color=#ff5500) sneak into links unencoded, your API receives ?color= empty while the browser scrolls looking for anchor #ff5500. Encoding # to %23 ensures backend handlers actually receive the full color value.

Object storage downloads on Amazon S3 or Cloudflare R2 present another classic encoding headache: a static asset uploaded as Q4 Budget (Final).pdf cannot be fetched cleanly across markdown editors or shell scripts unless spaces and parentheses resolve cleanly to Q4%20Budget%20%28Final%29.pdf (or better yet, normalized filenames without spaces). Meanwhile, pasting bloated analytics links stuffed with %3A, %2F, and tracking redirects into Decode expands every escape immediately, while the live In and Out character counters show exact URI overhead as you inspect or export results via Save.

Advertisement

5. Double Encoding, URIError Traps, and Security Boundaries

  • Diagnosing Double Encoding (%2520): Clicking Encode twice (or encoding data that a client HTTP library already encoded) converts %20 into %2520. Use Swap paired with Decode repeatedly to peel back nested layers whenever redirects appear broken.
  • Handling Malformed URI Sequence Errors: If your input contains an unescaped percent sign such as discount=50%off or a truncated UTF-8 triplet like %E2%82 cut off mid paste, decoding throws a native URIError banner (Malformed URI Sequence. Invalid encoding detected.) instead of producing silent mojibake.
  • Encoding Is Transport Formatting, Not Security: Percent encoding provides zero confidentiality or XSS neutralization. Never place passwords, session tokens, or API keys inside URL query strings where server access logs and browser history save them in plain text, and always apply strict output encoding before rendering decoded parameters into HTML DOM sinks.

Toggle Live Mode on for instant feedback as you type, or uncheck it while pasting massive multi query campaign links so transformations only trigger when clicking Encode or Decode explicitly. All percent escaping, live updates, character counts, URLSearchParams extraction, clipboard copying, and Save file downloads run locally inside client side browser memory with zero network uploads.