URL encoder & decoder

URL encode and URL decode online: converts special characters to the percent-encoded %XX format and back, and decodes a whole link. Four modes: encodeURIComponent, encodeURI, strict RFC 3986 for OAuth and AWS signatures, and form encoding (URLSearchParams).

01Encoder02Comparison03About encoding04Questions05Related
01

Encoder & decoder

Mode
Function
Layout
Input string
Examplesa whole address is for encodeURI, the other functions are for a parameter value
Result · encodeURIComponent
Result will appear here…
Input: 0 chars · Output: 0 chars
02

What each function encodes

encodeURIComponent is more aggressive — encodes everything except safe. encodeURI preserves URL structure.
Character
encodeURIComponent
encodeURI
A–Z a–z 0–9
Not encoded
Not encoded
- _ . ! ~ * ' ( )
Not encoded
Not encoded
: / ? # @ &
%3A %2F %3F %23 %40 %26
Not encoded
= + , ;
%3D %2B %2C %3B
Not encoded
Space
%20
%20
Cyrillic А–Я а–я
%D0%9F… (UTF-8)
%D0%9F… (UTF-8)
Chinese, Arabic, emoji
%XX%XX… (UTF-8)
%XX%XX… (UTF-8)

Strict RFC 3986 and form encoding

A parameter value can be written under three rules: encodeURIComponent, strict RFC 3986 for OAuth and AWS signatures, and HTML form encoding (URLSearchParams). The codes in the table are computed by the same functions the encoder above uses.

Character
encodeURIComponent
RFC 3986
Form
space
%20
%20
+
!
!
%21
%21
'
'
%27
%27
(
(
%28
%28
)
)
%29
%29
*
*
%2A
*
~
~
~
%7E
-
-
-
-
_
_
_
_
.
.
.
.
+
%2B
%2B
%2B
/
%2F
%2F
%2F
&
%26
%26
%26
=
%3D
%3D
%3D
?
%3F
%3F
%3F
#
%23
%23
%23

The rows where the modes differ are exactly five characters ! ' ( ) * plus the space and the tilde. Everything else is the same.

03

About URL encoding

URL encoding (percent-encoding) represents any character in a URL using ASCII sequences like %XX, where XX is a UTF-8 byte in hex. Necessary because a URL can only contain a limited set of safe characters.

Choose the function by task: encodeURIComponent — for a single query parameter value. encodeURI — for a full URL when you need to preserve its syntax (colons, slashes, question marks).

Why not everyone encodes ! ' ( ) *. In RFC 3986 these five characters belong to sub-delims — they are allowed in an address, and encodeURIComponent leaves them alone. But OAuth 1.0a and AWS SigV4 signatures require “percent-encode everything except A–Z a–z 0–9 - _ . ~”: if even one of these characters stays as it is, the signature will not match and the server returns an error. That is why signatures and URL comparison need the strict mode. The tilde ~ is the opposite: in RFC 3986 it is unreserved and must not be encoded, although older libraries habitually turn it into %7E. Forms (application/x-www-form-urlencoded) use yet another set: a space becomes +, the tilde is encoded and the asterisk stays.

encodeURIComponent

most common
'hello world!' → hello%20world!
Encodes everything except letters, digits and `- _ . ! ~ * ' ( )`. Characters `: / ? # @ & =` are also encoded — so a parameter value won't break the URL structure. Use for query values ?q=… and form data.

encodeURI

for full URLs
'https://site.tld/path' → 'https://site.tld/path'
Preserves URL structure: does not encode `: / ? # [ ] @ ! $ & ' ( ) * + , ; =`. Use when you need to pass a full URL as a string without breaking its syntax.

Decoding

%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82 → 'привет'
The inverse operation — turns %XX sequences back into readable text. Also supports the `+` for space format from HTML forms (application/x-www-form-urlencoded).

Percent-encoding

RFC 3986
%XX — where XX is the hex byte in UTF-8
Each unsafe character is written as `%XX`, where XX is the hex byte in UTF-8. Cyrillic takes 2 bytes (6 %XX%XX chars per letter), emoji up to 4 bytes.
04

Frequently asked questions

Paste the text and pick the encoding you need — the tool replaces every character a URL cannot carry with a percent sequence. A space becomes `%20`, a slash `%2F`, and non-Latin letters expand to two or three pairs each, because percent encoding works on UTF-8 bytes rather than on characters.

Updated

«» added to favorites