URL Encoder

Encode text for safe use in URLs.

Something not working, or a feature missing?Report a problem or suggest a tool

How to Use

  1. 1Type or paste text into the input box.
  2. 2Click "Encode".
  3. 3Copy the URL-safe result.

Features

  • Standard percent-encoding (encodeURIComponent)
  • Instant client-side processing
  • Copy result with one click

Example

Input

search?q=pdf tools & more

Output

search%3Fq%3Dpdf%20tools%20%26%20more

Percent-encode text so it can be safely used inside URLs and query strings, handling reserved and special characters correctly.

Why URLs need encoding

URLs can only contain a limited set of characters, and some of those have special meanings: ? starts the query, & separates parameters, = joins names and values, # starts a fragment and / separates path segments. If a value you put in a URL contains one of these characters, or a space or non-English letter, it must be percent-encoded, otherwise the URL is misread.

How percent-encoding works

Each unsafe character is replaced by % followed by its byte value in hexadecimal. A space becomes %20, & becomes %26, and non-ASCII characters are first converted to UTF-8 bytes, so “é” becomes %C3%A9. Letters, digits and the characters - _ . ! ~ * ' ( ) are left as they are.

CharacterEncoded
space%20
&%26
=%3D
?%3F
/%2F
#%23
+%2B

Encode values, not whole URLs

This tool encodes everything that is reserved, like JavaScript's encodeURIComponent. That is what you want for a single query value or path segment, but if you paste a complete URL the :// and / are encoded too and it stops working as a link. Build the URL first, then encode just the parts you are inserting, for example the search term in ?q=.

A + in a query string is often read as a space by servers, so a literal plus sign in a value must be encoded as %2B. Getting this wrong is a classic cause of broken phone numbers and email addresses in links.

Frequently Asked Questions