Dev Tool

URL Encoder / Decoder

Encode URLs with percent-encoding or decode percent-encoded URL strings back to readable form. Perfect for working with API query parameters, form data, and redirect URLs.

url encoderurl decoderpercent encodingurl encode onlinedecode url stringquery string encoderurl encoding tool freeurlencode online

🛠️ URL Encoder / Decoder

Result appears here.

❓ Frequently Asked Questions — URL Encoder

What is URL encoding and why is it needed?

URL encoding (percent-encoding) converts characters that are not URL-safe into a %XX hex format. URLs can only safely contain letters, digits, and a few symbols. All other characters must be encoded.

For example: a space becomes %20, an ampersand becomes %26, and a hash becomes %23. This prevents browsers from misinterpreting characters as URL structure when passing data in query strings, API requests, and redirect URLs.

What is the difference between URL encode and URL decode?

URL Encode — converts a plain string to percent-encoded format:

hello world&lang=enhello%20world%26lang%3Den

URL Decode — converts a percent-encoded string back to readable form:

hello%20world%26lang%3Denhello world&lang=en

Use encoding when building URLs. Use decoding when reading query parameters from incoming requests.

Which characters need to be URL encoded?

Characters that must be percent-encoded:

  • Space → %20
  • Ampersand &%26
  • Plus +%2B
  • Equals =%3D
  • Question mark ?%3F
  • Hash #%23
  • Slash /%2F
  • All non-ASCII characters (accented letters, emoji, Chinese, Arabic)

Characters that are safe and do NOT need encoding: A-Z a-z 0-9 - _ . ~

How do I encode URL parameters for an API request?

Each API query parameter value must be URL-encoded before appending to the URL. For example:

Search query: hello world & more

Encoded: hello%20world%20%26%20more

Final URL: https://api.example.com/search?q=hello%20world%20%26%20more

In code: use encodeURIComponent() in JavaScript, urllib.parse.quote() in Python, or urlencode() in PHP. Use this tool for quick manual encoding of API endpoint parameters.

What is the difference between encodeURI and encodeURIComponent?

In JavaScript, there are two encoding functions:

  • encodeURI() — encodes a full URL but keeps URL structure characters (/, ?, =, &, #) unencoded. Use for full URLs.
  • encodeURIComponent() — encodes everything including /, ?, =, &. Use for individual parameter values.

Vicspot's URL encoder uses encodeURIComponent() logic — ideal for encoding individual query parameter values and form data.

How do I encode a redirect URL that contains another URL?

When embedding a URL inside another URL as a parameter (e.g., redirect_uri, return_url), the inner URL must be fully percent-encoded:

  • ❌ Invalid: https://app.com/auth?redirect=https://site.com/page?id=5
  • ✅ Correct: https://app.com/auth?redirect=https%3A%2F%2Fsite.com%2Fpage%3Fid%3D5

Paste the inner URL (https://site.com/page?id=5) into the encoder above → click Encode URL → use the result as your redirect parameter value.

What is the difference between URL encoding and HTML encoding?

They are completely different and serve different purposes:

  • URL encoding — uses %XX hex codes for URL-safe strings. &%26
  • HTML encoding — uses &name; entities for safe HTML markup. &&

Use URL encoding for query strings and API parameters. Use HTML encoding for displaying content in HTML pages and preventing XSS. Vicspot provides separate free tools for both.

How to Use the URL Encoder / Decoder

  1. Paste your URL, query string, or encoded URL into the input box above.

  2. Click Encode URL to percent-encode special characters (spaces become %20, & becomes %26, etc.).

  3. Click Decode URL to convert a percent-encoded URL back to its readable form.

  4. Click Copy to copy the result to your clipboard.

What is URL Encoding?

URL encoding (also called percent-encoding) is a method of encoding special characters in a URL so they can be safely transmitted over the internet. Characters that are not allowed in URLs — such as spaces, ampersands, question marks, and non-ASCII characters — are replaced with a percent sign (%) followed by their hexadecimal code. For example, a space becomes %20 and a copyright symbol © becomes %C2%A9.

When is URL Encoding Used?

URL Encoding vs HTML Encoding

URL encoding and HTML entity encoding are different things. URL encoding uses %XX hex codes for URLs, while HTML entity encoding uses sequences like & and < for HTML documents. Use the appropriate tool for your context.