SiteBox

URL Encoder/Decoder

Free Online URL Encoding and Decoding Tool

Convert between regular text and URL encoded format. Encode special characters for safe URL inclusion or decode URL-encoded text. Perfect for web developers, SEO specialists, and anyone working with web addresses.

URL Component Breakdown

Enter a full URL to see its components broken down:

Special Characters Reference

Common characters that need URL encoding:

Character URL Encoded Description Action

How to Use URL Encoder/Decoder

1. Enter Your Text

Type or paste the text you want to process in the input box.

2. Choose Operation

Click "Encode" to convert regular text to URL-encoded format, or "Decode" to convert URL-encoded text back to regular text.

3. View Components

For full URLs, use the URL Component Breakdown section to see the URL broken down into its individual parts.

Why Use URL Encoder/Decoder?

  • Safely encode URLs for web applications
  • Decode encoded URLs to understand their components
  • Parse and examine URLs and query parameters
  • Test URL encoding for special characters
  • Completely free with no registration required

How to Encode or Decode a URL Online

  1. Paste the text, query value or full link into the input box.
  2. Press Encode to escape spaces, &, ?, # and non-English characters, or Decode to turn %20-style sequences back into readable text.
  3. Copy the result, or press Swap to move it back into the input and run the opposite step.
  4. To check a whole link, use URL Parse to split it into protocol, host, path, query parameters and fragment.

Encode only the parts that vary, such as a search term or a redirect target, and leave the rest of the address as it is. Encoding a complete URL a second time is what produces broken %2520 links.

What Percent-Encoding Actually Does

A URL may only contain a limited set of ASCII characters, and several of those have a job: ? starts the query string, & separates parameters, = splits a name from its value, # starts the fragment and / separates path segments. When one of these characters needs to appear as data rather than structure, it has to be escaped. RFC 3986 defines the escape as a percent sign followed by the byte value in hexadecimal: & becomes %26, a space becomes %20.

Characters outside ASCII are first converted to UTF-8 bytes and then each byte is escaped. That is why é turns into two escapes, %C3%A9, and a single emoji such as 🚀 turns into four, %F0%9F%9A%80.

The Encode button uses JavaScript's encodeURIComponent. It leaves letters, digits and - _ . ! ~ * ' ( ) alone and escapes everything else, including / ? & = #. That makes it the right choice for a single value you are about to place inside a URL, not for an entire URL.

Worked Example: A Search Link With Awkward Text

You want to link to a search page for the phrase salt & pepper / 50% off. Gluing it straight on breaks the link:

https://shop.example/search?q=salt & pepper / 50% off

The server sees q=salt , then a second parameter called pepper / 50% off with no value, and % o is an invalid escape. Encode only the value:

salt%20%26%20pepper%20%2F%2050%25%20off

and the working link is:

https://shop.example/search?q=salt%20%26%20pepper%20%2F%2050%25%20off

Paste that full link into the URL Component Breakdown section and click Parse URL: the query parameter table shows q with the encoded value and the decoded value salt & pepper / 50% off side by side, which is a quick way to confirm the link carries what you meant.

Everyday Situations

  • Marketing links. UTM tags such as utm_campaign=Spring Sale – EU contain spaces and an en dash. Encode the value or analytics will record a truncated campaign name.
  • Reading tracking redirects. Email links often wrap the real destination inside a parameter, for example ?url=https%3A%2F%2Fexample.com%2Fpage. Decode it to see where you will actually land before clicking.
  • Debugging an API call. A request fails only for customers whose names contain + or #. Encoding the name shows the bytes the server should receive.

Mistakes That Cause Broken Links

Encoding the whole URL

Running https://example.com/a?b=c through the encoder produces https%3A%2F%2Fexample.com%2Fa%3Fb%3Dc, which is no longer a link. Encode the pieces, not the frame. The exception is when the whole URL is itself a parameter value, as in the redirect example above.

Double encoding

Encoding text that is already encoded turns %20 into %2520 (the % itself becomes %25). If you see %25 followed by two hex digits in a URL, something encoded twice. Decode once and compare.

Plus signs and spaces

HTML forms send spaces as + (the application/x-www-form-urlencoded format), while percent-encoding uses %20. This decoder follows the URL standard, so a + stays a +. Replace + with a space first if you are decoding form data.

"URI malformed" when decoding

A lone % not followed by two hex digits, or an escape sequence that isn't valid UTF-8, can't be decoded. Look for a literal percent sign that should have been written as %25.

Reproduce These Encoding Cases

Use the input box above to check these results. Encode and Decode operate on one URL component; the URL parser uses form-style query parsing, where a plus sign means a space.

  • Encode tea & cake → tea%20%26%20cake
  • Decode 100%25 → 100%; decoding 100% again is an error because it contains an incomplete percent escape
  • Decode a+b → a+b; parsing https://example.com/?q=a+b shows a b as the query value
  • Parse https://example.com/?q=%2526&q=second → two rows, with values %26 and second; the parser decodes each value once, preserving repeated keys

The character reference follows JavaScript encodeURIComponent: ! ' ( ) * ~ remain unchanged. See MDN's encoding reference and the URLSearchParams specification.

Related Encodings

Percent-encoding is for URLs. To embed binary data or arbitrary text in JSON, email or a data URI, use Base64 instead. If you are inspecting an API response that arrived inside a URL parameter, decode it here and tidy it up with the JSON Formatter. More utilities are on the developer tools page.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters that structure a URL, such as / ? & and =. encodeURIComponent escapes them too, so it is used for individual values. This tool uses encodeURIComponent.

Why is a space encoded as %20 and not +?

%20 is the URL standard encoding for a space. The + form comes from HTML form submissions. Both are common, but %20 is safe everywhere in a URL.

How do I fix %2520 in my links?

%2520 means the text was encoded twice. Decode it once to get %20, and make sure only one step in your code or tool chain encodes the value.

Can I encode non-English text or emoji?

Yes. Characters are converted to UTF-8 bytes and each byte is percent-encoded, which every modern browser and server understands.

How do I decode a URL online?

Paste the encoded link or value into the input box and press Decode. Sequences such as %20 and %C3%A9 turn back into spaces and readable characters, and Swap moves the result back into the input if you need to decode again.

Is my text sent to a server?

No. Encoding, decoding and URL parsing all run in your browser with built-in JavaScript functions.