Free URL Encoder & Decoder Online
Encode special characters in URLs using percent-encoding (encodeURIComponent) — instantly, in your browser.
How it works
Paste your text
Enter the string or URL component you want to encode.
Encode
Click Encode or press Ctrl+Enter. Special characters are replaced with %XX sequences.
Copy the result
Copy the encoded string to use in URLs, query parameters, or API calls.
All in the browser
Encoding uses encodeURIComponent() — a native browser function. Nothing is uploaded.
Common use cases
Query parameter values
Encode values before appending them as URL query parameters. Spaces, &, =, #, and / in values must be encoded to prevent broken URLs.
API endpoint construction
Many REST APIs require percent-encoded parameters. Encode user-provided values before constructing API URLs dynamically.
Form data inspection
Form submissions with application/x-www-form-urlencoded encoding percent-encode all field values. Use this to see what the encoded value looks like.
Redirect URL encoding
When passing a URL as a query parameter value (e.g., ?redirect=https://...), the entire URL must be percent-encoded.
Frequently asked questions
What is URL encoding?
URL encoding (percent-encoding) replaces unsafe characters with a % followed by their two-digit hex ASCII code. For example, a space becomes %20.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL, preserving :, /, ?, =, &, #. encodeURIComponent encodes a single value and also encodes those characters. Use encodeURIComponent for individual query parameter values.
When should I URL encode?
Any time you insert user-supplied or dynamic values into a URL as query parameters, path segments, or form values. Never append raw strings directly to URLs.
Does this handle Unicode characters?
Yes. encodeURIComponent first converts Unicode characters to UTF-8 bytes, then percent-encodes each byte. For example, © becomes %C2%A9.
Is this different from HTML encoding?
Yes. HTML encoding escapes characters for HTML context (& → &). URL encoding escapes characters for URL context (& → %26). Don't mix them up.