Skip to content

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.

URL Decode

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

  1. Paste text that goes into the URL
  2. Confirm mode (default suits param values)
  3. 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

InputOutputNote
hello (non-ASCII)Percent-encoded UTF-8 bytese.g. 你好 → %E4%BD%A0%E5%A5%BD
a ba%20bSpace
a=1&b=2a%3D1%26b%3D2As 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.

Related tools