◆ Online Dev Kit

URL Encode / Decode

Percent-encode and decode URL components.

About this tool

URL encoding (percent-encoding) replaces unsafe characters in a URL with a % followed by hex digits, so query strings and parameters transmit correctly. Use Encode before putting text into a URL, and Decode to read an encoded URL. Runs entirely in your browser.

Common use cases

How it works

URL encoding (percent-encoding) replaces unsafe ASCII characters with % followed by two hexadecimal digits. Characters like spaces become %20 (or + in form data), & becomes %26, and = becomes %3D. Unreserved characters (A-Z, a-z, 0-9, -, _, ., ~) are not encoded. This ensures URLs contain only safe ASCII characters and special characters do not break URL parsing.

FAQ

When should I URL-encode?

Whenever you put user text, spaces or special characters into a query string or path so the URL stays valid.

What's the difference from Base64?

URL encoding keeps text readable and only escapes unsafe characters; Base64 turns everything into an ASCII blob. They solve different problems.

What is the difference between encodeURI and encodeURIComponent?

encodeURI preserves URL structure characters like : / ? # & =, while encodeURIComponent encodes everything except unreserved characters. Use encodeURIComponent for individual parameter values.

Should spaces be %20 or +?

In URL paths and query strings, spaces should be %20. The + is only valid in application/x-www-form-urlencoded form data (POST bodies).