Percent-encode text for a URL

Percent-encode text for a specific URI component without changing its delimiters.

freeworks offlinenothing uploaded
ToolURL Encode
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Characters outside the component’s allowed set become percent signs and two uppercase hex byte digits; unreserved ASCII remains literal. Non-ASCII text is encoded from UTF-8 bytes.

  • Component-aware encoding preserves URI structure.
  • Uppercase hex is a common canonical form.

Worked example

Query Parameter
Encode a search query with special characters for use in a URL
Input
											hello world & goodbye=cruel+world
										
Output
												hello%20world%20%26%20goodbye%3Dcruel%2Bworld
											

When to use this

Query parameters, redirects, and API path segments encode URLs.

Edge cases

  • Encoding a whole URL can escape scheme and slash delimiters.
  • Space is %20 in URI encoding but plus in form encoding.
  • A literal percent sign becomes %25.

References