HTML BlogCode Manual & Tools
HomeTools › URL Encoder / Decoder

URL Encoder & Decoder Online

Encode special characters for URLs or decode percent-encoded strings. Runs entirely in your browser.

Method:
Input (text to encode) 0 characters
Copied!
Output (encoded result) 0 characters

Common URL-Encoded Characters

Character Encoded Description
(space)%20Space character
!%21Exclamation mark
#%23Hash / fragment identifier
$%24Dollar sign
&%26Ampersand / query separator
'%27Apostrophe / single quote
(%28Opening parenthesis
)%29Closing parenthesis
+%2BPlus sign
,%2CComma
/%2FForward slash / path separator
:%3AColon
;%3BSemicolon
=%3DEquals sign
?%3FQuestion mark / query start
@%40At sign
[%5BOpening bracket
]%5DClosing bracket
%%25Percent sign

How to Use the URL Encoder/Decoder

1
Choose a mode. Click Encode to convert plain text into a URL-safe string, or Decode to convert a percent-encoded string back to readable text.
2
Select the encoding method. Use encodeURIComponent (default) for encoding individual query parameters or values. Use encodeURI when you want to encode a full URL while preserving structural characters like :, /, ?, and #.
3
Type or paste your text. The result appears instantly in the output field as you type -- no button click required.
4
Copy the result. Click Copy Output to place the result on your clipboard. Use the Swap button to move the output into the input and switch modes, which is handy for round-trip testing.

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism defined in RFC 3986 for representing characters in a Uniform Resource Identifier (URI) that are not allowed or have special meaning. It replaces unsafe characters with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII or UTF-8 byte value.

For example, a space character is encoded as %20, and an ampersand (&) is encoded as %26. This ensures that URLs remain valid and unambiguous when transmitted over the Internet, since characters like &, =, and ? have special structural meaning in a URL.

When Do You Need URL Encoding?

encodeURIComponent vs encodeURI

encodeURIComponent() encodes nearly all special characters, including :, /, ?, #, &, and =. It is designed for encoding a single URI component such as a query parameter value.

encodeURI() encodes only characters that are not valid in a complete URI. It preserves structural delimiters like ://, /, ?, #, and &, making it suitable for encoding an entire URL while keeping its structure intact.

URL Encoding vs HTML Encoding

Although both URL encoding and HTML encoding convert special characters into safe representations, they serve different purposes and use different syntax:

Feature URL Encoding HTML Encoding
Purpose Make characters safe for use in URLs Make characters safe for display in HTML
Syntax % + hex value (e.g., %26) & + entity name or number (e.g., &)
Space %20 or + No special encoding needed
Ampersand %26 &
Used in URLs, query strings, API requests HTML documents, web page content
Standard RFC 3986 HTML specification (W3C)

In practice, you use URL encoding when building or parsing URLs, and HTML encoding when inserting dynamic text into an HTML page to prevent XSS attacks and rendering issues.

Common URL-Encoded Characters

The table below lists frequently encoded characters, their percent-encoded equivalents, and their typical role in URLs. Bookmark this page as a quick reference when working with URLs.

Character Encoded Role in URLs
(space)%20Separates words; not allowed in URLs
%%25Marks the start of a percent-encoded sequence
&%26Separates query parameters (?a=1&b=2)
=%3DSeparates key from value in query params
?%3FStarts the query string
#%23Fragment identifier (anchor link)
/%2FPath separator
:%3AScheme separator (https:), port
@%40User info separator (user@host)
+%2BSometimes represents a space in form data
"%22Double quote
<%3CLess than sign
>%3EGreater than sign
{%7BOpening brace
}%7DClosing brace
|%7CPipe / vertical bar

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a complete URI and preserves characters that have structural meaning in URLs, such as :, /, ?, #, and &. Use it when you have a full URL and want to make it safe without breaking its structure.

encodeURIComponent() encodes everything except letters, digits, and a handful of unreserved characters (- _ . ! ~ * ' ( )). Use it when encoding a single value that will be embedded inside a URL, such as a query parameter value or a path segment.
Is my data sent to a server?
No. All encoding and decoding is performed entirely in your browser using JavaScript's built-in encodeURIComponent(), decodeURIComponent(), encodeURI(), and decodeURI() functions. No data is transmitted to any server. You can verify this by disconnecting from the Internet and using the tool offline.
Why do spaces sometimes appear as %20 and sometimes as +?
In the application/x-www-form-urlencoded format (used by HTML form submissions), spaces are encoded as +. In standard percent-encoding defined by RFC 3986, spaces are encoded as %20. JavaScript's encodeURIComponent() always uses %20. This tool uses the standard RFC 3986 percent-encoding, so spaces are always represented as %20.
Can I encode non-ASCII characters like emoji or accented letters?
Yes. JavaScript's encoding functions handle UTF-8 natively. Non-ASCII characters are first converted to their UTF-8 byte sequences, and each byte is then percent-encoded. For example, the emoji 😊 becomes %F0%9F%98%8A, and the letter é becomes %C3%A9. This tool fully supports encoding and decoding of any Unicode text.
How do I encode an entire URL with query parameters?
If you want to encode a full URL while preserving its structure (scheme, host, path, query delimiters), select the encodeURI (full URL) option. This will encode unsafe characters but leave structural characters like ://, /, ?, =, and & intact.

If you need to pass one URL as a parameter value inside another URL, use encodeURIComponent instead, which will encode all special characters including /, ?, and &.