ad
URL Encode & Decode
Encode or decode URL components — component or full URL mode.
What is URL Encoding (Percent-Encoding)?
URL encoding, also called percent-encoding, is a mechanism for encoding characters in a Uniform Resource Identifier (URI). It replaces unsafe characters with a % sign followed by two hexadecimal digits representing the character's ASCII value.
For example, a space becomes %20, an ampersand becomes %26, and a question mark becomes %3F. This ensures URLs are valid and unambiguous, as defined by RFC 3986.
How to Use This Tool
- Select Encode or Decode mode
- Paste your text or URL in the input field
- The encoded/decoded result appears instantly
- Click Copy to copy the result
Characters That Must Be Encoded
The following characters have special meaning in URLs and must be percent-encoded when used as data:
space→%20— Spaces are not valid in URLs&→%26— Separates query parameters=→%3D— Separates key=value pairs#→%23— Fragment identifier
Frequently Asked Questions
- What is URL encoding?
- URL encoding (percent-encoding) converts special characters into a format that can be transmitted in URLs. Characters like spaces, &, =, and non-ASCII characters are replaced with a % sign followed by their hexadecimal value.
- What is the difference between component and full URL encoding?
- Component encoding (encodeURIComponent) encodes everything except letters, digits, and - _ . ~ — use this for query parameter values. Full URL encoding (encodeURI) preserves URL structure characters like :, /, ?, #, and & — use this for complete URLs.
- Why do spaces become %20 or +?
- In URLs, spaces are encoded as %20 (RFC 3986 standard). In HTML form data (application/x-www-form-urlencoded), spaces become +. Both represent a space, but %20 is the correct encoding for URL paths and query parameters.
- Is my data sent to a server?
- No. All encoding and decoding happens in your browser using JavaScript. Your data stays on your device.
- When should I URL-encode data?
- Always encode user input before putting it in URLs — query parameters, path segments, and fragment identifiers. This prevents broken URLs and protects against injection attacks.
ad