URL Encoder / Decoder
Securely encode and decode URL parameters. Processing is completely contained within the browser.
πView percent-encoding specifications and notes
What is URL Encoding (Percent-Encoding)?
URLs have strict rules (RFC 3986) allowing only alphabets, numbers, and certain symbols (-, ., _, ~, etc.).
To transmit multi-byte characters like Japanese or 'reserved characters' used for URL control as URL data, they must be converted into safe strings using % and hexadecimal numbers.
'Reserved Characters' prone to causing errors
The following symbols have special meanings in URLs and must always be encoded when sent as parameter values.
- β’
?: Indicates the start of a query string (parameters). - β’
&: Serves to separate multiple parameters. - β’
=: Binds a parameter's key and value. - β’
#: Points to a specific location (fragment) within a page. - β’
/: Separates path hierarchies.
Is a space %20 or +?
A highly confusing point in practice. The encoding result for a space differs depending on the specification.
- β’
%20(RFC 3986): The standard URI specification. Recommended for URL paths and general API requests. - β’
+(application/x-www-form-urlencoded): An older specification used when making POST requests from HTML forms (<form>). Even today, some web systems or standard language functions may convert spaces to +.
Differentiating functions in JavaScript
When encoding in JavaScript, you must choose between two functions according to your needs.
- β’
encodeURI(): Used when encoding an entire URL. Reserved characters like ? and / are not converted. - β’
encodeURIComponent(): Used when encoding only the 'parameter values' of a URL. Since ? and / are also converted to % format, this is overwhelmingly used in practice.
Input (Text)
Output (Encoded String)
About Security
All processing is performed within your browser. Input data is never sent to external servers. Use with peace of mind.