URL encoder

URL-encode (percent-encode) any text so it's safe in links, query strings and API requests. Spaces, &, ?, # and accents handled. Free URL encoder.

Make any text safe to put in a URL

URLs can only contain a limited set of characters. Spaces, accented letters, emoji and symbols like &, ?, #, = and / either aren't allowed or have special meaning. URL encoding, also called percent-encoding, replaces those characters with a % followed by their hexadecimal byte value, so the text travels safely.

For example, coffee & tea becomes coffee+%26+tea, and café becomes caf%C3%A9 (its UTF-8 bytes). Paste your text, submit, and copy the encoded result.

Encoding matters most for values inside a query string. If a search term contains &, an unencoded link will split it into two parameters and break the request.

How to use the url encoder

  1. Paste the text or value you want to encode.
  2. Submit to encode it.
  3. Copy the encoded string.
  4. Insert it into your link, usually as the value of a query parameter like ?q=.

Examples

A search value

Input: coffee & tea

Output: coffee+%26+tea

The & is encoded so it isn't read as the start of a new parameter.

Accents and reserved characters

Input: café?size=large#top

Output: caf%C3%A9%3Fsize%3Dlarge%23top

é becomes its two UTF-8 bytes, and ?, = and # are encoded because they'd otherwise change the URL's structure.

Why not to encode a whole URL

Input: https://mybotsy.com/?q=red shoes

Output: https%3A%2F%2Fmybotsy.com%2F%3Fq%3Dred+shoes

Every slash and colon is encoded, so this no longer works as a link. It's only correct when the whole URL is itself a parameter value, for example in a redirect.

Common uses

  • Building links with search terms or user input in the query string.
  • Passing a full URL as a parameter inside another URL, for example a redirect or share link.
  • Preparing values for API requests and webhooks.
  • Creating mailto, WhatsApp or social share links that contain spaces and punctuation.
  • Encoding non-English characters in links.

Tips and things to know

  • Encode the values, not the whole URL. Encoding https:// and the slashes of the base address will break it.
  • This encoder writes spaces as +, the form-style convention that query strings accept. If you need %20 (for example in a path segment), replace each + with %20.
  • Don't encode twice. Double-encoded text shows up as %2520 instead of %20.
  • Need ready-made links? Try the UTM link generator, mailto link generator or WhatsApp link generator, which handle encoding for you.

Edge cases and limitations

  • A literal % becomes %25: 100% natural turns into 100%25+natural.
  • A + in your text becomes %2B, so a+b=c is a%2Bb%3Dc. That keeps it from being read as a space.
  • Running already-encoded text through again double-encodes it (%26 becomes %2526).

Frequently asked questions

What is URL encoding?

It's a way to represent characters that aren't allowed in URLs by replacing them with % and two hexadecimal digits, such as %20 for a space.

Why is a space shown as + here and %20 elsewhere?

The space has the byte value 32, which is 20 in hexadecimal, so strict percent-encoding writes it as %20. Query strings also accept the older form convention, +, which is what this tool outputs.

Which characters need to be encoded?

Anything outside letters, digits and - . _ ~ should be encoded when it appears inside a value. Reserved characters like & ? # = / + : need encoding when they're part of data rather than URL structure.

How do I decode a URL?

Use our URL decoder to turn percent-encoded text back into normal characters.

Is URL encoding the same as Base64?

No. URL encoding only replaces unsafe characters and leaves the rest readable. Base64 converts all the data into a different alphabet.

Related tools

Similar tools

URL decoder

Decode percent-encoded URLs and query strings back into readable text. Turn %20, %26 and %C3%A9 into normal characters instantly. Free URL decoder.

Popular free tools