URL エンコード/デコード

URL コンポーネントを安全に変換

Input

Loading editor...

Output

Loading editor...

Encode URL components without breaking your queries

Special characters — spaces, ampersands, slashes, non-ASCII letters — break query strings if they're not percent-encoded. The right tool for the job depends on whether you're encoding a full URL or a single component, and choosing wrong is a frequent source of bugs. This tool handles both cases and shows you exactly what each character becomes.

Use the tool when you need to

Encode a query parameter value

Percent-encode a search term, slug, or special string before slotting it into a query string.

Decode a URL from a log

Reverse %20, %2F, and other escapes to read what the request actually contained.

Audit an OAuth or callback URL

Check that the redirect, scope, and state parameters are encoded correctly before debugging the flow.

How to encode or decode URL components

  1. 1

    Paste the URL or component into the input area.

  2. 2

    Click Encode or Decode based on which direction you need.

  3. 3

    Copy the result and slot it back into your URL or test request.

Common URL-encoding workflows

Build a search redirect

Encode the user's query before constructing the destination URL to avoid breaking on spaces or symbols.

Read a redirect from logs

Decode a logged URL to confirm what the user clicked and which parameters arrived.

Verify an OAuth state parameter

Decode the state to confirm it round-trips through the auth provider untouched.

関連ツール

よくある質問

URLエンコード(percent-encoding)は、URL内で安全でない文字を「%」+16進2桁に置き換える方式です。たとえばスペースは%20、アンパサンドは%26になります。これにより、特殊文字がURLの解析を壊すのを防げます。

URL内で特別な意味を持つ文字はエンコードが必要です。例として、スペース、&, =, ?, #, /, @、および非ASCII文字などがあります。一方、英数字と - _ . ~ は安全な文字で、通常はエンコード不要です。

パラメータ値(URL全体ではなく値の部分)を貼り付けて「Encode」をクリックします。たとえば検索クエリが 'hello world & more' の場合、エンコード結果は 'hello%20world%20%26%20more' となり、クエリ文字列に安全に入れられます。

encodeURIはURL全体向けで、:, /, ?, #, & のようなURL構造に関わる文字は保持します。encodeURIComponentは英数字と - _ . ~ 以外を基本的にすべてエンコードするため、個々のパラメータ値にはこちらを使うのが適切です。