URL Encoder / Decoder

Encode and decode URLs and query strings. Escape special characters for safe URL usage.

How to use URL Encoder / Decoder

1

Paste your URL or query string

Click the input text area labeled 'Enter URL or Text' and paste your complete URL or query string. You can include special characters, spaces, and symbols that need encoding.

2

Select encode or decode mode

Choose the 'Encode' button to convert special characters to safe URL format (e.g., space becomes %20), or click 'Decode' to convert encoded characters back to readable text.

3

Copy your converted result

The output appears instantly in the 'Result' field below. Click the 'Copy to Clipboard' button to copy the encoded or decoded URL to use in your application.

Related Tools

URL encoder decoder online, encode and decode URLs instantly

URL encoder decoder online, encode and decode URLs instantly

Encode or decode any URL in seconds with ToolHQ's URL Encoder/Decoder, paste your text, get results instantly, no account needed.

ToolHQ's URL Encoder/Decoder is a free browser-based tool that converts special characters in URLs to percent-encoded format and reverses the process, handling the full range of reserved and unsafe characters correctly. Your text never leaves your device.

Malformed URLs are a common source of broken links, failed API requests, and confusing query strings. Whether you are a developer building a web app or a marketer decoding a tracking URL, getting URL encoding right matters. ToolHQ's tool makes it immediate.

Key Takeaways

  • Encode special characters in URLs to make them safe for transmission
  • Decode percent-encoded URLs back to readable text
  • Handles spaces, ampersands, equals signs, Unicode characters, and more
  • Runs entirely in your browser, nothing is sent to a server
  • Free, instant, works on any device

What is URL encoding and why does it matter?

URL encoding (also called percent-encoding) is the process of replacing characters that are not safe in a URL with a percent sign followed by two hexadecimal digits representing the character's code.

The rules for what constitutes a valid URL are defined in RFC 3986, the official URI standard. URLs may only contain a specific set of characters: letters, digits, hyphens, underscores, periods, and tildes are "unreserved" and can appear without encoding. Characters like spaces, ampersands (&), equals signs (=), question marks (?), and hash signs (#) have special meanings in URL structure and must be encoded if they appear in data (not structure).

Here are the most common character encodings you will encounter:

Character Encoded form Common context
Space %20 Query values, path segments
& %26 Inside query parameter values
= %3D Inside query parameter values
+ %2B When + is literal data (not a space)
? %3F Inside path segments or parameter values
# %23 When # is data, not an anchor
/ %2F Inside parameter values
@ %40 Email addresses in URLs
: %3A When : is data, not a protocol separator
% %25 When encoding a literal percent sign

When you fail to encode a URL correctly, the browser or server misinterprets where one part of the URL ends and another begins. A query parameter value containing & looks like the start of a new parameter. A path containing a space breaks the URL entirely.

Decoding works in reverse: you take a percent-encoded string and convert each %XX sequence back to its original character. This is useful when you receive a URL that looks like https://example.com/search?q=coffee%20beans%20organic and want to read it as coffee beans organic.


When should you use a URL encoder or decoder?

Any time you are working with URLs that contain user-supplied data, special characters, or non-ASCII text, encoding is essential.

Building API requests. When constructing a URL to query a REST API, query parameter values must be properly encoded. If a search term contains a + or % character and you do not encode it, the API will misread the request.

Debugging query strings. Tracking URLs from ad platforms, email campaigns, and analytics tools are often heavily encoded. Decoding them shows you the actual parameter values without having to count percent signs in your head.

Form submissions and redirects. When a web form submits a URL to redirect a user after login, the redirect URL must be encoded as a parameter value or it will be treated as a new URL path.

Internationalization. Non-English characters and emoji cannot appear directly in URLs. The text München becomes M%C3%BCnchen. ToolHQ encodes and decodes these correctly, following the UTF-8 encoding rules specified in RFC 3986.

Meet Aisha, a back-end developer at a travel booking startup. Her team was debugging a bug where search results for destinations with accented characters (like "São Paulo") came back empty. After two hours of log hunting, she realized the destination name was being inserted into the API URL without encoding, causing the server to reject the request entirely. She decoded the broken URL using ToolHQ and immediately spotted the unencoded ã. After encoding the parameter value, the issue disappeared.

Encode or decode your URL now with ToolHQ


How to encode and decode a URL step by step

To encode a URL:

  1. Open the tool. Go to ToolHQ's URL Encoder/Decoder.

  2. Paste your text. Enter the text or URL you want to encode in the input field. This could be a full URL, a query parameter value, or just a string with special characters.

  3. Select "Encode". Click the Encode button (or select the encode mode if the tool uses tabs).

  4. Copy the result. The encoded output appears immediately. Copy it and use it in your URL, API request, or redirect parameter.

To decode a URL:

  1. Paste the encoded URL. Copy your percent-encoded URL or string and paste it into the input field.

  2. Select "Decode". Click the Decode button.

  3. Read the decoded text. The tool converts every %XX sequence back to its original character. You can now read the full URL in plain text.

The difference between encoding a full URL and encoding a URL component matters. If you encode a full URL, the tool will preserve the structural characters (:, /, ?, &, =) because they are part of the URL structure. If you encode just a component (like a query parameter value), all characters including those structural ones should be encoded. This matches the behavior of JavaScript's encodeURIComponent function.


Common mistakes with URL encoding

Encoding the entire URL instead of just the parameters. If you percent-encode an entire URL, you will turn https:// into https%3A%2F%2F, which breaks the link. Encode only the values within the URL, not the structural characters.

Double-encoding. Encoding an already-encoded string turns %20 into %2520. This happens when encoding is applied twice, once in application code and once in a library or framework. The decoded result will show literal %20 instead of a space.

Forgetting to encode spaces. Spaces must be encoded as %20 in proper URL encoding. Some older systems encode spaces as +, which works in some query strings but not in path segments.

Assuming ASCII is always safe. Only a specific subset of ASCII characters are safe in URLs. Characters like [, ], {, }, |, \, ^, and backtick must also be percent-encoded.

Not encoding non-ASCII text. Characters outside the ASCII range (accented letters, Chinese, Arabic, emoji) must first be converted to UTF-8 bytes, then each byte must be percent-encoded. ToolHQ handles this automatically.

If you are dealing with JSON data in URLs, the JSON Formatter and Base64 Encoder are often more appropriate for passing complex data through URL parameters safely.


FAQ

What is the difference between URL encoding and Base64 encoding?

URL encoding makes a string safe to include in a URL by escaping special characters with percent signs. Base64 encoding converts binary data to printable ASCII characters. For passing binary or JSON data in URLs, Base64 is often cleaner.

Why does a space sometimes appear as + and sometimes as %20?

Both are valid in certain contexts. In HTML form data (application/x-www-form-urlencoded), spaces become +. In general URL paths and RFC 3986 encoding, spaces must be %20. ToolHQ uses the %20 standard.

Can I encode a full URL with this tool?

You can paste a full URL, but the tool will encode it as a string. For most use cases, you only want to encode the values inside query parameters, not the whole URL structure.

Does URL encoding affect SEO?

Unencoded URLs can cause crawl errors. Properly encoded URLs are treated normally by search engines. Google recommends using ASCII characters in URLs where possible and encoding any non-ASCII characters.

Is there a character limit on what I can encode?

ToolHQ handles inputs of any length. Browsers do have URL length limits (typically around 2,000 characters), but those limits apply to the URL in the browser, not to the encoding tool itself.

What is percent-encoding?

Percent-encoding is another name for URL encoding. Each unsafe character is replaced by a % followed by two hexadecimal digits: %20 for space, %3A for colon, %2F for forward slash.


Conclusion

URL encoding is one of those fundamentals that trips up even experienced developers when they encounter edge cases, Unicode characters, nested encoded values, or the difference between encoding a full URL versus a component. ToolHQ's URL Encoder/Decoder takes the guesswork out of it.

Paste your text, click encode or decode, and get the correct result instantly. It is the fastest way to verify that a URL is correctly formed or to read what a tracking URL actually contains.

For related developer tools, explore ToolHQ's Base64 Encoder for encoding binary data, JSON Formatter for making JSON readable, and the full developer tools category for more utilities.

Encode or decode your URL now, free and instant at ToolHQ