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

  1. Select the mode: 'Encode' to convert text to a URL-safe string, or 'Decode' to convert a percent-encoded string back to plain text.
  2. Choose the encoding function: toggle between encodeURIComponent (encodes everything) and encodeURI (preserves URL structure).
  3. Paste or type your text into the input field. The result updates in real time.
  4. 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.

FAQ

What is the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a full URI but preserves characters that are part of URL syntax (like colons, slashes, question marks, hash, ampersand, and equals). encodeURIComponent() encodes everything except A-Z, a-z, 0-9, and the characters - _ . ~ making it suitable for query parameter values where those structural characters must be escaped.
Why do spaces appear as %20 or + in URLs?
In standard percent encoding (RFC 3986), a space is encoded as %20. In HTML form submissions using application/x-www-form-urlencoded, a space is encoded as +. Both represent a space, but %20 is the universal standard for URLs.
Is URL encoding the same as HTML entity encoding?
No. URL encoding (percent encoding) is for making strings safe inside URLs. HTML entity encoding (for example, using the 'amp' entity for the ampersand character) is for making strings safe inside HTML markup. They serve different purposes and use different syntax.
Is this tool free and private?
Yes. This tool runs entirely in your browser using JavaScript's built-in encoding functions. No data is sent to any server and no sign-up is required.

관련 도구