URL encoding guide

Encode spaces in a URL

Encoding a space is simple; choosing the right part of the URL to encode is the detail that prevents broken links.

Open URL Encode Decode Tool View all tools

Where spaces cause trouble

Spaces often appear in search terms, folder names, campaign names, and redirect parameters. If the space remains literal, a request may be rejected, truncated, or copied incorrectly.

Example

Input

summer sale 2026

Output

summer%20sale%202026

A careful way to encode

  1. Decide whether you need to encode a full value, a query parameter value, or a path segment.
  2. Encode only that part in the URL Encode Decode Tool.
  3. Paste the encoded value back into the larger URL and test the link once.

Encode the smallest useful piece

For search terms and labels, encode just the value. For callback and redirect parameters, the value may be an entire URL, so encoding the whole nested URL is normal.

When in doubt, look at where the text will be pasted. If it sits after an equals sign inside a query string, it is probably a value and should be encoded as one.

Common mistakes

  • Encoding the protocol and slashes when only a search term needed encoding
  • Leaving one space unencoded in a long query string
  • Mixing already encoded values with raw text
  • Decoding a value before storing it in a place that requires encoded URLs

Related problems

FAQ

What characters are encoded with spaces?

The tool also encodes characters such as ampersands, question marks, slashes, and non-ASCII text when they are part of a value.

Can I encode a full URL?

You can, but it is usually best when the full URL is being placed inside another URL as a callback or redirect value.

How do I avoid double encoding?

If you already see %20, do not encode that same value again unless the receiving system explicitly requires another layer.