ToolHarbor

URL Encoder/Decoder

Encode and decode URLs and query strings. Convert special characters to percent-encoded format and back.

Tip

Component mode encodes all special characters including / ? # &. Use this for query string values.

Features

  • Encode special characters for URLs
  • Decode percent-encoded strings
  • Full URL encoding (preserves structure)
  • Component encoding (encodes everything)
  • Parse URLs into components
  • Works offline - no data sent to servers

How to Use

  1. 1Paste your URL or text in the input field
  2. 2Choose between Encode or Decode
  3. 3Select encoding type (Component or Full URL)
  4. 4View the encoded/decoded result instantly
  5. 5Copy the result to your clipboard

Examples

Encode query parameter

Input

Hello World! How are you?

Output

Hello%20World!%20How%20are%20you%3F
Decode URL

Input

https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhello%20world

Output

https://example.com/path?q=hello world
Encode special characters

Input

name=John Doe&city=New York

Output

name%3DJohn%20Doe%26city%3DNew%20York

What is URL Encoding?

URL encoding (also called percent-encoding) is a mechanism for encoding special characters in URLs and query strings. URLs can only contain a limited set of characters from the ASCII character set. Characters outside this set, or characters with special meaning in URLs (like & or =), must be encoded to be transmitted safely.

When a character is URL encoded, it is replaced with a percent sign (%) followed by two hexadecimal digits representing the ASCII code of the character. For example, a space becomes %20, and an ampersand becomes %26. This allows any character to be safely included in a URL without breaking its structure.

There are two types of URL encoding. Component encoding (encodeURIComponent) encodes all special characters including those with URL meaning like / and ?. This is used for query string values. Full URL encoding (encodeURI) preserves the URL structure, only encoding characters that are invalid in any part of a URL.

URL encoding is essential when building URLs programmatically, especially when including user input in query strings. Without proper encoding, special characters can break URLs or create security vulnerabilities like URL injection. It is also needed when transmitting data via GET requests or when working with APIs.

This tool handles both encoding and decoding, with options for both component and full URL modes. All processing happens locally in your browser, making it safe to use with sensitive URLs containing authentication tokens or personal data. The tool works offline and has no character limits.

Frequently Asked Questions

Related Tools