URL ENCODER / DECODER

Encode & decode URLs, non-ASCII safe.

Encode URLs or query parameters into safe characters, or turn %XX back into text — for whole URLs or single params.

Everything runs locally in your browser

What does this tool do?

"Encode param" escapes all special characters including & = ?, ideal for query strings; "Encode whole URL" only escapes what is necessary, keeping the URL structure. Decoding reverses each accordingly.

FAQ

What is the difference between component and URI?

component (encodeURIComponent) encodes more characters and suits a single parameter; URI (encodeURI) keeps : / ? & and suits a full URL.

Is anything uploaded?

No. Encoding and decoding happen entirely in your browser.

示例与注意事项Example & notes

一个例子A worked example

搜索词含空格和中文时,编码后变成 %E5%9B%BE%E8%AF%B4%20…,粘到接口或链接里就不会被截断或报错。A query containing spaces and Chinese characters becomes %E5%9B%BE%E8%AF%B4%20… so it survives intact in a URL or API call.

注意事项Things to watch

相关问答More Q&A

什么时候用哪种编码?Which mode should I use?

拼参数值时用 encodeURIComponent;整条链接需要保留结构符号时用 encodeURI。Use encodeURIComponent for values, encodeURI when the whole URL must keep its structure characters.

中文编码后为什么变这么长?Why does Chinese text get so long after encoding?

每个汉字在 UTF-8 下占 3 字节,百分号编码后是 9 个字符,所以长度会变成原来的 3 倍。Each Chinese character is three UTF-8 bytes, which percent-encoding expands to nine characters — a threefold increase.

Further reading

觉得好用?Found it useful?