URL Encode / Decode

INTERNET · RFC 3986 PERCENT-ENCODING

Encode or decode URL query strings and special characters locally

Calculated on this device
Enter text up to 10000 characters to encode or decode.

RFC 3986 ENCODEURICOMPONENT (%20 FOR SPACE)

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dcoffee%20%26%20tea
41 input chars → 59 output chars
Input length41 charsMax 10,000
Output length59 charsUTF-8 percent-encoded

HOW IT WORKS

RFC 3986 percent-encoding and form encoding

URLs may only contain a small set of unreserved ASCII characters directly. Reserved delimiters (&, =, ?, /) and non-ASCII UTF-8 characters must be percent-encoded as %XX hexadecimal bytes.

01

encodeURIComponent (%20 for spaces)

Encodes every reserved character and UTF-8 byte sequence so a value can be safely placed inside a URL query parameter.

02

Form-URL-Encoded (+ for spaces)

HTML forms using application/x-www-form-urlencoded represent spaces as + instead of %20. Toggle the checkbox to match form behavior.

03

Safe Decoding

Uses decodeURIComponent and catches malformed % sequences with a clear inline error.

WEB DEVELOPER GUIDE

encodeURI vs. encodeURIComponent

Why query values use encodeURIComponent

encodeURI() leaves &, =, and ? unencoded because it assumes you are encoding a full URL. When encoding a parameter value (such as a redirect URL or search phrase), always use encodeURIComponent(). For binary-to-text payloads, see our Base64 Encode / Decode tool.

Frequently asked questions

When should I use %20 vs. + for spaces?

Use %20 in URL paths and standard RFC 3986 URIs. Use + only for application/x-www-form-urlencoded query strings.

Why do non-English characters turn into multiple %XX codes?

Non-ASCII characters are first converted to multi-byte UTF-8, and each byte is encoded as a %XX hex pair (for example, é becomes %C3%A9).

What causes a URIError when decoding?

A stray % sign not followed by two valid hexadecimal digits, or an incomplete UTF-8 byte sequence, causes decodeURIComponent to reject the input.

Is my URL data sent anywhere?

No. All encoding and decoding runs locally in your browser.

Your inputs are processed locally in this browser and are never sent to a server or ad network.