AbraCalc

URL Encoder

Percent-encode a string for safe use in URLs. Free, instant, no signup.

Embed this tool on your site
Cite this tool

APA

AbraCalc. (2026). URL Encoder [Online calculator]. Retrieved from https://abracalc.com/generator/url-encode/

BibTeX

@misc{abracalc-url-encode, author = {AbraCalc}, title = {URL Encoder}, year = {2026}, howpublished = {\url{https://abracalc.com/generator/url-encode/}} }

Did this tool answer your question?

How to use this tool

  1. Enter text to url-encode in the fields above.
  2. Results update instantly as you type — or click Calculate.
  3. Read your url-encoded and the full breakdown beneath it.

URL encoding (percent-encoding) replaces unsafe ASCII characters with a '%' followed by two hex digits, making strings safe to embed in URLs.

How it works

This tool percent-encodes a string so it can be safely included in a URL. URLs can only contain a limited set of ASCII characters. Any character outside that set (spaces, accented letters, special symbols, non-Latin scripts) must be replaced with a percent sign followed by the character's hexadecimal byte value -- for example, a space becomes %20 and the ampersand becomes %26.

Type or paste the text you want to encode and click Encode. The tool converts each character that is not URL-safe into its percent-encoded equivalent and leaves safe characters (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) as-is. The output is ready to use in a query string, form post, or API parameter value.

URL encoding is required whenever you construct URLs programmatically, pass user-provided text as a query parameter, or embed data containing reserved URL characters (/, ?, =, &, #, +) in a link. Without encoding, these characters would be misinterpreted as URL structure.

This tool encodes the entire input as a component value (suitable for a single parameter or path segment). If you are building a full URL with multiple parameters, encode each parameter value individually, then join them with literal = and & signs.

Worked example

Encode a search query for a URL

  1. Type the search term: coffee & tea prices 2025
  2. Click Encode
  3. Copy the result: coffee%20%26%20tea%20prices%202025
  4. Append to the URL: https://example.com/search?q=coffee%20%26%20tea%20prices%202025

coffee%20%26%20tea%20prices%202025

Common mistakes to avoid

  • Encoding the entire URL including the protocol and slashes, which breaks the URL structure.
  • Double-encoding a value that was already encoded, turning %20 into %2520.
  • Using + for spaces in a REST API URL -- use %20 instead; + is only correct in HTML form data.

Key terms

Percent-encoding
A URL encoding mechanism that replaces unsafe characters with a percent sign followed by two hexadecimal digits representing the character's UTF-8 byte value.
Reserved characters
Characters that have special meaning in URLs (such as /, ?, =, &, #) and must be percent-encoded when used as literal data in a URL component.
URL component
A distinct part of a URL such as the path, query string, or fragment. Each component has its own rules about which characters must be encoded.

Frequently asked questions

What is URL encoding?
URL encoding converts characters that are not allowed in a URL into a percent-encoded format, e.g. a space becomes %20.

References & sources