Free URL Encoder & Decoder Tool (RFC 3986)

Online URL Encoder & Decoder: RFC 3986 Percent-Encoding

URL percent-encoding is a standardized mechanism for encoding arbitrary data inside Uniform Resource Identifiers (URIs) by converting reserved protocol delimiters, non-ASCII characters, and spaces into hexadecimal byte sequences prefixed with a percent sign (%).

Uniform Resource Identifiers are restricted to a narrow set of characters defined by the IETF RFC 3986 specification. When URLs transmit search queries, user data, or API parameters containing special symbols (such as &, =, ?, or spaces), unencoded characters break routing logic by creating false parameter boundaries. The Urban Mixo URL Converter encodes and decodes query strings and URI components in real time directly within your browser.

URI Reserved Delimiters & Percent-Encoded Values Table

Use this reference table to map common reserved characters to their standardized RFC 3986 percent-encoded hexadecimal values:

Literal Character Percent-Encoded Syntactic Role in URIs Encoding Necessity
Space ( ) %20 (or +) Illegal in raw URIs Must always be encoded
Ampersand (&) %26 Separates query parameters Must be encoded inside values
Equals Sign (=) %3D Assigns parameter key to value Must be encoded inside values
Question Mark (?) %3F Initiates query string Must be encoded inside values
Slash (/) %2F Separates path segments Must be encoded inside query data

Reserved vs. Unreserved URI Characters

RFC 3986 divides all ASCII characters into two clear classifications:

  • Unreserved Characters: Standard letters (A-Z, a-z), decimal digits (0-9), and four safe symbols: hyphen (-), underscore (_), period (.), and tilde (~). These characters have no structural role and are never transformed during percent-encoding.
  • Reserved Characters: Delimiters that define URI architecture: :, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, and =. When user data contains these characters (e.g., searching for "Tom & Jerry"), the ampersand must be encoded as %26 to avoid creating an unintended extra parameter.

How to Encode & Decode URLs in Code

If you need to automate percent-encoding in your backend services, API endpoints, or web scrapers, use these standard native implementations:

1. JavaScript (Browser & Node.js)

// Encoding query parameter values
const rawValue = "Tom & Jerry / 100% Valid";
const encodedValue = encodeURIComponent(rawValue);
console.log(encodedValue);
// Output: "Tom%20%26%20Jerry%20%2F%20100%25%20Valid"

// Decoding back to raw string
const decodedValue = decodeURIComponent(encodedValue);

2. Python 3

import urllib.parse
Percent-encoding a parameter string (RFC 3986)

param = "Tom & Jerry"
encoded_param = urllib.parse.quote(param)
print(encoded_param) # Output: "Tom%20%26%20Jerry"
Decoding back to plain text

decoded_param = urllib.parse.unquote(encoded_param)

3. PHP

<?php
// Standard RFC 3986 encoding (spaces become %20)
$query = "Tom & Jerry";
$encoded = rawurlencode($query);
echo $encoded; // Output: "Tom%20%26%20Jerry"

// Decoding back to raw string

        
decoded=rawurldecode(
decoded=rawurldecode(

      

encoded);
?>

Frequently Asked Questions

What is the difference between encodeURI() and encodeURIComponent()?

In JavaScript, encodeURI() is designed for full URLs; it preserves protocol markers, slashes, and question marks (such as https:// and /). encodeURIComponent() is designed for individual query parameter values; it encodes all reserved delimiters (including /, ?, and &) so parameter values do not break routing.

Why are spaces encoded as %20 in URLs, but sometimes as a plus sign (+)?

Standard RFC 3986 URI encoding strictly represents spaces as %20. The plus sign (+) is a legacy encoding convention defined by the HTML form submission standard (application/x-www-form-urlencoded). In query parameters, most servers accept both, but %20 is the unambiguous universal standard.

What causes the "Double-Encoding" bug?

Double-encoding occurs when an already-encoded string is passed through a percent-encoder a second time. The encoder encounters existing percent signs and converts them to %25, transforming %20 into %2520. Decoding once leaves %20 as literal text rather than restoring the space.

Is my URL string logged or sent to a server?

No. All percent-encoding and decoding logic executes 100% locally inside your browser's runtime memory using client-side JavaScript. Your URL parameters, queries, and tokens are never transmitted over a network connection, saved in cookies, or stored on our servers.


Related Web Standards & Encoding Tools