URLエンコーダー / デコーダー
ツールについて
URL エンコーダはスペース・&・=・?・/ や非 ASCII など URL 内で安全でない文字を %xx パーセントエンコーディングに変換します。エンコードしないと URL 構造が壊れます。フレームワークは自動でやってくれますが、文字列結合で URL を組み立てる時は手動で必要です。
使い方
- Choose Encode to escape characters, or Decode to recover the original.
- Paste the URL or query parameter into the input box.
- The output updates as you type — no submit button.
- Copy the encoded string into your URL builder, fetch call, or query string.
- When in doubt, encode each query parameter individually rather than the whole URL.
主な使用例
- Building a search URL where the query contains spaces or special characters.
- Generating a redirect URL that passes another URL as a parameter.
- Constructing a deep link with non-ASCII text (Korean, Japanese, emoji) in the path.
- Decoding a webhook payload where parameters are URL-encoded twice.
- Sanity-checking that a third-party callback URL is properly escaped.
- Encoding a base64 string before placing it in a URL — the + and / are unsafe.
よくある質問
Q. What is the difference between encodeURI and encodeURIComponent?
A. encodeURI keeps reserved URL characters (: / ? & =) intact — use it for whole URLs. encodeURIComponent escapes them too — use it for individual parameter values.
Q. Why is a space sometimes encoded as + and other times as %20?
A. + is the legacy x-www-form-urlencoded form (still used in query strings), %20 is the standard percent-encoding used in URL paths. Servers normally accept either in query strings.
Q. Do I need to encode non-ASCII characters?
A. Yes, for compatibility. Modern browsers display Unicode in the URL bar, but the underlying request encodes them as UTF-8 percent-escapes.
Q. Why does decoding produce strange characters?
A. Usually a charset mismatch — the URL was encoded with one encoding (e.g., latin-1) but decoded as another (UTF-8). Fix the source if you can.