Free, browser-based utilities for everyday developer workflows

URL-encode query string values

Percent-encode a value so it is safe inside a query string — spaces, ampersands, slashes, and unicode all survive — and decode encoded values back to read them.

Open this example in URL Encoder

Open the tool, then paste the sample input below. Everything runs locally in your browser.

Open this example in URL Encoder →

The problem

A query parameter that contains a space, ampersand, or slash breaks the URL or gets misread by the server. Encoding the value as percent-escapes keeps it intact, and decoding lets you read an already-encoded URL. Getting this right avoids broken links and mis-parsed parameters.

Sample input

Raw value
q=blue shoes & socks

Expected output

Encoded
q=blue%20shoes%20%26%20socks

The space becomes %20 and the ampersand becomes %26, so it is not mistaken for a parameter separator. The key q is left as-is.

How to do it

  1. Paste the value to encode.
  2. Encode it to percent-escapes.
  3. Place the encoded value in the query string.
  4. To read an encoded URL, decode it instead.
  5. Copy the result.

Common mistakes

  • Encoding the whole URL instead of just the value, which escapes the ? and &.
  • Leaving a raw ampersand in a value so it splits into two parameters.
  • Double-encoding an already-encoded value (%2520 instead of %20).
  • Using spaces as + in a path segment, where only query strings allow it.
  • Forgetting to encode unicode characters.

Related tools

Related guides

FAQ

How do I encode a value for a query string?

Percent-encode the value so reserved characters become escapes: a space becomes %20 and an ampersand becomes %26. Place the encoded value after the key in the query string.

Should I encode the whole URL?

No. Encode only the values. Encoding the whole URL escapes the ? and & separators and breaks the structure.

What is double-encoding?

Encoding a value that is already encoded, turning %20 into %2520. Decode once to check, and encode raw values only once.

Is a space %20 or +?

In a query string both can mean space, but %20 is safe everywhere. Use %20 to avoid ambiguity, especially outside the query part of the URL.

Is my data uploaded?

No. Encoding and decoding run locally in your browser. Nothing is sent to a server.

URL encoding and decoding run locally in your browser. Nothing is uploaded.

Explore the full developer toolkit

Encode and parse URLs, work with Base64 and headers, plus every other utility.

Browse all developer tools →