URL Encode online — encodeURIComponent tool
Turn text into something safe inside a URL: spaces, non-ASCII characters, and symbols become `%XX` sequences. Use when building query strings, stitching callback URLs, or fixing links that break the moment you paste Chinese or spaces. Default follows `encodeURIComponent` — best for a single parameter value, not blindly encoding an entire URL.
The `%E4%BD%A0%E5%A5%BD` you see in an address bar is “hello” in Chinese under UTF-8 percent-encoding. Dropping raw `?name=张三` into a URL often truncates or garbles downstream.
`encodeURIComponent` is aggressive — good for values. Encoding a full URL with it can break `://` if you are not careful; use whole-URL modes when the page offers them.
Encode before send, decode when debugging — they are a pair.
How to encode
- Paste text that goes into the URL
- Confirm mode (default suits param values)
- Copy encoded output into the address
When to encode
- Hand-built query strings with risky characters.
- OAuth callbacks expecting encoded parameters.
- Compare docs vs. real requests byte-for-byte.
Scenarios
- Search terms in `?q=`
- Filenames with spaces in download link params
- Sanity-check API doc example URLs
Tips
- Encode the value, not an already-encoded link — double encoding yields `%25`.
- Spaces often become `%20`; some forms use `+` — know your spec.
- When unsure, encode then decode on the decode page to verify.
Examples
| Input | Output | Note |
|---|---|---|
| hello (non-ASCII) | Percent-encoded UTF-8 bytes | e.g. 你好 → %E4%BD%A0%E5%A5%BD |
| a b | a%20b | Space |
| a=1&b=2 | a%3D1%26b%3D2 | As one param value |
URL encode FAQ
- How is this different from Base64?
- Different jobs: URL encoding keeps text URL-safe; Base64 wraps binary or token pieces.
- What if I encode twice?
- You get `%25` for encoded percent signs. Usually encode once.
- Encode path and query the same way?
- Each has rules; encoding param values with the default here is the common case.