Skip to main content

URL Encoder / Decoder

Percent-encode or decode URL components per RFC 3986.

Your data never leaves your browser

About URL Encoding

URL encoding (percent-encoding) replaces unsafe characters in URIs with a percent sign followed by two hexadecimal digits representing the byte value. RFC 3986 defines the set of unreserved characters (A-Z, a-z, 0-9, -, ., _, ~) that never need encoding. All other characters, including spaces, ampersands, and non-ASCII text, must be encoded when used in URI components.

Non-ASCII characters like accented letters or CJK ideographs are first encoded as UTF-8 bytes, then each byte is percent-encoded individually. For example, the e-acute character (U+00E9) becomes %C3%A9 because its UTF-8 representation is the two bytes 0xC3 and 0xA9. This is why a single character can produce multiple percent-encoded triplets.

This tool offers two modes: component mode (for encoding individual query parameters or path segments) and full-URL mode (which preserves the structural characters :, /, ?, #, and &). All processing runs client-side using the built-in encodeURIComponent and decodeURIComponent functions.

Frequently Asked Questions

What is URL encoding (percent-encoding)?

URL encoding, also called percent-encoding, replaces characters that are not allowed or have special meaning in a URI with a percent sign (%) followed by two hexadecimal digits representing the character's byte value. RFC 3986 defines the unreserved characters (A-Z, a-z, 0-9, -, ., _, ~) that never need encoding. Everything else, including spaces, ampersands, and non-ASCII text, must be encoded when used inside URI components.

Which characters need to be encoded in URLs?

Any character outside the unreserved set (letters, digits, -, ., _, ~) must be percent-encoded when it appears inside a URI component such as a query parameter or path segment. Common examples include space (%20), ampersand (%26), equals (%3D), plus (%2B), and forward slash (%2F). The reserved characters (:, /, ?, #, &, =) have structural meaning in a full URL and are only encoded when used as literal data within a component.

What is the difference between component and full URL encoding?

Component encoding (encodeURIComponent) treats the input as a single URI component and encodes every character that is not unreserved, including structural delimiters like /, ?, and &. Full URL encoding preserves those structural characters so the URL remains navigable while still encoding unsafe characters within each segment. Use component mode for individual query values or path segments, and full URL mode when encoding an entire URL that should keep its structure intact.

How are non-ASCII characters encoded in URLs?

Non-ASCII characters are first converted to their UTF-8 byte representation, then each byte is individually percent-encoded. For example, the accented letter e (U+00E9) encodes to %C3%A9 because its UTF-8 form is the two bytes 0xC3 and 0xA9. A single Chinese, Japanese, or Korean character can produce three percent-encoded triplets because CJK characters typically require three UTF-8 bytes.

Why do spaces sometimes appear as + and sometimes as %20?

The plus sign (+) as a space encoding comes from the application/x-www-form-urlencoded format used by HTML form submissions. This is a legacy convention from early web standards. RFC 3986 percent-encoding always uses %20 for spaces. In practice, + is only valid as a space in query strings of form data. The encodeURIComponent function used by this tool always produces %20, which is universally accepted.