💻 Developer Tools

URL Encode / Decode

Paste any URL or text — non-ASCII characters, spaces, symbols — and get a percent-encoded result on the spot. Decode goes the other direction. Switch between encodeURIComponent and encodeURI, and the query parameter breakdown appears automatically. Nothing leaves your browser.

Examples (click to try)

How to Use the URL Encode / Decode Tool

Type or paste the string or URL you want to convert into the text area above. Use the segment buttons at the top to switch between Encode and Decode modes. Results update in real time as you type.

  • Encode: Converts characters that cannot appear directly in a URL — such as spaces, non-ASCII letters, and special symbols — into a format like %E3%81%82.
  • Decode: Converts a percent-encoded string back into its original readable text.
  • encodeURIComponent (recommended): Also encodes URL delimiter characters such as : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use this when encoding the value of a query parameter.
  • encodeURI: Intended for encoding a complete URL, so it leaves URL structural characters unencoded.

Worked Example: Encoding a Search Query Value

Say you need to pass q=cafe & bar to an API. The space and the & can't go straight into a URL. Paste cafe & bar into the input and encode it (encodeURIComponent):

  • Input (before): cafe & bar
  • Result (after): cafe%20%26%20bar

Append that after https://example.com/search?q= and you have a URL that's safe to send. Going the other way, paste a %-heavy URL and it's decoded automatically back to the original text.

Common Use Cases

  • Encoding or decoding search queries and URLs that contain non-ASCII characters
  • Building and validating query parameters for API requests
  • Fixing garbled characters caused by pasting URLs into a browser address bar
  • Inspecting application/x-www-form-urlencoded form data

Frequently Asked Questions

Is the URL or text I enter sent to a server?
No. All encoding and decoding is performed entirely within your browser. Your input is never sent to or stored on any server, so you can safely use this tool with URLs containing sensitive information.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes all characters including URL delimiter characters such as ":/?#[]@!$&'()*+,;=". Use it when encoding the value of a query parameter or any portion of a URL. encodeURI is designed for encoding a complete URL, so it leaves URL structural characters unencoded.
What should I do if decoding fails?
Decoding fails when the input contains an invalid percent-encoding sequence — for example, a "%" not followed by two hexadecimal digits. When this happens, an error message is shown on screen. Check that your input is a valid percent-encoded string and try again.