URL エンコード
URLに使える文字へ変換。日本語や記号をパーセントエンコード。
URL エンコードとは
URLエンコード(パーセントエンコード)とは、URLに直接使用できない文字を「%XX」形式に変換する処理です。
🔒 処理はすべてブラウザ内で完結し、データは送信されません。
このツールの前提
- 処理場所
- このページのブラウザ内(JavaScript / Canvas)
- アップロード
- なし — ファイルは端末の外に出ません
- オフライン
- ページを開いた後は通信不要
Two different jobs, two different functions
Percent-encoding has two legitimate scopes in JavaScript and mixing them is the number one URL bug. encodeURIComponent escapes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ), which makes it right for a single parameter value. encodeURI leaves : / ? & = # alone, which makes it right for a whole URL you are only cleaning up.
Wrap an entire URL in encodeURIComponent and https://example.com/a?b=1 becomes https%3A%2F%2Fexample.com%2Fa%3Fb%3D1 — a single opaque path segment that no server will route. Encode only a value with encodeURI and an & inside that value survives, splitting one parameter into two on the receiving end.
Non-ASCII is bytes first, percent signs second
Characters outside ASCII are encoded as UTF-8 bytes, and each byte becomes its own %XX. A single Chinese character is three bytes and therefore three escape sequences, so the encoded form is nine characters long. An emoji is four bytes and becomes twelve characters. That multiplication is why URLs carrying CJK slugs look enormous in logs.
Spaces become %20 here rather than +. Both are read as a space by form parsers, but only + is specific to the form-encoding convention; %20 is legal in every URL context including the path, and it is the only one that survives a path segment intact.
What to leave unencoded on purpose
Encoding is not sanitisation. Percent-encoding a value does not make it safe for SQL, HTML or a shell — those layers have their own escaping rules, and a string that is perfectly valid percent-encoding can still be a directory traversal once the server decodes it. Decode-then-validate is the order that matters.
Also expect the output to differ from what other tools show for the same input. Libraries disagree on whether ~ * ' ( ) and ! need escaping; some legacy encoders also emit ! as %21. Both forms decode identically, so never compare encoded strings for equality to test whether two values are the same value.
使い方
- 1.文字列を入力
- 2.エンコード結果を取得
- 3.URLに使用
他の方法との比較
同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。
| 観点 | このツール | サーバー側の変換サービス | デスクトップアプリ |
|---|---|---|---|
| ファイルの処理場所 | このページのブラウザ内 | ベンダーのサーバー(アップロード後) | 自分の PC(アプリをインストール) |
| アカウント | 不要 | 多くの場合必要(無料枠の制限解除に登録を求める) | 不要(ライセンス認証は必要な場合あり) |
| 無料で扱えるサイズ | サイズ制限なし(回数制限もなし) | 数ファイル/時間、または 5〜10MB 程度で課金 wall | ディスクとメモリ次第 |
| 料金 | 無料。Pro は月 $9(大きいファイルと AI 機能のみ) | サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点) | 買い切り、またはサブスク |
| オフライン | 一度開けば通信不要 | 不可 | 可 |
| 20MB を処理し始めるまで | 待ち時間なし(アップロードが無い) | アップロードが支配的(10Mbps 上りで約 16 秒) | アプリの起動のみ |
| 保証できないこと | 出力は決定的です。他の実装と突き合わせて検証できます | 同じ(変換の原理は変わらない) | 同じ。ただし書式の再現はより忠実な場合がある |
サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。
よくある質問
URLエンコードが必要な理由は?
日本語やスペースなど、URLに直接書けない文字を安全に扱うためです。
デコードもできますか?
はい、別のURLデコードツールで元に戻せます。
この変換で失われるもの
エンコードとハッシュは Web Crypto API または純 JavaScript 実装で行います。出力は決定的で、同じ入力からは常に同じ結果になります。他のツールと突き合わせて検証できます。