URL Encoder / Decoder

Percent-encode any text to safe URL characters, or decode an encoded URL back. Component mode (encodes / ? & = + #) and full-URI mode (preserves reserved chars). Runs in your browser.

encodeURIComponent — encodes / ? & = + #
Result
Enter text above to see the result.

Runs entirely in your browser — nothing is uploaded or logged. Open DevTools → Network to verify zero requests.

How URL percent-encoding works

RFC 3986 defines which characters are allowed in a URI literally and which must be percent-encoded. Unreserved characters (A–Z, a–z, 0–9, -, _, ., ~) may appear as-is. Everything else — including spaces, non-ASCII Unicode, and reserved delimiter characters — must be encoded as %XX where XX is the uppercase hexadecimal value of the UTF-8 byte.

"Hello World" → "Hello%20World"
"café"        → "caf%C3%A9"     (é = UTF-8 bytes 0xC3 0xA9)
"price=10&qty=2" → "price%3D10%26qty%3D2"  (Component mode)

encodeURIComponent (Component mode) is the right choice when encoding a single value that will be placed inside a query string or path segment. It encodes all characters except unreserved ones — including /, ?, &, =, +, and #.

encodeURI (Full URI mode) is designed for encoding a complete URI. It intentionally preserves reserved characters like /, ?, &, =, #, and : because they carry structural meaning. Use it when you have a full URL you want to make safe without breaking its structure.

A common mistake is to use encodeURI on a query string value — the & and = separators will not be encoded and the server will misparse the value. Always use encodeURIComponent for individual values.

Frequently asked questions

What is URL encoding / percent-encoding?

URL encoding (defined in RFC 3986) is the process of representing non-ASCII and reserved characters in a URL as a percent sign followed by two hexadecimal digits (%XX), where XX is the byte value. For example, a space becomes %20 and an ampersand becomes %26. It is required for query strings, form data, and any URL component that may contain characters with special meaning.

encodeURI vs encodeURIComponent — what is the difference?

encodeURI is designed for complete URIs. It preserves reserved characters like /, ?, &, =, #, and : because they have structural meaning in a URI. encodeURIComponent is designed for individual components (query string values, path segments). It encodes everything including those reserved characters, making the output safe to embed as a value inside a URI without accidentally breaking its structure.

When should I encode the + sign?

In query strings, + is sometimes interpreted as a space due to the application/x-www-form-urlencoded convention. If your value contains a literal + sign, always encode it as %2B to ensure it is not mistakenly decoded as a space on the server side. Using encodeURIComponent handles this automatically.

Does this handle Unicode characters?

Yes. The browser's encodeURIComponent and encodeURI functions convert Unicode characters to their UTF-8 byte sequences first, then percent-encode each byte. This means emoji, CJK ideographs, Devanagari script, and other non-ASCII characters are all encoded correctly.

Powered by Pyrelo

The complete work dashboard for small teams

Developer tools, finance calculators, and business utilities — all in one flat-priced dashboard.

See Pyrelo Dashboard

More Data Tools