Web Dev & Coding

URL Encoder / Decoder

The URL Encoder / Decoder percent-encodes text so it can be safely placed in URLs, and decodes encoded URLs back into readable text. Choose component encoding or whole-URL encoding.

What is URL Encoding?

URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in URLs with a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures that data placed in a URL — especially query parameters — is transmitted exactly as intended without breaking the URL's structure.

Our URL Encoder / Decoder offers two modes. Component mode (encodeURIComponent) encodes every reserved character and is correct for individual query-string values. Whole-URL mode (encodeURI) preserves characters that have structural meaning, such as : / ? & = and #, and is correct for encoding a complete URL.

How to Encode and Decode URLs

  • Choose Encode or Decode using the mode buttons
  • Toggle "Encode entire URL" on for full URLs, off for single query values
  • Type or paste your input to see the result update instantly
  • Use Swap to flip the output back into the input and reverse the mode
  • Malformed percent-encoding when decoding shows a clear error message

When Do You Need URL Encoding?

You need URL encoding any time you put dynamic data into a URL: building API request query strings, creating search links, passing redirect URLs as parameters, or constructing links that contain spaces, special characters, or non-Latin text. Without encoding, characters like &, =, and spaces would break the URL or be misinterpreted by the server.

Decoding is equally useful for reading encoded URLs — for inspecting analytics links, debugging redirect chains, and understanding what data an application is actually sending in a request.

Privacy

Encoding and decoding run entirely in your browser. Nothing is sent to a server, so the tool is safe for URLs that contain tokens, parameters, or other sensitive data.

encodeURIComponent vs encodeURI

The two encoding modes correspond to JavaScript's two built-in functions, and choosing the right one is the key to correct results. Component mode uses encodeURIComponent, which encodes every character that has any reserved meaning in a URL — including : / ? & = and #. This is exactly what you want when encoding a single value that will go inside a query string, because those structural characters must not survive as-is or they would change the meaning of the URL.

Whole-URL mode uses encodeURI, which deliberately leaves the structural characters intact so that an already-formed URL remains a valid URL. Use it when you have a complete address with spaces or non-Latin characters that needs cleaning up, but whose slashes, query separators, and fragment marker should stay functional. Picking the wrong mode is the most common cause of broken links: encode a whole URL with component mode and its slashes turn into %2F; encode a single value with whole-URL mode and an embedded ampersand silently splits it into two parameters.

Why Choose Our URL Encoder / Decoder?

This tool is completely free, needs no signup, and runs entirely in your browser. It gives you both encodeURIComponent and encodeURI behaviour through a simple toggle, so you can encode a single query value or a whole URL correctly without remembering which JavaScript function does what. Decoding is just as easy, and malformed percent-encoding produces a clear error rather than a confusing result.

The URL Encoder / Decoder is one of more than 200 free tools on ToopTools. If you build links and query strings regularly, you can pin it to your personalized My Workspace workspace so it sits beside your other developer utilities, always one click away. It works on any modern browser, on desktop and mobile.

Is the URL encoder free?

Yes. It is completely free with no limits and no signup. You can encode and decode as many URLs and parameters as you like, as often as you like, without ever creating an account.

What is the difference between the two encode modes?

Component mode encodes every reserved character and is correct for individual query-string values. Whole-URL mode preserves the characters that give a URL its structure — such as : / ? & = and # — and is correct when encoding a complete URL. Toggle 'Encode entire URL' on for full URLs and off for single values.

Why does a space become %20?

Spaces are not allowed in URLs, so they must be percent-encoded. The standard encoding for a space is %20. In some contexts, particularly the query string of older form submissions, a space may instead appear as a plus sign (+), but %20 is the safe, universally accepted form this tool produces.

Can I decode an encoded URL back to readable text?

Yes. Switch to Decode mode and paste the percent-encoded string to see the original, human-readable text. This is useful for inspecting analytics links, debugging redirects, and understanding what data an application is actually passing in a request.

Is my data private?

Completely. All encoding and decoding happens locally in your browser, so your URLs are never uploaded, logged, or stored on a server. It is safe to use with links that contain tokens, parameters, or other sensitive data.

Tips for Encoding URLs Correctly

  • Use component mode for individual query-string values so reserved characters are fully escaped
  • Use whole-URL mode only for a complete, already-structured URL you want to tidy up
  • Always encode user input and dynamic data before adding it to a URL
  • Decode unfamiliar links to inspect exactly what parameters they carry
  • Watch for double-encoding — encoding an already-encoded string turns % into %25

Key Features

  • Encode text for URLs and decode percent-encoded URLs back to readable text
  • Two modes — component (encodeURIComponent) and whole-URL (encodeURI)
  • Instant, as-you-type conversion
  • One-click Swap to reverse the input and output and flip the mode
  • Clear error messages for malformed percent-encoding when decoding
  • 100% browser-based — your URLs never leave your device

How do I encode a URL with special characters?

Paste your URL or text and the tool instantly percent-encodes the characters that are unsafe in a web address — spaces, ampersands, question marks, and more — so it can be used safely in links and query strings. Switch to decode mode to reverse it.

Does the URL encoder work offline?

Yes. Encoding and decoding run entirely in your browser, so once the page has loaded the tool works without an internet connection and your data is never uploaded. You can safely encode links containing private parameters on your device.

Related searches

url encoderurl decoderurl encodeurl decodepercent encodingencode url onlineuri encoder

Recommended Web Dev & Coding tools

Explore more free online tools related to URL Encoder / Decoder.