RFC 3986 URI Percent-Encoding & Query Parameter Parsing Guide
W3C URI specification, encodeURI vs encodeURIComponent differentiation, and in-browser URL inspection.
Core RFC 3986 Encoding Specifications
- Dual Encoding Modes: Explicit selection between encodeURIComponent (query values) and encodeURI (full addresses).
- RFC 3986 & WHATWG URL Compliance: Accurate percent-encoding (%20 vs +) with complete UTF-8 multi-byte support.
- Query String Visualizer: Break down complex URL search parameters into an editable key-value inspection table.
Character Classification Under RFC 3986: Reserved vs Unreserved
The URI standard partitions ASCII into reserved characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) that delimit URL components, and unreserved characters (A-Z, a-z, 0-9, -, _, ., ~) that require no encoding. Any character outside this unreserved set—including UTF-8 multibyte characters and spaces—is converted into its byte hexadecimal representation prefixed with a percent sign (%HH).
Frequently Asked Questions (FAQ)
What is the crucial difference between encodeURI() and encodeURIComponent()?
encodeURI() is designed to encode a complete URL; it intentionally leaves protocol and path separators like :, /, ?, #, and & intact so the URL remains navigable. encodeURIComponent() encodes everything except unreserved alphanumeric characters, making it mandatory for query parameter values to prevent parameter injection.
Why are spaces sometimes encoded as %20 and other times as a plus sign (+)?
In RFC 3986 URI paths, a space must always be encoded as %20. The plus sign (+) convention originates from the legacy HTML form standard (application/x-www-form-urlencoded) used in query strings. Modern REST APIs and URL parsers treat %20 as the canonical, unambiguous space representation.
Why does decodeURIComponent() throw a URIError: URI malformed?
This exception occurs when the input contains an invalid percent sequence (such as a bare % not followed by two hexadecimal digits) or an incomplete multi-byte UTF-8 sequence. MiniToolDesk safely catches malformed sequences and indicates the parsing error without crashing.
Pin this tool to your browser side panel
Access this utility anytime with Alt+M without switching tabs. 100% offline & free.
How to encode and decode URLs
- 1Select Encode or Decode mode depending on your task.
- 2Paste your target URL, query string, or parameter string.
- 3Copy the sanitized, safely escaped URL result.
RFC 3986 URL Compliance
Characters like spaces, question marks, ampersands, and slashes must be percent-encoded to prevent breaking HTTP routing or query parsing.
Frequently Asked Questions
Enjoying URL Encoder & Decoder?Help your engineering peers discover private, ad-free tools!
MiniToolDesk is 100% free and client-side. Your support keeps the web ad-free.
Related Developer Utilities
SQL Formatter & Beautifier
Beautify, format, and indent messy SQL queries across MySQL, Postgres, SQLite in local memory
JWT Debugger & Decoder
Safely decode, verify, and inspect JSON Web Tokens (JWT) payload and headers in local memory
YAML to JSON Converter
Convert YAML to JSON and JSON to YAML bidirectionally with real-time validation
Developer & Tech Unit Converter
Convert Data Storage (KB/KiB, MB/MiB, GB/GiB), CSS units (px to rem), Length, Speed, and Temp