URL Encoder / Decoder

About the URL Encoder / Decoder

URL encoding (percent-encoding) replaces characters that aren't allowed in a URL — spaces, ampersands, slashes, non-ASCII characters, and more — with a % followed by their hex code, so the URL remains valid and unambiguous.

This is essential any time you're building a query string, a redirect URL, or an API request by hand and need to make sure special characters in a value (like a search term with spaces, or an email address) don't break the URL structure.

How it works

Common use cases

Frequently asked questions

What's the difference between encodeURIComponent and encodeURI?

encodeURIComponent (what this tool uses for encoding) escapes nearly every special character, making it correct for encoding individual query parameter values. encodeURI is meant for encoding a whole URL and leaves characters like `/`, `:`, and `?` untouched since they're structurally meaningful there.

Why do spaces sometimes become + and sometimes %20?

%20 is the standard percent-encoding for a space. The + shorthand for space is specific to the `application/x-www-form-urlencoded` format used in HTML form submissions and query strings — not a general URL-encoding rule.

Do I need to encode an entire URL, or just parts of it?

Usually just the dynamic parts — like a user-entered value going into a query parameter — not the whole URL, since encoding structural characters like `://` or `?` would break it.

Why did decoding fail?

The input contains a malformed percent sequence, such as a lone % not followed by two valid hex digits. Make sure you're decoding a string that was actually percent-encoded, not raw text.

This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.