URL Encoder & Decoder — Free Online
Encode and decode URLs instantly with this free online tool. Supports encodeURIComponent and encodeURI modes for query strings and full URLs. No sign-up required.
What is URL Encoding (Percent Encoding)?
URL encoding, also known as percent encoding, is a mechanism defined in RFC 3986 for representing special characters in a URI. Characters that are not allowed in a URL — such as spaces, ampersands, question marks, and non-ASCII characters — are replaced with a percent sign followed by their two-digit hexadecimal value (for example, a space becomes percent-20). JavaScript provides two built-in functions: encodeURIComponent() encodes all special characters (ideal for query parameter values), while encodeURI() preserves URL-structural characters such as colons, slashes, question marks, and hash signs (ideal for encoding a complete URL without breaking its structure).
How to Use This Free Online URL Encoder & Decoder
- Select the mode: 'Encode' to convert text to a URL-safe string, or 'Decode' to convert a percent-encoded string back to plain text.
- Choose the encoding function: toggle between encodeURIComponent (encodes everything) and encodeURI (preserves URL structure).
- Paste or type your text into the input field. The result updates in real time.
- Click the Copy button to copy the output to your clipboard.
Common Use Cases for URL Encoding & Decoding
- Building query strings — Safely encode parameter values that contain special characters like &, =, or spaces before appending them to a URL.
- Debugging encoded URLs — Decode percent-encoded URLs to read the original values and troubleshoot routing or API issues.
- Encoding non-ASCII characters — Convert Unicode characters (Chinese, Arabic, emoji) into percent-encoded sequences for use in URLs that only support ASCII.
- Preparing redirect URIs for OAuth — OAuth flows require redirect_uri values to be URL-encoded when passed as query parameters to the authorization endpoint.
- Constructing mailto: links — Encode subject lines and body text in mailto: links so special characters render correctly in email clients.